diff options
author | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-03-03 13:57:31 +0000 |
---|---|---|
committer | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-03-03 13:57:31 +0000 |
commit | 2c8761820f7a5ab1ac5000c47ccb0678e78b9ab9 (patch) | |
tree | 6b781cf51d601caf18f57b4509ea9e89c35c2742 | |
parent | 566b460705d0b58d0e5288dc73cfb80a59ace26e (diff) |
* lib/fileutils.rb (touch): last commit causes error if :mtime option was not given.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11976 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lib/fileutils.rb | 8 |
2 files changed, 7 insertions, 6 deletions
@@ -1,3 +1,8 @@ +Sat Mar 3 22:57:11 2007 Minero Aoki <aamine@loveruby.net> + + * lib/fileutils.rb (touch): last commit causes error if :mtime + option was not given. + Sat Mar 3 22:37:02 2007 Nobuyoshi Nakada <nobu@ruby-lang.org> * file.c (rb_file_s_utime): allow nil to set the current time. diff --git a/lib/fileutils.rb b/lib/fileutils.rb index 9216c7477b..68acb1623e 100644 --- a/lib/fileutils.rb +++ b/lib/fileutils.rb @@ -1014,13 +1014,9 @@ module FileUtils fu_check_options options, OPT_TABLE['touch'] list = fu_list(list) created = nocreate = options[:nocreate] - t = options[:mtime] + t = options[:mtime] || Time.now if options[:verbose] - fu_output_message "touch #{ - nocreate ? ' -c' : '' - }#{ - t ? t.strftime(' -t %Y%m%d%H%M.%S') : '' - }#{list.join ' '}" + fu_output_message "touch #{nocreate ? ' -c' : ''}#{t ? t.strftime(' -t %Y%m%d%H%M.%S') : ''}#{list.join ' '}" end return if options[:noop] list.each do |path| |