Skip to content

Commit

Permalink
use Gem::Specification.find_by_name instead of Gem.source_index for R…
Browse files Browse the repository at this point in the history
…uby >= 2.0
  • Loading branch information
seiya committed May 23, 2014
1 parent 0ae9171 commit 0fe083e
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions ext/mpi/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,20 @@
gem_path = nil
begin
require "rubygems"
if (spec = Gem.source_index.find_name("narray")).any?
gem_path = spec.last.full_gem_path
if Gem::Specification.respond_to?(:find_by_name)
if spec = Gem::Specification.find_by_name("narray")
gem_path = spec.full_gem_path
end
else
if (spec = Gem.source_index.find_name("narray")).any?
gem_path = spec.full_gem_path
end
end
rescue LoadError
dir_config("narray", Config::CONFIG["sitearchdir"])
end
find_header("narray.h", File.join(gem_path,"src"))
unless find_header("narray.h", gem_path)
find_header("narray.h", File.join(gem_path,"src"))
end

create_makefile("mpi")

0 comments on commit 0fe083e

Please sign in to comment.