Skip to content

Commit 67a57bc

Browse files
committed
Version upgrades
This change upgrades the versions of the dependencies to their latest. As part of this upgrade, Rubocop underwent a major version upgrade. This necessitated major updates to the code.
1 parent 5051406 commit 67a57bc

107 files changed

Lines changed: 3930 additions & 3704 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.idea/codeStyleSettings.xml

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gemfile.lock

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,25 @@ GEM
3131
rspec-mocks (3.0.0.beta2)
3232
rspec-support (= 3.0.0.beta2)
3333
rspec-support (3.0.0.beta2)
34-
rubocop (0.18.1)
34+
rubocop (0.19.0)
3535
json (>= 1.7.7, < 2)
36-
parser (~> 2.1.3)
36+
parser (~> 2.1.7)
3737
powerpack (~> 0.0.6)
3838
rainbow (>= 1.99.1, < 3.0)
39+
ruby-progressbar (~> 1.4)
3940
ruby-debug-base19x (0.11.30.pre15)
4041
debugger-ruby_core_source (> 0)
4142
rake (>= 0.8.1)
4243
ruby-debug-ide (0.4.22)
4344
rake (>= 0.8.1)
45+
ruby-progressbar (1.4.2)
4446
safe_yaml (1.0.1)
4547
simplecov (0.8.2)
4648
docile (~> 1.1.0)
4749
multi_json
4850
simplecov-html (~> 0.8.0)
4951
simplecov-html (0.8.0)
50-
slop (3.4.7)
52+
slop (3.5.0)
5153
tee (1.0.0)
5254
webmock (1.17.4)
5355
addressable (>= 2.2.7)

java-buildpack.iml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,13 +288,14 @@
288288
<orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v3.0.0.beta2, rbenv: 1.9.3-p545) [gem]" level="application" />
289289
<orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v3.0.0.beta2, rbenv: 1.9.3-p545) [gem]" level="application" />
290290
<orderEntry type="library" scope="PROVIDED" name="rspec-support (v3.0.0.beta2, rbenv: 1.9.3-p545) [gem]" level="application" />
291-
<orderEntry type="library" scope="PROVIDED" name="rubocop (v0.18.1, rbenv: 1.9.3-p545) [gem]" level="application" />
291+
<orderEntry type="library" scope="PROVIDED" name="rubocop (v0.19.0, rbenv: 1.9.3-p545) [gem]" level="application" />
292292
<orderEntry type="library" scope="PROVIDED" name="ruby-debug-base19x (v0.11.30.pre15, rbenv: 1.9.3-p545) [gem]" level="application" />
293293
<orderEntry type="library" scope="PROVIDED" name="ruby-debug-ide (v0.4.22, rbenv: 1.9.3-p545) [gem]" level="application" />
294+
<orderEntry type="library" scope="PROVIDED" name="ruby-progressbar (v1.4.2, rbenv: 1.9.3-p545) [gem]" level="application" />
294295
<orderEntry type="library" scope="PROVIDED" name="safe_yaml (v1.0.1, rbenv: 1.9.3-p545) [gem]" level="application" />
295296
<orderEntry type="library" scope="PROVIDED" name="simplecov (v0.8.2, rbenv: 1.9.3-p545) [gem]" level="application" />
296297
<orderEntry type="library" scope="PROVIDED" name="simplecov-html (v0.8.0, rbenv: 1.9.3-p545) [gem]" level="application" />
297-
<orderEntry type="library" scope="PROVIDED" name="slop (v3.4.7, rbenv: 1.9.3-p545) [gem]" level="application" />
298+
<orderEntry type="library" scope="PROVIDED" name="slop (v3.5.0, rbenv: 1.9.3-p545) [gem]" level="application" />
298299
<orderEntry type="library" scope="PROVIDED" name="tee (v1.0.0, rbenv: 1.9.3-p545) [gem]" level="application" />
299300
<orderEntry type="library" scope="PROVIDED" name="webmock (v1.17.4, rbenv: 1.9.3-p545) [gem]" level="application" />
300301
<orderEntry type="library" scope="PROVIDED" name="yard (v0.8.7.3, rbenv: 1.9.3-p545) [gem]" level="application" />

lib/java_buildpack/buildpack.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ def release
7979
command = container.release
8080

