Class: Baleen::Task::Command
- Inherits:
-
Object
- Object
- Baleen::Task::Command
- Defined in:
- lib/baleen/task.rb
Instance Method Summary collapse
- #<<(arg) ⇒ Object
- #before(commands = nil) ⇒ Object
- #commands ⇒ Object
-
#initialize(work_dir, files, bundler) ⇒ Command
constructor
A new instance of Command.
Constructor Details
#initialize(work_dir, files, bundler) ⇒ Command
Returns a new instance of Command.
5 6 7 8 9 10 11 |
# File 'lib/baleen/task.rb', line 5 def initialize(work_dir, files, bundler) @work_dir = work_dir @files = files @bundler = bundler @before = [] build_default_arg end |
Instance Method Details
#<<(arg) ⇒ Object
22 23 24 |
# File 'lib/baleen/task.rb', line 22 def <<(arg) @args << arg end |
#before(commands = nil) ⇒ Object
13 14 15 16 |
# File 'lib/baleen/task.rb', line 13 def before(commands=nil) commands = sanitize_and_tokenize(commands) if commands commands ? @before = commands : @before end |
#commands ⇒ Object
18 19 20 |
# File 'lib/baleen/task.rb', line 18 def commands @before ? @before + @args : @args end |