8000 Fix default gemspec file list for extension gems by deivid-rodriguez · Pull Request #9673 · ruby/ruby · GitHub
[go: up one dir, main page]

Skip to content

Fix default gemspec file list for extension gems #9673

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Simplify FileCollector interface
  • Loading branch information
deivid-rodriguez committed Mar 21, 2024
commit a5b6a148f86fc4389a820d7a51fa992f4230f787
12 changes: 3 additions & 9 deletions tool/rbinstall.rb
Original file line number Diff line number Diff line change
Expand Up @@ -553,12 +553,10 @@ def collect
end

class Ext < self
def skip_install?(files)
def ruby_libraries
# install ext only when it's configured
!File.exist?("#{makefile_dir}/Makefile")
end
return [] unless File.exist?("#{makefile_dir}/Makefile")

def ruby_libraries
Dir.glob("lib/**/*.rb", base: makefile_dir)
end

Expand All @@ -570,10 +568,6 @@ def makefile_dir
end

class Lib < self
def skip_install?(files)
files.empty?
end

def ruby_libraries
gemname = File.basename(gemspec, ".gemspec")
base = relative_base || gemname
Expand Down Expand Up @@ -763,7 +757,7 @@ def install_default_gem(dir, srcdir, bindir)
spec = load_gemspec("#{base}/#{src}")
file_collector = RbInstall::Specs::FileCollector.for(srcdir, dir, src)
files = file_collector.collect
if file_collector.skip_install?(files)
if files.empty?
next
end
spec.files = files
Expand Down
0