Skip to content

Commit db64526

Browse files
committed
Dependency Updates
This change updates the buildpack with new development dependencies. In addition, it updates the code to be compliant with the new version of Rubocop.
1 parent 7c68c04 commit db64526

File tree

119 files changed

+262
-265
lines changed

Some content is hidden

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

119 files changed

+262
-265
lines changed

.rubocop.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ AllCops:
77
- 'rakelib/**/*'
88
Exclude:
99
- 'build/**/*'
10-
- Gemfile # TODO: Remove when upgrading to any version after 0.48.1
10+
- Gemfile
1111
Layout/EmptyLinesAroundBlockBody:
1212
Exclude:
1313
- 'spec/**/*.rb'
@@ -50,5 +50,7 @@ RSpec/NestedGroups:
5050
Max: 4
5151
Style/Documentation:
5252
Enabled: false
53+
Style/FormatStringToken:
54+
Enabled: false
5355
Style/MethodMissing:
5456
Enabled: false

Gemfile.lock

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,55 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
addressable (2.5.1)
5-
public_suffix (~> 2.0, >= 2.0.2)
4+
addressable (2.5.2)
5+
public_suffix (>= 2.0.2, < 4.0)
66
ast (2.3.0)
77
crack (0.4.3)
88
safe_yaml (~> 1.0.0)
99
diff-lcs (1.3)
10-
hashdiff (0.3.4)
11-
parallel (1.11.2)
12-
parser (2.4.0.0)
13-
ast (~> 2.2)
10+
hashdiff (0.3.7)
11+
parallel (1.12.1)
12+
parser (2.4.0.2)
13+
ast (~> 2.3)
1414
powerpack (0.1.1)
15-
public_suffix (2.0.5)
16-
rainbow (2.2.2)
17-
rake
18-
rake (12.0.0)
15+
public_suffix (3.0.1)
16+
rainbow (3.0.0)
17+
rake (12.3.0)
1918
redcarpet (3.4.0)
20-
rspec (3.6.0)
21-
rspec-core (~> 3.6.0)
22-
rspec-expectations (~> 3.6.0)
23-
rspec-mocks (~> 3.6.0)
24-
rspec-core (3.6.0)
25-
rspec-support (~> 3.6.0)
26-
rspec-expectations (3.6.0)
19+
rspec (3.7.0)
20+
rspec-core (~> 3.7.0)
21+
rspec-expectations (~> 3.7.0)
22+
rspec-mocks (~> 3.7.0)
23+
rspec-core (3.7.0)
24+
rspec-support (~> 3.7.0)
25+
rspec-expectations (3.7.0)
2726
diff-lcs (>= 1.2.0, < 2.0)
28-
rspec-support (~> 3.6.0)
29-
rspec-mocks (3.6.0)
27+
rspec-support (~> 3.7.0)
28+
rspec-mocks (3.7.0)
3029
diff-lcs (>= 1.2.0, < 2.0)
31-
rspec-support (~> 3.6.0)
32-
rspec-support (3.6.0)
33-
rubocop (0.49.1)
30+
rspec-support (~> 3.7.0)
31+
rspec-support (3.7.0)
32+
rubocop (0.52.0)
3433
parallel (~> 1.10)
35-
parser (>= 2.3.3.1, < 3.0)
34+
parser (>= 2.4.0.2, < 3.0)
3635
powerpack (~> 0.1)
37-
rainbow (>= 1.99.1, < 3.0)
36+
rainbow (>= 2.2.2, < 4.0)
3837
ruby-progressbar (~> 1.7)
3938
unicode-display_width (~> 1.0, >= 1.0.1)
40-
rubocop-rspec (1.15.1)
41-
rubocop (>= 0.42.0)
42-
ruby-progressbar (1.8.1)
39+
rubocop-rspec (1.21.0)
40+
rubocop (>= 0.52.0)
41+
ruby-progressbar (1.9.0)
4342
rubyzip (1.2.1)
4443
safe_yaml (1.0.4)
4544
tee (1.0.0)
4645
terminal-table (1.8.0)
4746
unicode-display_width (~> 1.1, >= 1.1.1)
48-
unicode-display_width (1.2.1)
49-
webmock (3.0.1)
47+
unicode-display_width (1.3.0)
48+
webmock (3.1.1)
5049
addressable (>= 2.3.6)
5150
crack (>= 0.3.2)
5251
hashdiff
53-
yard (0.9.9)
52+
yard (0.9.12)
5453

5554
PLATFORMS
5655
ruby
@@ -68,4 +67,4 @@ DEPENDENCIES
6867
yard
6968

7069
BUNDLED WITH
71-
1.15.1
70+
1.16.0

java-buildpack.iml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -267,34 +267,34 @@
267267
</content>
268268
<orderEntry type="jdk" jdkName="rbenv: 2.2.8" jdkType="RUBY_SDK" />
269269
<orderEntry type="sourceFolder" forTests="false" />
270-
<orderEntry type="library" scope="PROVIDED" name="addressable (v2.5.1, rbenv: 2.2.8) [gem]" level="application" />
270+
<orderEntry type="library" scope="PROVIDED" name="addressable (v2.5.2, rbenv: 2.2.8) [gem]" level="application" />
271271
<orderEntry type="library" scope="PROVIDED" name="ast (v2.3.0, rbenv: 2.2.8) [gem]" level="application" />
272-
<orderEntry type="library" scope="PROVIDED" name="bundler (v1.15.4, rbenv: 2.2.8) [gem]" level="application" />
272+
<orderEntry type="library" scope="PROVIDED" name="bundler (v1.16.0, rbenv: 2.2.8) [gem]" level="application" />
273273
<orderEntry type="library" scope="PROVIDED" name="crack (v0.4.3, rbenv: 2.2.8) [gem]" level="application" />
274274
<orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.3, rbenv: 2.2.8) [gem]" level="application" />
275-
<orderEntry type="library" scope="PROVIDED" name="hashdiff (v0.3.4, rbenv: 2.2.8) [gem]" level="application" />
276-
<orderEntry type="library" scope="PROVIDED" name="parallel (v1.11.2, rbenv: 2.2.8) [gem]" level="application" />
277-
<orderEntry type="library" scope="PROVIDED" name="parser (v2.4.0.0, rbenv: 2.2.8) [gem]" level="application" />
275+
<orderEntry type="library" scope="PROVIDED" name="hashdiff (v0.3.7, rbenv: 2.2.8) [gem]" level="application" />
276+
<orderEntry type="library" scope="PROVIDED" name="parallel (v1.12.1, rbenv: 2.2.8) [gem]" level="application" />
277+
<orderEntry type="library" scope="PROVIDED" name="parser (v2.4.0.2, rbenv: 2.2.8) [gem]" level="application" />
278278
<orderEntry type="library" scope="PROVIDED" name="powerpack (v0.1.1, rbenv: 2.2.8) [gem]" level="application" />
279-
<orderEntry type="library" scope="PROVIDED" name="public_suffix (v2.0.5, rbenv: 2.2.8) [gem]" level="application" />
280-
<orderEntry type="library" scope="PROVIDED" name="rainbow (v2.2.2, rbenv: 2.2.8) [gem]" level="application" />
281-
<orderEntry type="library" scope="PROVIDED" name="rake (v12.0.0, rbenv: 2.2.8) [gem]" level="application" />
279+
<orderEntry type="library" scope="PROVIDED" name="public_suffix (v3.0.1, rbenv: 2.2.8) [gem]" level="application" />
280+
<orderEntry type="library" scope="PROVIDED" name="rainbow (v3.0.0, rbenv: 2.2.8) [gem]" level="application" />
281+
<orderEntry type="library" scope="PROVIDED" name="rake (v12.3.0, rbenv: 2.2.8) [gem]" level="application" />
282282
<orderEntry type="library" scope="PROVIDED" name="redcarpet (v3.4.0, rbenv: 2.2.8) [gem]" level="application" />
283-
<orderEntry type="library" scope="PROVIDED" name="rspec (v3.6.0, rbenv: 2.2.8) [gem]" level="application" />
284-
<orderEntry type="library" scope="PROVIDED" name="rspec-core (v3.6.0, rbenv: 2.2.8) [gem]" level="application" />
285-
<orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v3.6.0, rbenv: 2.2.8) [gem]" level="application" />
286-
<orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v3.6.0, rbenv: 2.2.8) [gem]" level="application" />
287-
<orderEntry type="library" scope="PROVIDED" name="rspec-support (v3.6.0, rbenv: 2.2.8) [gem]" level="application" />
288-
<orderEntry type="library" scope="PROVIDED" name="rubocop (v0.49.1, rbenv: 2.2.8) [gem]" level="application" />
289-
<orderEntry type="library" scope="PROVIDED" name="rubocop-rspec (v1.15.1, rbenv: 2.2.8) [gem]" level="application" />
290-
<orderEntry type="library" scope="PROVIDED" name="ruby-progressbar (v1.8.1, rbenv: 2.2.8) [gem]" level="application" />
283+
<orderEntry type="library" scope="PROVIDED" name="rspec (v3.7.0, rbenv: 2.2.8) [gem]" level="application" />
284+
<orderEntry type="library" scope="PROVIDED" name="rspec-core (v3.7.0, rbenv: 2.2.8) [gem]" level="application" />
285+
<orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v3.7.0, rbenv: 2.2.8) [gem]" level="application" />
286+
<orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v3.7.0, rbenv: 2.2.8) [gem]" level="application" />
287+
<orderEntry type="library" scope="PROVIDED" name="rspec-support (v3.7.0, rbenv: 2.2.8) [gem]" level="application" />
288+
<orderEntry type="library" scope="PROVIDED" name="rubocop (v0.52.0, rbenv: 2.2.8) [gem]" level="application" />
289+
<orderEntry type="library" scope="PROVIDED" name="rubocop-rspec (v1.21.0, rbenv: 2.2.8) [gem]" level="application" />
290+
<orderEntry type="library" scope="PROVIDED" name="ruby-progressbar (v1.9.0, rbenv: 2.2.8) [gem]" level="application" />
291291
<orderEntry type="library" scope="PROVIDED" name="rubyzip (v1.2.1, rbenv: 2.2.8) [gem]" level="application" />
292292
<orderEntry type="library" scope="PROVIDED" name="safe_yaml (v1.0.4, rbenv: 2.2.8) [gem]" level="application" />
293293
<orderEntry type="library" scope="PROVIDED" name="tee (v1.0.0, rbenv: 2.2.8) [gem]" level="application" />
294294
<orderEntry type="library" scope="PROVIDED" name="terminal-table (v1.8.0, rbenv: 2.2.8) [gem]" level="application" />
295-
<orderEntry type="library" scope="PROVIDED" name="unicode-display_width (v1.2.1, rbenv: 2.2.8) [gem]" level="application" />
296-
<orderEntry type="library" scope="PROVIDED" name="webmock (v3.0.1, rbenv: 2.2.8) [gem]" level="application" />
297-
<orderEntry type="library" scope="PROVIDED" name="yard (v0.9.9, rbenv: 2.2.8) [gem]" level="application" />
295+
<orderEntry type="library" scope="PROVIDED" name="unicode-display_width (v1.3.0, rbenv: 2.2.8) [gem]" level="application" />
296+
<orderEntry type="library" scope="PROVIDED" name="webmock (v3.1.1, rbenv: 2.2.8) [gem]" level="application" />
297+
<orderEntry type="library" scope="PROVIDED" name="yard (v0.9.12, rbenv: 2.2.8) [gem]" level="application" />
298298
</component>
299299
<component name="RModuleSettingsStorage">
300300
<LOAD_PATH number="4" string0="$MODULE_DIR$/lib" string1="$MODULE_DIR$/spec" string2="$MODULE_DIR$/bin" string3="$MODULE_DIR$/spec/bin" />

lib/java_buildpack/buildpack.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ def with_buildpack(app_dir, message)
260260
application = Component::Application.new(app_dir)
261261

262262
yield new(app_dir, application) if block_given?
263-
rescue => e
263+
rescue StandardError => e
264264
handle_error(e, message)
265265
end
266266

lib/java_buildpack/buildpack_version.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ class BuildpackVersion
4646
# Creates a new instance
4747
def initialize(should_log = true)
4848
configuration = JavaBuildpack::Util::ConfigurationUtils.load('version', true, should_log)
49-
@hash = configuration['hash'] || hash
49+
@hash = configuration['hash'] || calculate_hash
5050
@offline = configuration['offline'] || ENV['OFFLINE'].to_b
51-
@remote = configuration['remote'] || remote
51+
@remote = configuration['remote'] || calculate_remote
5252
@version = configuration['version'] || ENV['VERSION'] || @hash
5353

5454
return unless should_log
@@ -102,8 +102,12 @@ def to_s(human_readable = true)
102102

103103
private_constant :GIT_DIR
104104

105-
def remote_string
106-
"#{@remote}##{@hash}" if @remote && !@remote.empty? && @hash && !@hash.empty?
105+
def calculate_hash
106+
git 'rev-parse --short HEAD'
107+
end
108+
109+
def calculate_remote
110+
git 'config --get remote.origin.url'
107111
end
108112

109113
def git(command)
@@ -122,12 +126,8 @@ def git_dir?
122126
GIT_DIR.exist?
123127
end
124128

125-
def hash
126-
git 'rev-parse --short HEAD'
127-
end
128-
129-
def remote
130-
git 'config --get remote.origin.url'
129+
def remote_string
130+
"#{@remote}##{@hash}" if @remote && !@remote.empty? && @hash && !@hash.empty?
131131
end
132132

133133
end

lib/java_buildpack/framework/contrast_security_agent.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# Encoding: utf-8
2-
31
# Cloud Foundry Java Buildpack
42
# Copyright 2013-2017 the original author or authors.
53
#

