aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bundler/rubygems_ext.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bundler/rubygems_ext.rb')
-rw-r--r--lib/bundler/rubygems_ext.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/bundler/rubygems_ext.rb b/lib/bundler/rubygems_ext.rb
index 94f8a12d..6f4ffe7a 100644
--- a/lib/bundler/rubygems_ext.rb
+++ b/lib/bundler/rubygems_ext.rb
@@ -124,4 +124,20 @@ module Gem
out
end
end
+
+ class Platform
+ JAVA = Gem::Platform.new('java')
+ MSWIN = Gem::Platform.new('mswin32')
+ MING = Gem::Platform.new('mingw32')
+
+ class << RUBY
+ def to_generic ; self ; end
+ end
+
+ GENERICS = [JAVA, MSWIN, MING, RUBY]
+
+ def to_generic
+ GENERICS.find { |p| self =~ p } || RUBY
+ end
+ end
end