Class: Aruba::ScriptFile

Inherits:
Object
  • Object
show all
Defined in:
lib/aruba/generators/script_file.rb

Overview

Generate script files on command line

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ ScriptFile

Returns a new instance of ScriptFile.



11
12
13
14
15
# File 'lib/aruba/generators/script_file.rb', line 11

def initialize(opts = {})
  @path        = opts[:path]
  @content     = opts[:content]
  @interpreter = opts[:interpreter]
end

Instance Method Details

#callObject



17
18
19
20
# File 'lib/aruba/generators/script_file.rb', line 17

def call
  Aruba.platform.write_file(path, "#{header}#{content}")
  Aruba.platform.chmod(0755, path, {})
end