summaryrefslogtreecommitdiff
path: root/lib/bundler/rubygems_ext.rb
diff options
context:
space:
mode:
authorCarl Lerche <carllerche@mac.com>2010-06-05 14:03:33 -0700
committerCarl Lerche <carllerche@mac.com>2010-06-05 14:03:33 -0700
commit91dcd2ce5d0844220741dff4789aedde363f652a (patch)
tree978a6117ebfab6f6810afc9820c24fd8b485299c /lib/bundler/rubygems_ext.rb
parent07b7b0326fa33e1c8ca1533e64571b1a282b0e63 (diff)
downloadbundler-91dcd2ce5d0844220741dff4789aedde363f652a.tar.gz
Fix some platform related bugs
Diffstat (limited to 'lib/bundler/rubygems_ext.rb')
-rw-r--r--lib/bundler/rubygems_ext.rb18
1 files changed, 11 insertions, 7 deletions
diff --git a/lib/bundler/rubygems_ext.rb b/lib/bundler/rubygems_ext.rb
index 11bb9ae1e1..ceab69b9eb 100644
--- a/lib/bundler/rubygems_ext.rb
+++ b/lib/bundler/rubygems_ext.rb
@@ -8,12 +8,22 @@ end
module Gem
@loaded_stacks = Hash.new { |h,k| h[k] = [] }
+ module MatchPlatform
+ def match_platform(p)
+ platform.nil? or p == platform or
+ (p != Gem::Platform::RUBY and p =~ platform) or
+ Gem::Platform::RUBY == platform
+ end
+ end
+
class Specification
attr_accessor :source, :location, :relative_loaded_from
alias_method :rg_full_gem_path, :full_gem_path
alias_method :rg_loaded_from, :loaded_from
+ include MatchPlatform
+
def full_gem_path
source.respond_to?(:path) ?
Pathname.new(loaded_from).dirname.expand_path.to_s :
@@ -72,12 +82,6 @@ module Gem
end
end
- def match_platform(p)
- platform.nil? or p == platform or
- (p != Gem::Platform::RUBY and p =~ platform) or
- (p == Gem::Platform::RUBY and platform.to_generic == Gem::Platform::RUBY)
- end
-
private
def dependencies_to_gemfile(dependencies, group = nil)
@@ -119,7 +123,7 @@ module Gem
class Platform
JAVA = Gem::Platform.new('java')
MSWIN = Gem::Platform.new('mswin32')
- MING = Gem::Platform.new('mingw32')
+ MING = Gem::Platform.new('x86-mingw32')
class << RUBY
def to_generic ; self ; end