[前][次][番号順一覧][スレッド一覧]

ruby-changes:41404

From: nobu <ko1@a...>
Date: Sat, 9 Jan 2016 10:02:00 +0900 (JST)
Subject: [ruby-changes:41404] nobu:r53476 (trunk): extract version from version.h

nobu	2016-01-09 10:02:17 +0900 (Sat, 09 Jan 2016)

  New Revision: 53476

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=53476

  Log:
    extract version from version.h
    
    * tool/mkconfig.rb: extract version numbers from version.h but not
      from API version in include/ruby/version.h.

  Modified files:
    trunk/tool/mkconfig.rb
Index: tool/mkconfig.rb
===================================================================
--- tool/mkconfig.rb	(revision 53475)
+++ tool/mkconfig.rb	(revision 53476)
@@ -198,14 +198,14 @@ IO.foreach(File.join(srcdir, "version.h" https://github.com/ruby/ruby/blob/trunk/tool/mkconfig.rb#L198
   m = /^\s*#\s*define\s+RUBY_(PATCHLEVEL)\s+(-?\d+)/.match(l)
   if m
     versions[m[1]] = m[2]
-    break
+    break if versions.size == 4
+    next
   end
-end
-IO.foreach(File.join(srcdir, "include/ruby/version.h")) do |l|
-  m = /^\s*#\s*define\s+RUBY_API_VERSION_(MAJOR|MINOR|TEENY)\s+(-?\d+)/.match(l)
+  m = /^\s*#\s*define\s+RUBY_VERSION\s+\W?([.\d]+)/.match(l)
   if m
-    versions[m[1]] = m[2]
+    versions['MAJOR'], versions['MINOR'], versions['TEENY'] = m[1].split('.')
     break if versions.size == 4
+    next
   end
 end
 %w[MAJOR MINOR TEENY PATCHLEVEL].each do |v|

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]