Class: NewlineHw::Shell::Run

Inherits:
Object
  • Object
show all
Defined in:
lib/newline_hw/shell/run.rb

Overview

Generate a series of language specfic commands to start a project up This command will only be generated if the setup commands exectueded succesfully. It is safe to assume all files and folders are present a time of execution.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pwd, config) ⇒ Run

Returns a new instance of Run.



13
14
15
16
# File 'lib/newline_hw/shell/run.rb', line 13

def initialize(pwd, config)
  @pwd = pwd
  @config = config
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



12
13
14
# File 'lib/newline_hw/shell/run.rb', line 12

def config
  @config
end

#pwdObject (readonly)

Returns the value of attribute pwd.



12
13
14
# File 'lib/newline_hw/shell/run.rb', line 12

def pwd
  @pwd
end

Instance Method Details

#cmdObject



18
19
20
21
22
23
24
# File 'lib/newline_hw/shell/run.rb', line 18

def cmd
  commands = []
  commands += Runners::Ruby.get_commands(pwd)
  commands += Runners::Javascript.get_commands(pwd)
  commands << "#{config.editor} ." if config.launch_editor
  commands.join(" && ")
end