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 28
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 33
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 40
def self.submit_to(target, file = TARGETS_FILE)
  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