File tree Expand file tree Collapse file tree 2 files changed +32
-2
lines changed
integTest/groovy/com/github/jrubygradle/api/core
main/groovy/com/github/jrubygradle/api/gems Expand file tree Collapse file tree 2 files changed +32
-2
lines changed Original file line number Diff line number Diff line change @@ -188,6 +188,26 @@ class IvyXmlProxyServerIntegrationSpec extends Specification {
188188 findFiles (~/ ^asciidoctor-pdf.*\. gem$/ ). size() == 3
189189 }
190190
191+ @Issue (' https://github.com/jruby-gradle/jruby-gradle-plugin/issues/380' )
192+ void ' Resolve transitive which contains a single digit twiddle-wakka' () {
193+ setup :
194+ withBuildFile '''
195+ dependencies {
196+ something 'rubygems:asciidoctor-bibtex:0.3.1'
197+ something 'rubygems:bibtex-ruby:4.4.7', {
198+ force = true
199+ }
200+ }
201+ '''
202+
203+ when :
204+ build()
205+
206+ then :
207+ findFiles ~/ ^asciidoctor-bibtex-0.3.1.gem$/
208+ findFiles ~/ ^bibtex-ruby-4.4.7.gem$/
209+ }
210+
191211 private List<File > findFiles (Pattern pat ) {
192212 new File (projectDir, ' build/something' ). listFiles(new FilenameFilter () {
193213 @Override
Original file line number Diff line number Diff line change @@ -432,11 +432,21 @@ class GemVersion implements Comparable<GemVersion> {
432432 private static GemVersion parseTwiddleWakka (String singleRequirement ) {
433433 String base = getVersionFromRequirement(singleRequirement, TWIDDLE_WAKKA )
434434 List<String > parts = base. tokenize(VERSION_SPLIT )
435- if (1 == parts) {
435+ if (1 == parts. size()) {
436+ if (base =~ ONLY_DIGITS ) {
437+ return new GemVersion (
438+ INCLUSIVE ,
439+ base,
440+ null ,
441+ OPEN_ENDED
442+ )
443+ }
444+
436445 throw new GemVersionException (
437- " '${ singleRequirement} ' does not look like a correctly formattedGEM twiddle-wakka requirement "
446+ " '${ singleRequirement} ' does not look like a correctly formatted GEM twiddle-wakka"
438447 )
439448 }
449+
440450 String lastNumberPart = parts[0 .. -2 ]. reverse(). find {
441451 it =~ ONLY_DIGITS
442452 }
You can’t perform that action at this time.
0 commit comments