Skip to content

Commit 3cb88f0

Browse files
author
Glyn Normington
committed
Merge 59918120- to master
[Completes #59918120]
2 parents db259a9 + f6142dd commit 3cb88f0

3 files changed

Lines changed: 12 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ bundle install --gemfile Gemfile.rubymine-debug
6363
[Pull requests][] are welcome; see the [contributor guidelines][] for details.
6464

6565
## License
66-
The Tomcat Builder is released under version 2.0 of the [Apache License][].
66+
This buildpack is released under version 2.0 of the [Apache License][].
6767

6868
[Apache License]: http://www.apache.org/licenses/LICENSE-2.0
6969
[Cloud Foundry]: http://www.cloudfoundry.com

lib/java_buildpack/repository/repository_index.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ def canonical(raw)
6262
cooked = raw
6363
.gsub(/\{platform\}/, platform)
6464
.gsub(/\{architecture\}/, architecture)
65+
.chomp('/')
6566
@logger.debug { "#{raw} expanded to #{cooked}" }
6667
cooked
6768
end

spec/java_buildpack/repository/repository_index_spec.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,16 @@ module JavaBuildpack::Repository
3535
expect(repository_index.find_item('test-version')).to eq(%w(resolved-version resolved-uri))
3636
end
3737

38+
it 'should cope with trailing slash in repository URI' do
39+
JavaBuildpack::Util::DownloadCache.stub(:new).and_return(application_cache)
40+
application_cache.stub(:get).with(%r(/test-uri/index\.yml))
41+
.and_yield(File.open('spec/fixtures/test-index.yml'))
42+
VersionResolver.stub(:resolve).with('test-version', %w(resolved-version)).and_return('resolved-version')
43+
44+
repository_index = RepositoryIndex.new('{platform}/{architecture}/test-uri/')
45+
expect(repository_index.find_item('test-version')).to eq(%w(resolved-version resolved-uri))
46+
end
47+
3848
it 'should use the read-only buildpack cache when index.yaml cannot be downloaded because the internet is not available' do
3949
stub_request(:get, 'http://foo.com/index.yml').to_raise(SocketError)
4050

0 commit comments

Comments
 (0)