summaryrefslogtreecommitdiff
path: root/tool/downloader.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-28 21:47:59 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-28 21:47:59 +0000
commita05330f4b9f556586edb429488a103d57e6d80b9 (patch)
treee5f2a62cc6a0377102c76438f24ff2141e547625 /tool/downloader.rb
parentc47b523246c9e3364640f741f642b053f3515653 (diff)
tool/downloader.rb: fix for old ruby on old CentOS
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/downloader.rb')
-rw-r--r--tool/downloader.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/tool/downloader.rb b/tool/downloader.rb
index 7f5bdbe..567d5ce 100644
--- a/tool/downloader.rb
+++ b/tool/downloader.rb
@@ -22,7 +22,7 @@ class Downloader
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__
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