8181
payload = {
82-
'addons' => [],
83-
'config_vars' => {},
84-
'default_process_types' => { 'web' => command }
82+
'addons' => [],
83+
'config_vars' => {},
84+
'default_process_types' => { 'web' => command }
8585
}.to_yaml
8686

8787
@logger.debug { "Release Payload #{payload}" }
@@ -125,7 +125,7 @@ def component_detection(components)
125125

126126
def diagnose_git_info(print)
127127
if system("git --git-dir=#{GIT_DIR} status 2>/dev/null 1>/dev/null")
128-
remote_url = diagnose_remotes
128+
remote_url = diagnose_remotes
129129
head_commit_sha = diagnose_head_commit
130130
puts "-----> Java Buildpack source: #{remote_url}##{head_commit_sha}" if print
131131
else
@@ -156,9 +156,9 @@ def instantiate(components, additional_libraries, application, java_home, java_o
156156

157157
component_id = component.split('::').last.snake_case
158158
context = {
159-
application: application,
160-
configuration: Util::ConfigurationUtils.load(component_id),
161-
droplet: Component::Droplet.new(additional_libraries, component_id, java_home, java_opts, root) }
159+
application: application,
160+
configuration: Util::ConfigurationUtils.load(component_id),
161+
droplet: Component::Droplet.new(additional_libraries, component_id, java_home, java_opts, root) }
162162

163163
component.constantize.new(context)
164164
end
@@ -199,7 +199,7 @@ class << self
199199
# @yield [Buildpack] the buildpack to work with
200200
# @return [Object] the return value from the given block
201201
def with_buildpack(app_dir, message)
202-
app_dir = Pathname.new(File.expand_path(app_dir))
202+
app_dir = Pathname.new(File.expand_path(app_dir))
203203
application = Component::Application.new(app_dir)
204204
Logging::LoggerFactory.setup app_dir
205205

lib/java_buildpack/component.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616

1717
require 'java_buildpack'
1818

19-
# A module encapsulating the component abstractions and base classes for the Java buildpack
20-
module JavaBuildpack::Component
19+
module JavaBuildpack
20+
21+
# A module encapsulating the component abstractions and base classes for the Java buildpack
22+
module Component
23+
end
24+
2125
end

lib/java_buildpack/component/additional_libraries.rb

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -17,40 +17,42 @@
1717
require 'java_buildpack/component'
1818
require 'java_buildpack/util/qualify_path'
1919

20-
module JavaBuildpack::Component
20+
module JavaBuildpack
21+
module Component
2122

22-
# An abstraction around the additional libraries provided to a droplet by components.
23-
#
24-
# A new instance of this type should be created once for the application.
25-
class AdditionalLibraries < Array
26-
include JavaBuildpack::Util
27-
28-
# Creates an instance of the +JAVA_OPTS+ abstraction.
29-
#
30-
# @param [Pathname] droplet_root the root directory of the droplet
31-
def initialize(droplet_root)
32-
@paths = []
33-
@droplet_root = droplet_root
34-
end
35-
36-
# Returns the contents of the collection as a classpath formatted as +-cp <value1>:<value2>+
23+
# An abstraction around the additional libraries provided to a droplet by components.
3724
#
38-
# @return [String] the contents of the collection as a classpath
39-
def as_classpath
40-
qualified_paths = sort.map { |path| qualify_path path }
25+
# A new instance of this type should be created once for the application.
26+
class AdditionalLibraries < Array
27+
include JavaBuildpack::Util
28+
29+
# Creates an instance of the +JAVA_OPTS+ abstraction.
30+
#
31+
# @param [Pathname] droplet_root the root directory of the droplet
32+
def initialize(droplet_root)
33+
@paths = []
34+
@droplet_root = droplet_root
35+
end
36+
37+
# Returns the contents of the collection as a classpath formatted as +-cp <value1>:<value2>+
38+
#
39+
# @return [String] the contents of the collection as a classpath
40+
def as_classpath
41+
qualified_paths = sort.map { |path| qualify_path path }
42+
43+
"-cp #{qualified_paths.join ':'}"
44+
end
45+
46+
# Symlink the contents of the collection to a destination directory.
47+
#
48+
# @param [Pathname] destination the destination to link to
49+
# @return [void]
50+
def link_to(destination)
51+
FileUtils.mkdir_p destination
52+
each { |path| (destination + path.basename).make_symlink(path.relative_path_from(destination)) }
53+
end
4154

