summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-07-30 14:04:48 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-07-30 14:04:48 +0000
commit0357ac8a38a710a6b64bd8b2bb38f8ba91545eea (patch)
tree50578a5c517b7ff6330409d76ad86e3ea4d5f7e3
parente62ee61262ec101b0456a17bb4ae71471ef8d91c (diff)
* lib/rubygems/platform.rb (Gem::Platform#initialize): Support pattern
like x86_64-netbsd6.99.7. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--lib/rubygems/platform.rb2
-rw-r--r--test/rubygems/test_gem_platform.rb3
3 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index b2e73d6..7622b79 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon Jul 30 23:01:47 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/rubygems/platform.rb (Gem::Platform#initialize): Support pattern
+ like x86_64-netbsd6.99.7.
+
Mon Jul 30 21:00:53 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
* variable.c (find_class_path): no retry when preferred is given.
diff --git a/lib/rubygems/platform.rb b/lib/rubygems/platform.rb
index 682714a..f67e402 100644
--- a/lib/rubygems/platform.rb
+++ b/lib/rubygems/platform.rb
@@ -81,7 +81,7 @@ class Gem::Platform
os, version = $1, $3
@cpu = 'x86' if @cpu.nil? and os =~ /32$/
[os, version]
- when /netbsdelf/ then [ 'netbsdelf', nil ]
+ when /(netbsd[a-z]*)(\d+)/ then [ $1, $2 ]
when /openbsd(\d+\.\d+)/ then [ 'openbsd', $1 ]
when /solaris(\d+\.\d+)/ then [ 'solaris', $1 ]
# test
diff --git a/test/rubygems/test_gem_platform.rb b/test/rubygems/test_gem_platform.rb
index 0350d5f..b6ddc0e 100644
--- a/test/rubygems/test_gem_platform.rb
+++ b/test/rubygems/test_gem_platform.rb
@@ -67,7 +67,8 @@ class TestGemPlatform < Gem::TestCase
'x86-mswin32' => ['x86', 'mswin32', nil],
'x86-mswin32_60' => ['x86', 'mswin32', '60'],
'x86-mswin32-60' => ['x86', 'mswin32', '60'],
- 'i386-netbsdelf' => ['x86', 'netbsdelf', nil],
+ 'i386-netbsdelf5.1.' => ['x86', 'netbsdelf', '5'],
+ 'x86_64-netbsd6.99.7' => ['x86_64', 'netbsd', '6'],
'i386-openbsd4.0' => ['x86', 'openbsd', '4.0'],
'i386-solaris2.10' => ['x86', 'solaris', '2.10'],
'i386-solaris2.8' => ['x86', 'solaris', '2.8'],