Class: Callisto::Shell
- Inherits:
-
Object
- Object
- Callisto::Shell
- Defined in:
- lib/callisto/shell.rb
Instance Attribute Summary collapse
-
#arguments ⇒ Object
Returns the value of attribute arguments.
-
#executable ⇒ Object
Returns the value of attribute executable.
Class Method Summary collapse
Instance Method Summary collapse
- #command ⇒ Object
-
#initialize(executable, arguments) ⇒ Shell
constructor
A new instance of Shell.
- #run ⇒ Object
Constructor Details
#initialize(executable, arguments) ⇒ Shell
Returns a new instance of Shell.
15 16 17 18 |
# File 'lib/callisto/shell.rb', line 15 def initialize(executable, arguments) self.executable = executable self.arguments = arguments end |
Instance Attribute Details
#arguments ⇒ Object
Returns the value of attribute arguments.
5 6 7 |
# File 'lib/callisto/shell.rb', line 5 def arguments @arguments end |
#executable ⇒ Object
Returns the value of attribute executable.
5 6 7 |
# File 'lib/callisto/shell.rb', line 5 def executable @executable end |
Class Method Details
.bin_path ⇒ Object
11 12 13 |
# File 'lib/callisto/shell.rb', line 11 def self.bin_path @bin_path end |
.bin_path=(path) ⇒ Object
7 8 9 |
# File 'lib/callisto/shell.rb', line 7 def self.bin_path=(path) @bin_path = path end |
Instance Method Details
#command ⇒ Object
20 21 22 23 |
# File 'lib/callisto/shell.rb', line 20 def command prefix = File.join(*[self.class.bin_path, executable].compact) "#{prefix} #{arguments}" end |
#run ⇒ Object
25 26 27 |
# File 'lib/callisto/shell.rb', line 25 def run `#{command}`.chomp end |