Class: Scripted::RakeTask

Inherits:
Rake::TaskLib
  • Object
show all
Includes:
Rake::DSL
Defined in:
lib/scripted/rake_task.rb

Instance Method Summary collapse

Constructor Details

#initialize(name, *group_names, &block) ⇒ RakeTask

Returns a new instance of RakeTask.



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/scripted/rake_task.rb', line 10

def initialize(name, *group_names, &block)
  group_names = [:default] if group_names.empty?
  unless Rake.application.last_description
    desc "Run scripted groups: #{group_names.map(&:to_s).join(', ')}"
  end
  task name do
    config = Scripted.configure(&block)
    config.with_default_config_file!
    config.load_files
    Scripted.run(config, *group_names)
  end
end