mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
merge revision(s) 34809:
* lib/fileutils.rb: use chomp(?/) instead of sub to optimize and avoid to regexping invalid string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f7f7f93a03
commit
1b21d03d76
3 changed files with 10 additions and 5 deletions
|
|
@ -1,3 +1,8 @@
|
|||
Sat Feb 25 17:10:51 2012 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* lib/fileutils.rb: use chomp(?/) instead of sub to optimize and avoid
|
||||
to regexping invalid string.
|
||||
|
||||
Sat Feb 25 17:09:53 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* dir.c (dir_inspect), io.c (rb_io_inspect): keep encoding of path.
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@ module FileUtils
|
|||
fu_output_message "mkdir -p #{options[:mode] ? ('-m %03o ' % options[:mode]) : ''}#{list.join ' '}" if options[:verbose]
|
||||
return *list if options[:noop]
|
||||
|
||||
list.map {|path| path.sub(%r</\z>, '') }.each do |path|
|
||||
list.map {|path| path.chomp(?/) }.each do |path|
|
||||
# optimize for the most common case
|
||||
begin
|
||||
fu_mkdir path, options[:mode]
|
||||
|
|
@ -239,7 +239,7 @@ module FileUtils
|
|||
OPT_TABLE['makedirs'] = [:mode, :noop, :verbose]
|
||||
|
||||
def fu_mkdir(path, mode) #:nodoc:
|
||||
path = path.sub(%r</\z>, '')
|
||||
path = path.chomp(?/)
|
||||
if mode
|
||||
Dir.mkdir path, mode
|
||||
File.chmod mode, path
|
||||
|
|
@ -267,7 +267,7 @@ module FileUtils
|
|||
return if options[:noop]
|
||||
list.each do |dir|
|
||||
begin
|
||||
Dir.rmdir(dir = dir.sub(%r</\z>, ''))
|
||||
Dir.rmdir(dir = dir.chomp(?/))
|
||||
if parents
|
||||
until (parent = File.dirname(dir)) == '.' or parent == dir
|
||||
Dir.rmdir(dir)
|
||||
|
|
@ -1397,7 +1397,7 @@ module FileUtils
|
|||
|
||||
def remove_dir1
|
||||
platform_support {
|
||||
Dir.rmdir path().sub(%r</\z>, '')
|
||||
Dir.rmdir path().chomp(?/)
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#define RUBY_VERSION "1.9.3"
|
||||
#define RUBY_PATCHLEVEL 145
|
||||
#define RUBY_PATCHLEVEL 146
|
||||
|
||||
#define RUBY_RELEASE_DATE "2012-02-25"
|
||||
#define RUBY_RELEASE_YEAR 2012
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue