Skip to content

Commit 00a6de2

Browse files
author
Glyn Normington
committed
Merge 54204032-spring-boot-cli-container to master
[#54204032]
2 parents 8b85a2f + b7e1267 commit 00a6de2

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

docs/util-repository-builders.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ The repositories that are currently referenced by the buildpack are easily repli
99
| MySQL JDBC | <https://github.com/cloudfoundry/builder-mysql-jdbc>
1010
| OpenJDK | <https://github.com/cloudfoundry/builder-openjdk>
1111
| PostgreSQL JDBC | <https://github.com/cloudfoundry/builder-postgresql-jdbc>
12+
| Spring Boot CLI | <https://github.com/cloudfoundry/builder-spring-boot-cli>
1213
| Tomcat | <https://github.com/cloudfoundry/builder-tomcat>

lib/java_buildpack/util/tokenized_version.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def initialize(version, allow_wildcards = true)
4343

4444
# Compare this to another array
4545
#
46-
# @return [Integer] A numerical representation of the comparisong between two instances
46+
# @return [Integer] A numerical representation of the comparison between two instances
4747
def <=>(other)
4848
comparison = self[0].to_i <=> other[0].to_i
4949
comparison = self[1].to_i <=> other[1].to_i if comparison == 0
@@ -62,7 +62,7 @@ def to_s # rubocop:disable TrivialAccessors
6262

6363
private
6464

65-
COLLATING_SEQUENCE = ['-'] + ('a'..'z').to_a + ('A'..'Z').to_a + ('0'..'9').to_a
65+
COLLATING_SEQUENCE = ['-', '.'] + ('a'..'z').to_a + ('A'..'Z').to_a + ('0'..'9').to_a
6666

6767
def char_compare(c1, c2)
6868
COLLATING_SEQUENCE.index(c1) <=> COLLATING_SEQUENCE.index(c2)
@@ -134,7 +134,7 @@ def valid_major_minor_or_micro(major_minor_or_micro)
134134
end
135135

136136
def valid_qualifier(qualifier)
137-
qualifier.nil? || qualifier.empty? || qualifier =~ /^[-a-zA-Z\d]*$/ || qualifier =~ /^\+$/
137+
qualifier.nil? || qualifier.empty? || qualifier =~ /^[-\.a-zA-Z\d]*$/ || qualifier =~ /^\+$/
138138
end
139139
end
140140

spec/java_buildpack/util/tokenized_version_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ module JavaBuildpack::Util
4444
expect(TokenizedVersion.new('1.7.0_28a')).to be > TokenizedVersion.new('1.7.0_28')
4545
end
4646

47+
it 'should accept a qualifier with embedded periods and hyphens' do
48+
TokenizedVersion.new('0.5.0_BUILD-20120731.141622-16')
49+
end
50+
4751
it 'should raise an exception when the major version is not numeric' do
4852
expect { TokenizedVersion.new('A') }.to raise_error(/Invalid/)
4953
end

0 commit comments

Comments
 (0)