42-
"-cp #{qualified_paths.join ':'}"
43-
end
44-
45-
# Symlink the contents of the collection to a destination directory.
46-
#
47-
# @param [Pathname] destination the destination to link to
48-
# @return [void]
49-
def link_to(destination)
50-
FileUtils.mkdir_p destination
51-
each { |path| (destination + path.basename).make_symlink(path.relative_path_from(destination)) }
5255
end
5356

5457
end
55-
5658
end

lib/java_buildpack/component/application.rb

Lines changed: 42 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -19,57 +19,59 @@
1919
require 'java_buildpack/util/filtering_pathname'
2020
require 'yaml'
2121

22-
module JavaBuildpack::Component
22+
module JavaBuildpack
23+
module Component
2324

24-
# An abstraction around the application as uploaded by the user. This abstraction is intended to hide any
25-
# modifications made to the filesystem by other components. Think of this as an immutable representation of the
26-
# application as it was uploaded.
27-
#
28-
# A new instance of this type should be created once for the application.
29-
class Application
25+
# An abstraction around the application as uploaded by the user. This abstraction is intended to hide any
26+
# modifications made to the filesystem by other components. Think of this as an immutable representation of the
27+
# application as it was uploaded.
28+
#
29+
# A new instance of this type should be created once for the application.
30+
class Application
3031

31-
# @!attribute [r] details
32-
# @return [Hash] the parsed contents of the +VCAP_APPLICATION+ environment variable
33-
attr_reader :details
32+
# @!attribute [r] details
33+
# @return [Hash] the parsed contents of the +VCAP_APPLICATION+ environment variable
34+
attr_reader :details
3435

35-
# @!attribute [r] environment
36-
# @return [Hash] all environment variables except +VCAP_APPLICATION+ and +VCAP_SERVICES+. Those values are
37-
# available separately in parsed form.
38-
attr_reader :environment
36+
# @!attribute [r] environment
37+
# @return [Hash] all environment variables except +VCAP_APPLICATION+ and +VCAP_SERVICES+. Those values are
38+
# available separately in parsed form.
39+
attr_reader :environment
3940

40-
# @!attribute [r] root
41-
# @return [JavaBuildpack::Util::FilteringPathname] the root of the application's fileystem filtered so that it
42-
# only shows files that have been uploaded by the user
43-
attr_reader :root
41+
# @!attribute [r] root
42+
# @return [JavaBuildpack::Util::FilteringPathname] the root of the application's fileystem filtered so that it
43+
# only shows files that have been uploaded by the user
44+
attr_reader :root
4445

45-
# @!attribute [r] services
46-
# @return [Hash] the parsed contents of the +VCAP_SERVICES+ environment variable
47-
attr_reader :services
46+
# @!attribute [r] services
47+
# @return [Hash] the parsed contents of the +VCAP_SERVICES+ environment variable
48+
attr_reader :services
4849

49-
# Create a new instance of the application abstraction
50-
#
51-
# @param [Pathname] root the root of the application
52-
def initialize(root)
53-
initial = children(root)
54-
@root = JavaBuildpack::Util::FilteringPathname.new(root, ->(path) { initial.member? path }, false)
50+
# Create a new instance of the application abstraction
51+
#
52+
# @param [Pathname] root the root of the application
53+
def initialize(root)
54+
initial = children(root)
55+
@root = JavaBuildpack::Util::FilteringPathname.new(root, ->(path) { initial.member? path }, false)
5556

56-
@environment = ENV.to_hash
57-
@details = parse(@environment.delete('VCAP_APPLICATION'))
58-
@services = Services.new(parse(@environment.delete('VCAP_SERVICES')))
59-
end
57+
@environment = ENV.to_hash
58+
@details = parse(@environment.delete('VCAP_APPLICATION'))
59+
@services = Services.new(parse(@environment.delete('VCAP_SERVICES')))
60+
end
6061

61-
private
62+
private
6263

63-
def children(root, s = Set.new)
64-
s << root
65-
root.children.each { |child| children(child, s) } if root.directory?
66-
s
67-
end
64+
def children(root, s = Set.new)
65+
s << root
66+
root.children.each { |child| children(child, s) } if root.directory?
67+
s
68+
end
69+
70+
def parse(input)
71+
input ? YAML.load(input) : {}
72+
end
6873

69-
def parse(input)
70-
input ? YAML.load(input) : {}
7174
end
7275

7376
end
74-
7577
end

0 commit comments

Comments
 (0)