lib/licensed/source/bundler.rb in licensed-1.2.0 vs lib/licensed/source/bundler.rb in licensed-1.3.0
- old
+ new
@@ -92,9 +92,16 @@
# we can get a non-lazy specification straight from the source
if spec.source.is_a?(::Bundler::Source::Gemspec)
return spec.source.specs.first
end
+ # spec.source.specs gives access to specifications with more
+ # information than spec itself, including platform-specific gems.
+ # try to find a specification that matches `spec`
+ if source_spec = spec.source.specs.find { |s| s.name == spec.name && s.version == spec.version }
+ spec = source_spec
+ end
+
# look for a specification at the bundler specs path
spec_path = ::Bundler.specs_path.join("#{spec.full_name}.gemspec")
return unless File.exist?(spec_path.to_s)
Gem::Specification.load(spec_path.to_s)
end