ruby-changes:35649
From: nobu <ko1@a...>
Date: Mon, 29 Sep 2014 06:48:12 +0900 (JST)
Subject: [ruby-changes:35649] nobu:r47731 (trunk): tool/downloader.rb: fix for old ruby on old CentOS
nobu 2014-09-29 06:47:59 +0900 (Mon, 29 Sep 2014) New Revision: 47731 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=47731 Log: tool/downloader.rb: fix for old ruby on old CentOS Modified files: trunk/tool/downloader.rb Index: tool/downloader.rb =================================================================== --- tool/downloader.rb (revision 47730) +++ tool/downloader.rb (revision 47731) @@ -22,7 +22,7 @@ class Downloader https://github.com/ruby/ruby/blob/trunk/tool/downloader.rb#L22 end def self.mode_for(data) - data.start_with?("#!") ? 0755 : 0644 + /\A#!/ =~ data ? 0755 : 0644 end def self.http_options(file, since) @@ -97,15 +97,15 @@ if $0 == __FILE__ https://github.com/ruby/ruby/blob/trunk/tool/downloader.rb#L97 case ARGV[0] when '-d' destdir = ARGV[1] - ARGV.shift(2) + ARGV.shift when '-e' ims = nil - ARGV.shift when /\A-/ abort "#{$0}: unknown option #{ARGV[0]}" else break end + ARGV.shift end dl = Downloader.constants.find do |name| ARGV[0].casecmp(name.to_s) == 0 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/