3
4
5
6
7
8
9
10
11
12
13
14
|
# File 'ext/heap_dump/extconf.rb', line 3
def find_spec name,*requirements
return Gem::Specification.find_by_name(name, *requirements) if Gem::Specification.respond_to? :find_by_name
requirements = Gem::Requirement.default if requirements.empty?
gem = Gem::Dependency.new(name, *requirements)
matches = Gem.source_index.find_name(gem.name, gem.requirement)
raise "No matching #{name} gem!" unless matches.any?
matches.find { |spec|
Gem.loaded_specs[gem.name] == spec
} or matches.last
end
|