summaryrefslogtreecommitdiff
path: root/lib/rake/file_utils.rb
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-07-15 03:07:37 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-07-15 03:07:37 +0000
commit6361928083d01906ab9d8782b6533b4ed7c834a0 (patch)
tree172488be8a74c9313d35b9cd7d53999cd55f561d /lib/rake/file_utils.rb
parent031e1570b934d6b3a1e17ae8eb78a44dac8186d3 (diff)
* lib/rake.rb, lib/rake/*.rb: Upgrade to rake-10.3.2
[fix GH-668] * test/rake/*.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46818 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rake/file_utils.rb')
-rw-r--r--lib/rake/file_utils.rb20
1 files changed, 16 insertions, 4 deletions
diff --git a/lib/rake/file_utils.rb b/lib/rake/file_utils.rb
index 0f7f459d87..27f4e2e1d1 100644
--- a/lib/rake/file_utils.rb
+++ b/lib/rake/file_utils.rb
@@ -14,12 +14,24 @@ module FileUtils
OPT_TABLE['sh'] = %w(noop verbose)
OPT_TABLE['ruby'] = %w(noop verbose)
- # Run the system command +cmd+. If multiple arguments are given the command
- # is not run with the shell (same semantics as Kernel::exec and
+ # Run the system command +cmd+. If multiple arguments are given the command
+ # is run directly (without the shell, same semantics as Kernel::exec and
# Kernel::system).
#
- # Example:
- # sh %{ls -ltr}
+ # It is recommended you use the multiple argument form over interpolating
+ # user input for both usability and security reasons. With the multiple
+ # argument form you can easily process files with spaces or other shell
+ # reserved characters in them. With the multiple argument form your rake
+ # tasks are not vulnerable to users providing an argument like
+ # <code>; rm # -rf /</code>.
+ #
+ # If a block is given, upon command completion the block is called with an
+ # OK flag (true on a zero exit status) and a Process::Status object.
+ # Without a block a RuntimeError is raised when the command exits non-zero.
+ #
+ # Examples:
+ #
+ # sh 'ls -ltr'
#
# sh 'ls', 'file with spaces'
#