lib/java_buildpack/framework/dyadic_ekm_security_provider.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,13 @@ def write_cert(cert)
9999
def write_conf(servers, send_timeout, recv_timeout, retries)
100100
FileUtils.mkdir_p conf_file.parent
101101
conf_file.open(File::CREAT | File::WRONLY) do |f|
102-
f.write <<EOS
102+
f.write <<CONFIG
103103
servers = #{servers}
104104
send_timeout = #{send_timeout}
105105
recv_timeout = #{recv_timeout}
106106
retries = #{retries}
107107
ha_mode_standby = 1
108-
EOS
108+
CONFIG
109109
end
110110
end
111111

lib/java_buildpack/framework/luna_security_provider.rb

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -139,31 +139,31 @@ def write_configuration(servers, groups)
139139
chrystoki.open(File::APPEND | File::WRONLY) do |f|
140140
write_prologue f
141141
servers.each_with_index { |server, index| write_server f, index, server }
142-
f.write <<EOS
142+
f.write <<TOKEN
143143
}
144144
145145
VirtualToken = {
146-
EOS
146+
TOKEN
147147
groups.each_with_index { |group, index| write_group f, index, group }
148148
write_epilogue f, groups
149149
end
150150
end
151151

152152
def write_epilogue(f, groups)
153-
f.write <<EOS
153+
f.write <<HA
154154
}
155155
156156
HAConfiguration = {
157157
AutoReconnectInterval = 60;
158158
HAOnly = 1;
159159
reconnAtt = -1;
160-
EOS
160+
HA
161161
write_ha_logging(f) if ha_logging?
162-
f.write <<EOS
162+
f.write <<HA
163163
}
164164
165165
HASynchronize = {
166-
EOS
166+
HA
167167
groups.each { |group| f.write " #{group['label']} = 1;\n" }
168168
f.write "}\n"
169169
end
@@ -178,23 +178,23 @@ def write_group(f, index, group)
178178
end
179179

180180
def write_lib(f)
181-
f.write <<EOS
181+
f.write <<CONFIG
182182
183183
Chrystoki2 = {
184-
EOS
184+
CONFIG
185185

186186
if logging?
187187
write_logging(f)
188188
else
189-
f.write <<EOS
189+
f.write <<LIB
190190
LibUNIX64 = #{relative(lib_cryptoki)};
191191
}
192-
EOS
192+
LIB
193193
end
194194
end
195195

196196
def write_logging(f)
197-
f.write <<EOS
197+
f.write <<LOGGING
198198
LibUNIX64 = #{relative(lib_cklog)};
199199
}
200200
@@ -205,20 +205,20 @@ def write_logging(f)
205205
LogToStreams = 1;
206206
NewFormat = 1;
207207
}
208-
EOS
208+
LOGGING
209209
end
210210

211211
def write_ha_logging(f)
212-
f.write <<EOS
212+
f.write <<HA
213213
haLogStatus = enabled;
214214
haLogToStdout = enabled;
215-
EOS
215+
HA
216216
end
217217

218218
def write_prologue(f)
219219
write_lib(f)
220220

221-
f.write <<EOS
221+
f.write <<CLIENT
222222
223223
LunaSA Client = {
224224
NetClient = 1;
@@ -228,7 +228,7 @@ def write_prologue(f)
228228
HtlDir = #{relative(@droplet.sandbox + 'htl')};
229229
ServerCAFile = #{relative(server_certificates)};
230230
231-
EOS
231+
CLIENT
232232
end
233233

234234
def write_server(f, index, server)

lib/java_buildpack/jre/open_jdk_like_jre.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ def compile
5454

5555
return if @droplet.java_home.java_8_or_later?
5656

57-
$stderr.puts "\n WARNING: You are using #{@droplet.java_home.version}. Oracle has ended public " \
58-
"updates of Java 1.7 as of April 2015, possibly rendering your application vulnerable.\n\n"
57+
warn "\n WARNING: You are using #{@droplet.java_home.version}. Oracle has ended public updates of Java " \
58+
"1.7 as of April 2015, possibly rendering your application vulnerable.\n\n"
5959
end
6060

6161
# (see JavaBuildpack::Component::BaseComponent#release)

lib/java_buildpack/logging/logger_factory.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,9 @@ def ruby_mode
132132

133133
def severity(configuration)
134134
severity = ENV['JBP_LOG_LEVEL']
135-
severity = ruby_mode unless severity
136-
severity = configuration['default_log_level'] unless severity
137-
severity = 'INFO' unless severity
135+
severity ||= ruby_mode
136+
severity ||= configuration['default_log_level']
137+
severity ||= 'INFO'
138138

139139
"::Logger::Severity::#{severity.upcase}".constantize
140140
end

0 commit comments

Comments
 (0)