Class: Devkitkat::Executor
- Inherits:
-
Object
- Object
- Devkitkat::Executor
- Defined in:
- lib/devkitkat/executor.rb,
lib/devkitkat/executor/local.rb,
lib/devkitkat/executor/docker.rb
Defined Under Namespace
Constant Summary collapse
- SCRIPT_HEADER =
"#!/bin/bash\nset -e\n"
Instance Attribute Summary collapse
-
#scripts ⇒ Object
readonly
Returns the value of attribute scripts.
-
#service ⇒ Object
readonly
Returns the value of attribute service.
Instance Method Summary collapse
- #commit ⇒ Object
-
#initialize(service) ⇒ Executor
constructor
A new instance of Executor.
- #write(cmd) ⇒ Object
Constructor Details
#initialize(service) ⇒ Executor
Returns a new instance of Executor.
16 17 18 19 |
# File 'lib/devkitkat/executor.rb', line 16 def initialize(service) @service = service delete_script_file end |
Instance Attribute Details
#scripts ⇒ Object (readonly)
Returns the value of attribute scripts.
6 7 8 |
# File 'lib/devkitkat/executor.rb', line 6 def scripts @scripts end |
#service ⇒ Object (readonly)
Returns the value of attribute service.
6 7 8 |
# File 'lib/devkitkat/executor.rb', line 6 def service @service end |
Instance Method Details
#commit ⇒ Object
29 30 31 32 33 |
# File 'lib/devkitkat/executor.rb', line 29 def commit executor.commit(script_file) ensure delete_script_file end |
#write(cmd) ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/devkitkat/executor.rb', line 21 def write(cmd) ensure_script_file File.open(script_file, 'a') do |stream| stream.write(cmd + "\n") end end |