Skip to content
This repository has been archived by the owner on May 19, 2019. It is now read-only.

Commit

Permalink
Ensure that setting of the jrubyVersion for the topology jar works pr…
Browse files Browse the repository at this point in the history
…operly

This contains some workarounds until jruby-gradle/redstorm#11 is fixed which
will allow us to work on JRuby 9k, until then we'll default to the latest
stable JRuby 1.7.x branch

Fixes #23
  • Loading branch information
R. Tyler Croy committed Sep 9, 2015
1 parent a6d9223 commit ca08305
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,22 @@ class JRubyStormJar extends JRubyJar {
/** parent from which this task will inherit some configuration */
JRubyStorm parentTask

/**
* Return the version of JRuby safe for usage in redstorm
*/
@Override
String getJrubyVersion() {
final String inheritedVersion = super.getJrubyVersion()

/* if our parent has a default version that's 1.7.x, use it */
if (inheritedVersion.matches(/1.7.(\d+)/)) {
return inheritedVersion
}
/* Default to 1.7.22 <https://github.com/jruby-gradle/redstorm/issues/11> */
return '1.7.22'
}

String mainClass = REDSTORM_MAIN
/* Default to 1.7.22 <https://github.com/jruby-gradle/redstorm/issues/11> */
String jrubyVersion = '1.7.22'

@Override
String getConfiguration() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,25 @@ class JRubyStormJarSpec extends Specification {
expect: "that it has no special appendix in the filename"
task.appendix == ''
}

@Issue('https://github.com/jruby-gradle/redstorm/issues/11')
@Issue('https://github.com/jruby-gradle/jruby-gradle-storm-plugin/issues/23')
def 'jrubyVersion should be default to 1.7.xx'() {
given:
JRubyStormJar task = project.task('spock', type: JRubyStormJar)

expect:
task.jrubyVersion == '1.7.22'
}

def "Setting jrubyVersion should override the default"() {
given:
final String version = '1.7.21'
JRubyStormJar task = project.task('spock', type: JRubyStormJar) {
jrubyVersion version
}

expect:
task.jrubyVersion == version
}
}

0 comments on commit ca08305

Please sign in to comment.