Class: Rake::ShipitTask::Step::Task
- Inherits:
-
Object
- Object
- Rake::ShipitTask::Step::Task
- Defined in:
- lib/shipit.rb
Instance Method Summary collapse
-
#initialize(step, *names) ⇒ Task
constructor
A new instance of Task.
- #prepare ⇒ Object
- #run ⇒ Object
Constructor Details
#initialize(step, *names) ⇒ Task
Returns a new instance of Task.
212 213 214 215 |
# File 'lib/shipit.rb', line 212 def initialize(step, *names) @names = names @tasks = [] end |
Instance Method Details
#prepare ⇒ Object
217 218 219 220 221 222 |
# File 'lib/shipit.rb', line 217 def prepare tasks = `rake -T`.scan(/^rake ([^\s]+)/).flatten @names.each do |t| raise "Unknown task #{t}" unless tasks.include? t.to_s end end |
#run ⇒ Object
224 225 226 227 228 |
# File 'lib/shipit.rb', line 224 def run @names.each do |t| system("rake", t.to_s) end end |