lib/callisto/shell.rb in callisto-0.9 vs lib/callisto/shell.rb in callisto-0.9.1
- old
+ new
@@ -3,23 +3,23 @@
class Shell
attr_accessor :executable, :arguments
def self.bin_path=(path)
- @@bin_path = path
+ @bin_path = path
end
+ def self.bin_path
+ @bin_path
+ end
+
def initialize(executable, arguments)
self.executable = executable
self.arguments = arguments
end
def command
- prefix = if defined?(@@bin_path)
- File.join(@@bin_path, executable)
- else
- executable
- end
+ prefix = File.join(*[self.class.bin_path, executable].compact)
"#{prefix} #{arguments}"
end
def run
`#{command}`.chomp