Skip to content

Commit 7d5fdb4

Browse files
committed
Additional Rubocop Changes
This change makes additional Rubocop source code updates. It seems wide-spread, but all changes are individually trivial.
1 parent 87b7ef4 commit 7d5fdb4

File tree

112 files changed

+965
-850
lines changed

Some content is hidden

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

112 files changed

+965
-850
lines changed

.idea/dictionaries/bhale.xml

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

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.rubocop.yml

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,33 @@
11
---
2+
require: rubocop-rspec
3+
24
AllCops:
35
Include:
46
- Rakefile
57
- rakelib/**/*
68
Exclude:
79
- build/**/*
8-
- vendor/**/*
9-
AbcSize:
10-
Max: 18
11-
ClassLength:
10+
Metrics/AbcSize:
11+
Max: 18
12+
Metrics/ClassLength:
1213
Max: 200
13-
CyclomaticComplexity:
14+
Metrics/CyclomaticComplexity:
1415
Max: 10
15-
Documentation:
16+
Metrics/LineLength:
17+
Max: 120
18+
Metrics/MethodLength:
19+
Max: 17
20+
Metrics/ParameterLists:
21+
Max: 6
22+
Metrics/PerceivedComplexity:
23+
Max: 10
24+
RSpec/FilePath:
1625
Enabled: false
17-
EmptyLinesAroundModuleBody:
26+
Style/Documentation:
1827
Enabled: false
19-
EmptyLinesAroundClassBody:
28+
Style/EmptyLinesAroundClassBody:
2029
Enabled: false
21-
MultilineOperationIndentation:
30+
Style/EmptyLinesAroundModuleBody:
2231
Enabled: false
23-
LineLength:
32+
Style/MultilineOperationIndentation:
2433
Enabled: false
25-
MethodLength:
26-
Max: 25
27-
ParameterLists:
28-
Max: 6
29-
PerceivedComplexity:
30-
Max: 10

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ group :development do
66
gem 'redcarpet'
77
gem 'rspec'
88
gem 'rubocop'
9+
gem 'rubocop-rspec'
910
gem 'rubyzip'
1011
gem 'simplecov'
1112
gem 'tee'

Gemfile.lock

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ GEM
3737
powerpack (~> 0.0.6)
3838
rainbow (>= 1.99.1, < 3.0)
3939
ruby-progressbar (~> 1.4)
40+
rubocop-rspec (1.2.1)
4041
ruby-progressbar (1.7.0)
4142
rubyzip (1.1.6)
4243
safe_yaml (1.0.4)
@@ -61,6 +62,7 @@ DEPENDENCIES
6162
redcarpet
6263
rspec
6364
rubocop
65+
rubocop-rspec
6466
rubyzip
6567
simplecov
6668
tee

Rakefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ RSpec::Core::RakeTask.new
2121
CLEAN.include 'coverage'
2222

2323
require 'rubocop/rake_task'
24-
RuboCop::RakeTask.new
24+
RuboCop::RakeTask.new { |t| t.requires << 'rubocop-rspec' }
2525

2626
require 'yard'
2727
YARD::Rake::YardocTask.new
@@ -39,7 +39,7 @@ require 'rakelib/stage_buildpack_task'
3939
require 'rakelib/package_task'
4040
Package::DependencyCacheTask.new
4141
Package::StageBuildpackTask.new(Dir['bin/**/*', 'config/**/*', 'lib/**/*', 'resources/**/*']
42-
.reject { |f| File.directory? f })
42+
.reject { |f| File.directory? f })
4343
Package::PackageTask.new
4444

4545
task default: %w(rubocop check_api_doc spec)

java-buildpack.iml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@
271271
<orderEntry type="library" scope="PROVIDED" name="addressable (v2.3.6, rbenv: 1.9.3-p551) [gem]" level="application" />
272272
<orderEntry type="library" scope="PROVIDED" name="ast (v2.0.0, rbenv: 1.9.3-p551) [gem]" level="application" />
273273
<orderEntry type="library" scope="PROVIDED" name="astrolabe (v1.3.0, rbenv: 1.9.3-p551) [gem]" level="application" />
274-
<orderEntry type="library" scope="PROVIDED" name="bundler (v1.7.7, rbenv: 1.9.3-p551) [gem]" level="application" />
274+
<orderEntry type="library" scope="PROVIDED" name="bundler (v1.7.8, rbenv: 1.9.3-p551) [gem]" level="application" />
275275
<orderEntry type="library" scope="PROVIDED" name="codeclimate-test-reporter (v0.4.3, rbenv: 1.9.3-p551) [gem]" level="application" />
276276
<orderEntry type="library" scope="PROVIDED" name="crack (v0.4.2, rbenv: 1.9.3-p551) [gem]" level="application" />
277277
<orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.2.5, rbenv: 1.9.3-p551) [gem]" level="application" />
@@ -288,6 +288,7 @@
288288
<orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v3.1.3, rbenv: 1.9.3-p551) [gem]" level="application" />
289289
<orderEntry type="library" scope="PROVIDED" name="rspec-support (v3.1.2, rbenv: 1.9.3-p551) [gem]" level="application" />
290290
<orderEntry type="library" scope="PROVIDED" name="rubocop (v0.27.1, rbenv: 1.9.3-p551) [gem]" level="application" />
291+
<orderEntry type="library" scope="PROVIDED" name="rubocop-rspec (v1.2.1, rbenv: 1.9.3-p551) [gem]" level="application" />
291292
<orderEntry type="library" scope="PROVIDED" name="ruby-progressbar (v1.7.0, rbenv: 1.9.3-p551) [gem]" level="application" />
292293
<orderEntry type="library" scope="PROVIDED" name="rubyzip (v1.1.6, rbenv: 1.9.3-p551) [gem]" level="application" />
293294
<orderEntry type="library" scope="PROVIDED" name="safe_yaml (v1.0.4, rbenv: 1.9.3-p551) [gem]" level="application" />

