Skip to content

Commit

Permalink
Remove unnecessary code
Browse files Browse the repository at this point in the history
Unless using ruby 2.3 or older, or even of ruby 2.3 if a modern enough
bundler is used, the bundler gemspec should never have its `loaded_from`
attribute set to a missing file, so this whole hack shouldn't be
necessary.
  • Loading branch information
deivid-rodriguez committed May 10, 2021
1 parent c626fd6 commit a7355db
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
6 changes: 1 addition & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
rvm:
- jruby-9.0.5.0
- jruby-9.1.17.0
- jruby-9.2.0.0
jdk:
Expand Down Expand Up @@ -36,8 +35,5 @@ notifications:
- "%{repository} (%{branch}:%{commit} by %{author}): %{message} (%{build_url})"
before_install:
- git fetch --unshallow
- gem update --system 2.6.14
- gem update --system 3.2.17
- gem --version
- rvm @global do gem uninstall bundler -a -x -I || true
- gem uninstall bundler -a -x -I || true
- gem install bundler -v '< 2'
16 changes: 0 additions & 16 deletions lib/warbler/traits/bundler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,6 @@ def add_bundler_gems; require 'bundler'

bundler_specs.each do |spec|
spec = to_spec(spec)
# Bundler HAX -- fixup bad #loaded_from attribute in fake
# bundler gemspec from bundler/source.rb
if spec.name == 'bundler'
full_gem_path = Pathname.new(spec.full_gem_path)
while ! full_gem_path.join('bundler.gemspec').exist?
full_gem_path = full_gem_path.dirname
# if at top of the path, meaning we cannot find bundler.gemspec, abort.
if full_gem_path.to_s =~ /^[\.\/]$/
warn("Unable to detect bundler spec under '#{spec.full_gem_path}'' and its sub-dirs")
exit
end
end

spec.loaded_from = full_gem_path.join('bundler.gemspec').to_s
spec.full_gem_path = full_gem_path.to_s
end

case spec.source
when ::Bundler::Source::Git
Expand Down

0 comments on commit a7355db

Please sign in to comment.