Skip to content

Commit 0c0fd54

Browse files
Merge pull request #8147 from rubygems/deivid-rodriguez/missing-ext-warnings
Prevent some test suite warnings about missing extensions (cherry picked from commit 3565d30)
1 parent 101296a commit 0c0fd54

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

bundler/lib/bundler/rubygems_ext.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -399,13 +399,13 @@ def extensions_dir
399399
end
400400
end
401401

402-
remove_method :ignored? if new.respond_to?(:ignored?)
402+
# Can be removed once RubyGems 3.5.22 support is dropped
403+
unless new.respond_to?(:ignored?)
404+
def ignored?
405+
return @ignored unless @ignored.nil?
403406

404-
# Same as RubyGems, but without warnings, because Bundler prints its own warnings
405-
def ignored?
406-
return @ignored unless @ignored.nil?
407-
408-
@ignored = missing_extensions?
407+
@ignored = missing_extensions?
408+
end
409409
end
410410
end
411411

lib/rubygems/basic_specification.rb

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,14 @@ def base_dir
7171
# Return true if this spec can require +file+.
7272

7373
def contains_requirable_file?(file)
74-
return false if ignored?
74+
if ignored?
75+
if platform == Gem::Platform::RUBY || Gem::Platform.local === platform
76+
warn "Ignoring #{full_name} because its extensions are not built. " \
77+
"Try: gem pristine #{name} --version #{version}"
78+
end
79+
80+
return false
81+
end
7582

7683
is_soext = file.end_with?(".so", ".o")
7784

@@ -89,14 +96,6 @@ def ignored?
8996
return @ignored unless @ignored.nil?
9097

9198
@ignored = missing_extensions?
92-
return false unless @ignored
93-
94-
if platform == Gem::Platform::RUBY || Gem::Platform.local === platform
95-
warn "Ignoring #{full_name} because its extensions are not built. " \
96-
"Try: gem pristine #{name} --version #{version}"
97-
end
98-
99-
true
10099
end
101100

102101
def default_gem?

0 commit comments

Comments
 (0)