summaryrefslogtreecommitdiff
path: root/lib/rake/file_utils.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-11 21:35:01 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-11 21:35:01 +0000
commit9cadc95b28da1cf6ca8f802292d12cc96a4f2c2d (patch)
tree73280968d3426b31c5d0b9da1d3e558aa6f9fcb9 /lib/rake/file_utils.rb
parent52c1331763d8b9b8d6362987e6f8847b65ed7f57 (diff)
* NEWS (with all sufficient information):
* lib/rake: Update to rake 10.1.0 * bin/rake: ditto. * test/rake: ditto. * NEWS: Update NEWS to include rake 10.1.0 and links to release notes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rake/file_utils.rb')
-rw-r--r--lib/rake/file_utils.rb20
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/rake/file_utils.rb b/lib/rake/file_utils.rb
index 606bfb65b5..0f7f459d87 100644
--- a/lib/rake/file_utils.rb
+++ b/lib/rake/file_utils.rb
@@ -41,24 +41,26 @@ module FileUtils
unless options[:noop]
res = rake_system(*cmd)
status = $?
- status = PseudoStatus.new(1) if !res && status.nil?
+ status = Rake::PseudoStatus.new(1) if !res && status.nil?
shell_runner.call(res, status)
end
end
def create_shell_runner(cmd) # :nodoc:
show_command = cmd.join(" ")
- show_command = show_command[0,42] + "..." unless $trace
- lambda { |ok, status|
- ok or fail "Command failed with status (#{status.exitstatus}): [#{show_command}]"
- }
+ show_command = show_command[0, 42] + "..." unless $trace
+ lambda do |ok, status|
+ ok or
+ fail "Command failed with status (#{status.exitstatus}): " +
+ "[#{show_command}]"
+ end
end
private :create_shell_runner
def set_verbose_option(options) # :nodoc:
unless options.key? :verbose
options[:verbose] =
- Rake::FileUtilsExt.verbose_flag == Rake::FileUtilsExt::DEFAULT ||
+ (Rake::FileUtilsExt.verbose_flag == Rake::FileUtilsExt::DEFAULT) ||
Rake::FileUtilsExt.verbose_flag
end
end
@@ -74,9 +76,9 @@ module FileUtils
# Example:
# ruby %{-pe '$_.upcase!' <README}
#
- def ruby(*args,&block)
+ def ruby(*args, &block)
options = (Hash === args.last) ? args.pop : {}
- if args.length > 1 then
+ if args.length > 1
sh(*([RUBY] + args + [options]), &block)
else
sh("#{RUBY} #{args.first}", options, &block)
@@ -88,7 +90,7 @@ module FileUtils
# Attempt to do a normal file link, but fall back to a copy if the link
# fails.
def safe_ln(*args)
- unless LN_SUPPORTED[0]
+ if ! LN_SUPPORTED[0]
cp(*args)
else
begin