Skip to content

Commit

Permalink
Merge pull request #1136 from juanibiapina/relax-java-version-regexp
Browse files Browse the repository at this point in the history
Relax java version regexp
  • Loading branch information
hsbt committed Nov 27, 2017
2 parents 449ba6b + 4889ec7 commit 331a408
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bin/ruby-build
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ fix_rbx_irb() {

require_java7() {
local version="$(java -version 2>&1 | grep '\(java\|openjdk\) version' | head -1)"
if [[ $version != *1.[789]* ]]; then
if [[ $version != *[789]* ]]; then
colorize 1 "ERROR" >&3
echo ": Java 7 required. Please install a 1.7-compatible JRE." >&3
return 1
Expand Down
12 changes: 12 additions & 0 deletions test/build.bats
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,18 @@ DEF
assert_success
}

@test "JRuby Java 9 version string" {
cached_tarball "jruby-9000.dev" bin/jruby

stub java '-version : echo java version "9" >&2'

run_inline_definition <<DEF
require_java7
install_package "jruby-9000.dev" "http://ci.jruby.org/jruby-dist-9000.dev-bin.tar.gz" jruby
DEF
assert_success
}

@test "non-writable TMPDIR aborts build" {
export TMPDIR="${TMP}/build"
mkdir -p "$TMPDIR"
Expand Down

0 comments on commit 331a408

Please sign in to comment.