diff options
-rw-r--r-- | .github/workflows/jruby.yml | 31 | ||||
-rw-r--r-- | .rubocop.yml | 2 | ||||
-rw-r--r-- | lib/bundler/source/path.rb | 6 | ||||
-rw-r--r-- | spec/realworld/fixtures/warbler/.gitignore | 2 | ||||
-rw-r--r-- | spec/realworld/fixtures/warbler/Gemfile | 7 | ||||
-rw-r--r-- | spec/realworld/fixtures/warbler/bin/warbler-example.rb | 3 | ||||
-rw-r--r-- | spec/realworld/fixtures/warbler/demo/demo.gemspec | 10 |
7 files changed, 60 insertions, 1 deletions
diff --git a/.github/workflows/jruby.yml b/.github/workflows/jruby.yml new file mode 100644 index 0000000000..4974787eed --- /dev/null +++ b/.github/workflows/jruby.yml @@ -0,0 +1,31 @@ +name: jruby + +on: + pull_request: + + push: + branches: + - staging + - trying + +jobs: + warbler: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + + - name: Setup ruby + uses: eregon/use-ruby-action@v1 + with: + ruby-version: jruby-9.2.9.0 + + - name: Install local bundler + run: bin/rake install:local + + - name: Run a warbler project + run: | + cd spec/realworld/fixtures/warbler + bundle install + bundle exec warble + java -jar warbler.jar diff --git a/.rubocop.yml b/.rubocop.yml index 604300a117..3a4d8cb295 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -408,6 +408,8 @@ Naming/ConstantName: Naming/FileName: Enabled: true + Exclude: + - 'spec/realworld/fixtures/warbler/bin/warbler-example.rb' Naming/HeredocDelimiterCase: Enabled: true diff --git a/lib/bundler/source/path.rb b/lib/bundler/source/path.rb index f98f5155fb..e73e33d922 100644 --- a/lib/bundler/source/path.rb +++ b/lib/bundler/source/path.rb @@ -132,7 +132,11 @@ module Bundler end def expand(somepath) - somepath.expand_path(root_path) + if Bundler.current_ruby.jruby? # TODO: Unify when https://github.com/rubygems/bundler/issues/7598 fixed upstream and all supported jrubies include the fix + somepath.expand_path(root_path).expand_path + else + somepath.expand_path(root_path) + end rescue ArgumentError => e Bundler.ui.debug(e) raise PathError, "There was an error while trying to use the path " \ diff --git a/spec/realworld/fixtures/warbler/.gitignore b/spec/realworld/fixtures/warbler/.gitignore new file mode 100644 index 0000000000..6ac0bb4663 --- /dev/null +++ b/spec/realworld/fixtures/warbler/.gitignore @@ -0,0 +1,2 @@ +*.jar +Gemfile.lock diff --git a/spec/realworld/fixtures/warbler/Gemfile b/spec/realworld/fixtures/warbler/Gemfile new file mode 100644 index 0000000000..4fbf2d05a7 --- /dev/null +++ b/spec/realworld/fixtures/warbler/Gemfile @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +source "https://rubygems.org" + +gem "demo", :path => "./demo" +gem "jruby-jars", "~> 9.2" +gem "warbler", "~> 2.0" diff --git a/spec/realworld/fixtures/warbler/bin/warbler-example.rb b/spec/realworld/fixtures/warbler/bin/warbler-example.rb new file mode 100644 index 0000000000..25f614ecc2 --- /dev/null +++ b/spec/realworld/fixtures/warbler/bin/warbler-example.rb @@ -0,0 +1,3 @@ +# frozen_string_literal: true + +puts require "bundler/setup" diff --git a/spec/realworld/fixtures/warbler/demo/demo.gemspec b/spec/realworld/fixtures/warbler/demo/demo.gemspec new file mode 100644 index 0000000000..ed5a0dc080 --- /dev/null +++ b/spec/realworld/fixtures/warbler/demo/demo.gemspec @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +Gem::Specification.new do |spec| + spec.name = "demo" + spec.version = "1.0" + spec.author = "Somebody" + spec.summary = "A demo gem" + spec.license = "MIT" + spec.homepage = "https://example.org" +end |