Extract root
helper
It holds the root directory for each type of default gem (ext/ or lib/).
This commit is contained in:
parent
083e7080d1
commit
2dd2204d8c
@ -586,7 +586,11 @@ module RbInstall
|
|||||||
end
|
end
|
||||||
|
|
||||||
def makefile_dir
|
def makefile_dir
|
||||||
File.expand_path("#{$ext_build_dir}/#{relative_base}", srcdir)
|
"#{root}/#{relative_base}"
|
||||||
|
end
|
||||||
|
|
||||||
|
def root
|
||||||
|
File.expand_path($ext_build_dir, srcdir)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -598,7 +602,7 @@ module RbInstall
|
|||||||
if m = /.*(?=-(.*)\z)/.match(gemname)
|
if m = /.*(?=-(.*)\z)/.match(gemname)
|
||||||
base = File.join(base, *m.to_a.select {|n| !base.include?(n)})
|
base = File.join(base, *m.to_a.select {|n| !base.include?(n)})
|
||||||
end
|
end
|
||||||
files = Dir.glob("#{base}{.rb,/**/*.rb}", base: "#{srcdir}/lib")
|
files = Dir.glob("#{base}{.rb,/**/*.rb}", base: root)
|
||||||
if !relative_base and files.empty? # no files at the toplevel
|
if !relative_base and files.empty? # no files at the toplevel
|
||||||
# pseudo gem like ruby2_keywords
|
# pseudo gem like ruby2_keywords
|
||||||
files << "#{gemname}.rb"
|
files << "#{gemname}.rb"
|
||||||
@ -613,6 +617,10 @@ module RbInstall
|
|||||||
|
|
||||||
files
|
files
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def root
|
||||||
|
"#{srcdir}/lib"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user