Class: Bake::Blocks::CommandLine

Inherits:
Object
  • Object
show all
Includes:
HasExecuteCommand
Defined in:
lib/blocks/commandLine.rb

Instance Attribute Summary

Attributes included from HasExecuteCommand

#config

Instance Method Summary collapse

Methods included from HasExecuteCommand

#executeCommand

Constructor Details

#initialize(config) ⇒ CommandLine

Returns a new instance of CommandLine.



9
10
11
12
13
# File 'lib/blocks/commandLine.rb', line 9

def initialize(config)
  @config = config # Bake::Metamodel::CommandLine
  @commandLine = config.name.kind_of?(Array) ? config.name.join(' ') : config.name
  @projectDir = config.get_project_dir
end

Instance Method Details

#cleanObject



36
37
38
39
# File 'lib/blocks/commandLine.rb', line 36

def clean
  # nothing to do here
  return true
end

#cleanStepObject



32
33
34
# File 'lib/blocks/commandLine.rb', line 32

def cleanStep
  return run()
end

#executeObject



20
21
22
# File 'lib/blocks/commandLine.rb', line 20

def execute
  return run()
end

#exitStepObject



28
29
30
# File 'lib/blocks/commandLine.rb', line 28

def exitStep
  return run()
end

#runObject



15
16
17
18
# File 'lib/blocks/commandLine.rb', line 15

def run
  return true if Bake.options.linkOnly
  return executeCommand(@commandLine, nil, @config.validExitCodes, @config.echo)
end

#startupStepObject



24
25
26
# File 'lib/blocks/commandLine.rb', line 24

def startupStep
  return run()
end