patir 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +3 -0
- data/lib/patir/base.rb +1 -1
- data/lib/patir/command.rb +3 -5
- metadata +1 -1
data/History.txt
CHANGED
data/lib/patir/base.rb
CHANGED
data/lib/patir/command.rb
CHANGED
@@ -117,9 +117,9 @@ module Patir
|
|
117
117
|
params=args[0] if args
|
118
118
|
raise ParameterException,"No ShellCommand parameters defined" unless params
|
119
119
|
@name=params[:name]
|
120
|
-
@working_directory=File.expand_path(params[:working_directory])
|
120
|
+
@working_directory=File.expand_path(params[:working_directory]) if params[:working_directory]
|
121
121
|
#initialize the working directory value. This actually means ./
|
122
|
-
@working_directory||=
|
122
|
+
@working_directory||=Dir.pwd
|
123
123
|
#we need a command line :)
|
124
124
|
raise ParameterException,"No :command defined" unless params[:cmd]
|
125
125
|
@command=params[:cmd]
|
@@ -456,7 +456,7 @@ module Patir
|
|
456
456
|
include Patir::Command
|
457
457
|
def initialize name,working_directory=nil,&block
|
458
458
|
@name=name
|
459
|
-
@working_directory=File.expand_path(working_directory)
|
459
|
+
@working_directory=File.expand_path(working_directory) if working_directory
|
460
460
|
@working_directory||=Dir.pwd
|
461
461
|
if block_given?
|
462
462
|
@cmd=block
|
@@ -476,8 +476,6 @@ module Patir
|
|
476
476
|
rescue SystemCallError
|
477
477
|
@output="#{$!}"
|
478
478
|
@success=false
|
479
|
-
ensure
|
480
|
-
Dir.chdir(prev_dir)
|
481
479
|
end
|
482
480
|
return @success
|
483
481
|
end
|