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\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.
15 16 17 18 |
# File 'lib/devkitkat/executor.rb', line 15 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
28 29 30 31 32 |
# File 'lib/devkitkat/executor.rb', line 28 def commit executor.commit(script_file) ensure delete_script_file end |
#write(cmd) ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/devkitkat/executor.rb', line 20 def write(cmd) ensure_script_file File.open(script_file, 'a') do |stream| stream.write(cmd + "\n") end end |