summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2024-01-24 10:22:26 +0100
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2024-03-25 11:55:08 +0900
commit2b703eed46237d28ca71f3ed24f77bf53cf81720 (patch)
tree8ca846cbb6a47a45a3ed5d5211e2c0d704a8bb37 /tool
parentbece07e6c3716f93c0f2b98159430aa5df51c0a0 (diff)
Consistently put requirable features in default gemspecs file list
Diffstat (limited to 'tool')
-rwxr-xr-xtool/rbinstall.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb
index b13e6d5ba9..ee09397cd2 100755
--- a/tool/rbinstall.rb
+++ b/tool/rbinstall.rb
@@ -549,24 +549,24 @@ module RbInstall
end
def collect
- libraries.sort
+ requirable_features.sort
end
class Ext < self
- def libraries
+ def requirable_features
# install ext only when it's configured
return [] unless File.exist?(makefile_path)
- ruby_libraries + ext_libraries
+ ruby_features + ext_features
end
private
- def ruby_libraries
+ def ruby_features
Dir.glob("**/*.rb", base: "#{makefile_dir}/lib")
end
- def ext_libraries
+ def ext_features
makefile = File.read(makefile_path)
name = makefile[/^TARGET[ \t]*=[ \t]*((?:.*\\\n)*.*)/, 1]
@@ -586,24 +586,24 @@ module RbInstall
end
class Lib < self
- def libraries
+ def requirable_features
gemname = File.basename(gemspec, ".gemspec")
base = relative_base || gemname
# for lib/net/net-smtp.gemspec
if m = /.*(?=-(.*)\z)/.match(gemname)
base = File.join(base, *m.to_a.select {|n| !base.include?(n)})
end
- files = Dir.glob("lib/#{base}{.rb,/**/*.rb}", base: srcdir)
+ files = Dir.glob("#{base}{.rb,/**/*.rb}", base: "#{srcdir}/lib")
if !relative_base and files.empty? # no files at the toplevel
# pseudo gem like ruby2_keywords
- files << "lib/#{gemname}.rb"
+ files << "#{gemname}.rb"
end
case gemname
when "net-http"
- files << "lib/net/https.rb"
+ files << "net/https.rb"
when "optparse"
- files << "lib/optionparser.rb"
+ files << "optionparser.rb"
end
files