Class: YaQueen::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/ya_queen/config.rb

Instance Method Summary collapse

Constructor Details

#initialize(context, path) ⇒ Config

Returns a new instance of Config.



5
6
7
8
# File 'lib/ya_queen/config.rb', line 5

def initialize(context, path)
  @configs = YAML.load_file(path)
  @context = context
end

Instance Method Details

#define_server_tasks(name, options = {}) {|t, config| ... } ⇒ Object

Yields:

  • (t, config)


10
11
12
13
14
15
16
# File 'lib/ya_queen/config.rb', line 10

def define_server_tasks(name, options = {})
  config = @configs[name]
  klass = options[:class] || Base
  t = klass.new(@context, name, @configs)
  yield(t, config) if block_given?
  t.define_tasks
end