Class: Baleen::Task::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/baleen/task.rb

Instance Method Summary collapse

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

#commandsObject



18
19
20
# File 'lib/baleen/task.rb', line 18

def commands
  @before ? @before + @args : @args
end