lib/java_buildpack/buildpack.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,13 @@ def initialize(app_dir, application)
108108
immutable_java_home = Component::ImmutableJavaHome.new mutable_java_home, app_dir
109109
java_opts = Component::JavaOpts.new app_dir
110110

111-
instantiate_components(additional_libraries, app_dir, application, immutable_java_home, java_opts, mutable_java_home)
111+
instantiate_components(additional_libraries, app_dir, application, immutable_java_home, java_opts,
112+
mutable_java_home)
112113
end
113114

114-
def instantiate_components(additional_libraries, app_dir, application, immutable_java_home, java_opts, mutable_java_home)
115-
components = JavaBuildpack::Util::ConfigurationUtils.load 'components'
115+
def instantiate_components(additional_libraries, app_dir, application, immutable_java_home, java_opts,
116+
mutable_java_home)
117+
components = JavaBuildpack::Util::ConfigurationUtils.load 'components'
116118
@jres = instantiate(components['jres'], additional_libraries, application, mutable_java_home, java_opts,
117119
app_dir)
118120
@frameworks = instantiate(components['frameworks'], additional_libraries, application, immutable_java_home,

lib/java_buildpack/buildpack_version.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ def to_hash
7474
# Creates a string representation of the version. The string representation looks like the following:
7575
# +[[<VERSION> [(offline)] | ] <REMOTE>#<HASH>] | [unknown]+. Some examples:
7676
#
77-
# +2.1.2 (offline) | https://github.com/cloudfoundry/java-buildpack.git#12345+ (custom version number, offline buildpack)
77+
# +2.1.2 (offline) | https://github.com/cloudfoundry/java-buildpack.git#12345+ (custom version number, offline
78+
# buildpack)
7879
# +abcde | https://github.com/cloudfoundry/java-buildpack.git#abcde+ (default version number, online buildpack)
7980
# +https://github.com/cloudfoundry/java-buildpack#12345+ (cloned buildpack)
8081
# +unknown+ (un-packaged, un-cloned)

lib/java_buildpack/component/base_component.rb

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,9 @@ def compile
6262
fail "Method 'compile' must be defined"
6363
end
6464

65-
# Modifies the application's runtime configuration. The component is expected to transform members of the +context+
66-
# (e.g. +@java_home+, +@java_opts+, etc.) in whatever way is necessary to support the function of the component.
65+
# Modifies the application's runtime configuration. The component is expected to transform members of the
66+
# +context+ # (e.g. +@java_home+, +@java_opts+, etc.) in whatever way is necessary to support the function of the
67+
# component.
6768
#
6869
# Container components are also expected to create the command required to run the application. These components
6970
# are expected to read the +context+ values and take them into account when creating the command.
@@ -76,8 +77,8 @@ def release
7677

7778
protected
7879

79-
# Downloads an item with the given name and version from the given URI, then yields the resultant file to the given
80-
# block.
80+
# Downloads an item with the given name and version from the given URI, then yields the resultant file to the
81+
# given # block.
8182
#
8283
# @param [JavaBuildpack::Util::TokenizedVersion] version
8384
# @param [String] uri
@@ -112,7 +113,8 @@ def download_jar(version, uri, jar_name, target_directory = @droplet.sandbox, na
112113
#
113114
# @param [String] version the version of the download
114115
# @param [String] uri the uri of the download
115-
# @param [Pathname] target_directory the directory to expand the TAR file to. Defaults to the component's sandbox.
116+
# @param [Pathname] target_directory the directory to expand the TAR file to. Defaults to the component's
117+
# sandbox.
116118
# @param [String] name an optional name for the download and expansion. Defaults to +@component_name+.
117119
# @return [Void]
118120
def download_tar(version, uri, target_directory = @droplet.sandbox, name = @component_name)
@@ -127,10 +129,12 @@ def download_tar(version, uri, target_directory = @droplet.sandbox, name = @comp
127129
# Downloads a given ZIP file and expands it.
128130
#
129131
# @param [Boolean] strip_top_level whether to strip the top-level directory when expanding. Defaults to +true+.
130-
# @param [Pathname] target_directory the directory to expand the ZIP file to. Defaults to the component's sandbox.
132+
# @param [Pathname] target_directory the directory to expand the ZIP file to. Defaults to the component's
133+
# sandbox.
131134
# @param [String] name an optional name for the download. Defaults to +@component_name+.
132135
# @return [Void]
133-
def download_zip(version, uri, strip_top_level = true, target_directory = @droplet.sandbox, name = @component_name)
136+
def download_zip(version, uri, strip_top_level = true, target_directory = @droplet.sandbox,
137+
name = @component_name)
134138
download(version, uri, name) do |file|
135139
with_timing "Expanding #{name} to #{target_directory.relative_path_from(@droplet.root)}" do
136140
if strip_top_level

0 commit comments

Comments
 (0)