diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-10-28 07:13:39 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-10-28 07:13:39 +0000 |
commit | b39833e1d768c5461cbf1475367677eb0ec15ba3 (patch) | |
tree | 057cbeb0a73b5afd770ea29ad976ab84c4d1dbdf | |
parent | 993a9404cbdef5d99a04fd4920e10829301e9777 (diff) |
* tool/make-snapshot: use String#bytesize.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 4 | ||||
-rwxr-xr-x | tool/make-snapshot | 10 |
2 files changed, 12 insertions, 2 deletions
@@ -1,3 +1,7 @@ +Tue Oct 28 16:13:36 2008 Nobuyoshi Nakada <[email protected]> + + * tool/make-snapshot: use String#bytesize. + Tue Oct 28 09:51:48 2008 NAKAMURA Usaku <[email protected]> * bootstraptest/test_thread.rb: ignore some exceptions. diff --git a/tool/make-snapshot b/tool/make-snapshot index 7ad64bd55d..134a6e6d4c 100755 --- a/tool/make-snapshot +++ b/tool/make-snapshot @@ -1,4 +1,5 @@ #!/usr/bin/ruby -s +# -*- encoding: us-ascii -*- require 'uri' require 'digest/md5' require 'digest/sha2' @@ -20,6 +21,11 @@ ENV["RUBY"] ||= "ruby" ENV["MV"] ||= "mv" ENV["MINIRUBY"] ||= "ruby" +class String + # for older ruby + alias bytesize size unless method_defined?(:bytesize) +end + $patch_file &&= File.expand_path($patch_file) path = ENV["PATH"].split(File::PATH_SEPARATOR) %w[YACC BASERUBY RUBY MV MINIRUBY].each do |var| @@ -56,7 +62,7 @@ def package(rev, destdir) when /\Astable\z/ url = SVNURL + "branches/" url = url + `svn ls #{url}`[/.*^(ruby_\d+_\d+)\//m, 1] - when /\A(.*)\.(.*)\.(.*)-(p)?(.*)/ + when /\A(.*)\.(.*)\.(.*)-((?!preview)p)?(.*)/ patchlevel = !!$4 tag = "#{$4}#{$5}" url = SVNURL + "tags/v#{$1}_#{$2}_#{$3}_#{$5}" @@ -196,6 +202,6 @@ revisions.collect {|rev| package(rev, destdir)}.flatten.each do |name| sha = Digest::SHA256.hexdigest str puts "MD5(#{name})= #{md5}" puts "SHA256(#{name})= #{sha}" - puts "SIZE(name)= #{str.size}" + puts "SIZE(name)= #{str.bytesize}" puts end |