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 41b3847
Show file tree
Hide file tree
Showing 3 changed files with 3 additions 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'
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ source "https://rubygems.org/"

gemspec

gem 'jbundler', git: 'https://github.com/mkristian/jbundler'

gem 'rubyzip', ENV['RUBYZIP_VERSION'] if ENV['RUBYZIP_VERSION']
gem 'rake', ENV['RAKE_VERSION'], :require => nil if ENV['RAKE_VERSION']

Expand Down
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 41b3847

Please sign in to comment.