summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-01-09 01:02:17 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-01-09 01:02:17 (GMT)
commitd58e799d41e2139db6b066d6b14dcddc64c9fc53 (patch)
treefe76bdc268be1ef6343241efee8abe3a1156dcd2 /tool
parent1fbfa7180b5a5d8e792fbbc25228402b740f0d41 (diff)
extract version from version.h
* tool/mkconfig.rb: extract version numbers from version.h but not from API version in include/ruby/version.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool')
-rwxr-xr-xtool/mkconfig.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/tool/mkconfig.rb b/tool/mkconfig.rb
index c14d1ef..63dbecb 100755
--- a/tool/mkconfig.rb
+++ b/tool/mkconfig.rb
@@ -198,14 +198,14 @@ IO.foreach(File.join(srcdir, "version.h")) do |l|
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|