Class: Aruba::ScriptFile
- Inherits:
-
Object
- Object
- Aruba::ScriptFile
- Defined in:
- lib/aruba/generators/script_file.rb
Overview
Generate script files on command line
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(opts = {}) ⇒ ScriptFile
constructor
A new instance of ScriptFile.
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
#call ⇒ Object
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(0o755, path, {}) end |