Skip to content

Commit

Permalink
Merge pull request #340 from heroku/jruby_9000
Browse files Browse the repository at this point in the history
special case for patchlevel rubies. fixes jruby 9.0.0.0.pre1
  • Loading branch information
hone committed Jan 21, 2015
2 parents ccdcd56 + 58ab672 commit 881d794
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions hatchet.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"sharpstone/ruby_193_jruby_17161",
"sharpstone/ruby_193_jruby_17161_jdk7",
"sharpstone/ruby_193_jruby_17161_jdk8",
"kissaten/jruby-minimal",
"sharpstone/empty-procfile",
"sharpstone/bad_ruby_version"
],
Expand Down
2 changes: 1 addition & 1 deletion lib/language_pack/helpers/bundler_wrapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def ruby_version
if output.match(/No ruby version specified/)
""
else
output.chomp.sub('(', '').sub(')', '').sub("p", " p").split.join('-')
output.chomp.sub('(', '').sub(')', '').sub(/(p\d+)/, ' \1').split.join('-')
end
end
end
Expand Down
18 changes: 18 additions & 0 deletions spec/helpers/bundler_wrapper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,23 @@
expect(@bundler.install.windows_gemfile_lock?).to be_true
end
end

describe "when executing bundler" do
before do
@bundler.install
end

it "handles JRuby pre gemfiles" do
Hatchet::App.new("jruby-minimal").in_directory do |dir|
expect(@bundler.ruby_version).to eq("ruby-2.2.0-jruby-9.0.0.0.pre1")
end
end

it "handles MRI patchlevel gemfiles" do
Hatchet::App.new("mri_193_p547").in_directory do |dir|
expect(@bundler.ruby_version).to eq("ruby-1.9.3-p547")
end
end
end
end

0 comments on commit 881d794

Please sign in to comment.