module Yast::Tasks
Yast::Task module contains helper methods
Constants
- TARGETS_FILE
Targets definition
Public Class Methods
configuration(&block)
click to toggle source
# File lib/yast/tasks.rb, line 30 def self.configuration(&block) ::Packaging.configuration(&block) end
spec_version()
click to toggle source
read the version from spec file
# File lib/yast/tasks.rb, line 35 def self.spec_version # use the first *.spec file found, assume all spec files # contain the same version File.readlines(Dir.glob("package/*.spec").first) .grep(/^\s*Version:\s*/).first.sub("Version:", "").strip end
submit_to(target, file = TARGETS_FILE)
click to toggle source
# File lib/yast/tasks.rb, line 42 def self.submit_to(target, file = TARGETS_FILE) # override the target via environment target = ENV["YAST_SUBMIT"].to_sym if ENV["YAST_SUBMIT"] targets = YAML.load_file(file) config = targets[target] if config.nil? raise "No configuration found for #{target}. Known values: #{targets.keys.join(", ")}" end Yast::Tasks.configuration do |conf| config.each do |meth, val| conf.public_send("#{meth}=", val) end end end