Class: Scripted::Commands::Rake
- Inherits:
-
Object
- Object
- Scripted::Commands::Rake
- Defined in:
- lib/scripted/commands/rake.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
Returns the value of attribute command.
Instance Method Summary collapse
- #execute!(log = STDOUT) ⇒ Object
-
#initialize(command) ⇒ Rake
constructor
A new instance of Rake.
Constructor Details
#initialize(command) ⇒ Rake
Returns a new instance of Rake.
10 11 12 |
# File 'lib/scripted/commands/rake.rb', line 10 def initialize(command) @command = command end |
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
8 9 10 |
# File 'lib/scripted/commands/rake.rb', line 8 def command @command end |
Instance Method Details
#execute!(log = STDOUT) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/scripted/commands/rake.rb', line 14 def execute!(log = STDOUT) task = Rake::Task[command] rescue NameError # not running from within Rake, so falling back shelling out Shell.new("rake #{command} --trace").execute!(log) else Ruby.new(lambda { task.invoke }).execute!(log) end |