Skip to content

Commit 68095ff

Browse files
committed
irb and reline are now bundled gems, we don't need to skip workaround for them
1 parent 750e619 commit 68095ff

File tree

2 files changed

+1
-15
lines changed

2 files changed

+1
-15
lines changed

lib/bundled_gems.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,6 @@ def self.warning?(name, specs: nil)
127127
# name can be a feature name or a file path with String or Pathname
128128
feature = File.path(name)
129129

130-
# irb already has reline as a dependency on gemspec, so we don't want to warn about it.
131-
# We should update this with a more general solution when we have another case.
132-
# ex: Gem.loaded_specs[called_gem].dependencies.any? {|d| d.name == feature }
133-
return false if feature.start_with?("reline") && caller_locations(2, 1)[0].to_s.include?("irb")
134-
135130
# The actual checks needed to properly identify the gem being required
136131
# are costly (see [Bug #20641]), so we first do a much cheaper check
137132
# to exclude the vast majority of candidates.

spec/bundled_gems_spec.rb

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def self.ruby=(ruby)
6464
Gem::BUNDLED_GEMS.send(:remove_const, :PREFIXED)
6565
Gem::BUNDLED_GEMS.const_set(:LIBDIR, File.expand_path(File.join(__dir__, "../../..", "lib")) + "/")
6666
Gem::BUNDLED_GEMS.const_set(:ARCHDIR, File.expand_path($LOAD_PATH.find{|path| path.include?(".ext/common") }) + "/")
67-
Gem::BUNDLED_GEMS.const_set(:SINCE, { "openssl" => RUBY_VERSION, "fileutils" => RUBY_VERSION, "irb" => "3.5.0", "csv" => "3.4.0", "net-smtp" => "3.1.0" })
67+
Gem::BUNDLED_GEMS.const_set(:SINCE, { "openssl" => RUBY_VERSION, "fileutils" => RUBY_VERSION, "csv" => "3.4.0", "net-smtp" => "3.1.0" })
6868
Gem::BUNDLED_GEMS.const_set(:SINCE_FAST_PATH, Gem::BUNDLED_GEMS::SINCE.transform_keys { |g| g.sub(/\A.*\-/, "") } )
6969
Gem::BUNDLED_GEMS.const_set(:PREFIXED, { "openssl" => true })
7070
STUB
@@ -365,13 +365,4 @@ def my
365365

366366
expect(err).to be_empty
367367
end
368-
369-
it "Don't show warning for reline when using irb from standard library" do
370-
create_file("stub.rb", stub_code)
371-
create_file("Gemfile", "source 'https://rubygems.org'")
372-
bundle "exec ruby -r./stub -rirb -e ''"
373-
374-
expect(err).to include(/irb was loaded from (.*) from Ruby 3.5.0/)
375-
expect(err).to_not include(/reline was loaded from (.*) from Ruby 3.5.0/)
376-
end
377368
end

0 commit comments

Comments
 (0)