lib/fulmar/shell.rb in fulmar-shell-1.1.2 vs lib/fulmar/shell.rb in fulmar-shell-1.2.0

- old
+ new

@@ -3,16 +3,17 @@ # This shell is part of the fulmar deployment tools # it can be used stand-alone, though module Fulmar # Implements simple access to shell commands class Shell - VERSION = '1.1.2' + VERSION = '1.2.0' attr_accessor :debug, :last_output, :last_error, :quiet + attr_reader :path def initialize(path, host = 'localhost') - @path = (path.nil? || path.empty?) ? '.' : path + @path = File.expand_path((path.nil? || path.empty?) ? '.' : path) @host = host @last_output = [] @last_error = [] @debug = false @quiet = false @@ -31,9 +32,13 @@ end end def local? @host == 'localhost' + end + + def path=(path) + @path = File.expand_path(path) end protected # Run the command and capture the output