Class: Space::Source::Command
- Inherits:
-
Object
- Object
- Space::Source::Command
- Defined in:
- lib/space/source/command.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
Returns the value of attribute command.
-
#key ⇒ Object
Returns the value of attribute key.
-
#source ⇒ Object
Returns the value of attribute source.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(source, key, command) ⇒ Command
constructor
A new instance of Command.
- #refresh ⇒ Object
Constructor Details
#initialize(source, key, command) ⇒ Command
Returns a new instance of Command.
17 18 19 20 21 |
# File 'lib/space/source/command.rb', line 17 def initialize(source, key, command) @source = source @key = key @command = command end |
Instance Attribute Details
#command ⇒ Object
Returns the value of attribute command.
15 16 17 |
# File 'lib/space/source/command.rb', line 15 def command @command end |
#key ⇒ Object
Returns the value of attribute key.
15 16 17 |
# File 'lib/space/source/command.rb', line 15 def key @key end |
#source ⇒ Object
Returns the value of attribute source.
15 16 17 |
# File 'lib/space/source/command.rb', line 15 def source @source end |
Class Method Details
.execute(dir, command) ⇒ Object
9 10 11 12 |
# File 'lib/space/source/command.rb', line 9 def execute(dir, command) log "#{File.basename(dir)} $ #{command}" Open3.capture2e("cd #{dir}; #{command}").first end |
Instance Method Details
#refresh ⇒ Object
23 24 25 |
# File 'lib/space/source/command.rb', line 23 def refresh Thread.new(&method(:run)) end |