File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
jruby-gradle-base-plugin/src
main/groovy/com/github/jrubygradle/internal
test/groovy/com/github/jrubygradle/internal Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,8 @@ class GemVersion {
67
67
* @param String version
68
68
*/
69
69
GemVersion (String version ) {
70
+ // workaround a bug in gem proxy which can not handle != operators
71
+ version = version. replace(' =' , ' ' )
70
72
if (version. contains(' +' )) {
71
73
low = ZEROS . matcher(PLUS . matcher(DOT_PLUS . matcher(version). replaceFirst(' .0' )). replaceFirst(' ' )). replaceFirst(' ' )
72
74
high = DIGITS_PLUS . matcher(DOT_PLUS . matcher(version). replaceFirst(' .99999' )). replaceFirst(MAX_VERSION )
Original file line number Diff line number Diff line change @@ -163,14 +163,22 @@ class GemVersionSpec extends Specification {
163
163
subject. intersect(' [0,)' ). toString() == ' [0.9,0.9.99999]'
164
164
}
165
165
166
- def " intersects two versions special one " () {
166
+ def " intersects two versions with special full range " () {
167
167
given :
168
168
GemVersion subject = new GemVersion (' [0,)' )
169
169
170
170
expect :
171
171
subject. intersect(' [0.9.0,0.9.99999]' ). toString() == ' [0.9,0.9.99999]'
172
172
}
173
173
174
+ def " intersects two versions with workaround due to upstream bug" () {
175
+ given :
176
+ GemVersion subject = new GemVersion (' (=2.5.1.1,99999)' )
177
+
178
+ expect :
179
+ subject. intersect(' (=2.5.1.1,)' ). toString() == ' (2.5.1.1,99999)'
180
+ }
181
+
174
182
def " intersects with conflict" () {
175
183
given :
176
184
GemVersion subject = new GemVersion (' [1.2.1, 1.2.3]' )
You can’t perform that action at this time.
0 commit comments