File tree Expand file tree Collapse file tree
lib/java_buildpack/repository
spec/java_buildpack/repository Expand file tree Collapse file tree Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments