Skip to content

Commit ca5f08d

Browse files
committed
rubocop formatting
1 parent 9d8f9fd commit ca5f08d

File tree

12 files changed

+9
-19
lines changed

12 files changed

+9
-19
lines changed

app/messages/manifest_routes_update_message.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ def validate(record)
1818
return
1919
end
2020

21-
if contains_invalid_lb_algo?(record.routes)
22-
record.errors.add(:routes, message: 'contains an invalid loadbalancing-algorithm option')
23-
return
24-
end
21+
return unless contains_invalid_lb_algo?(record.routes)
22+
23+
record.errors.add(:routes, message: 'contains an invalid loadbalancing-algorithm option')
24+
nil
2525
end
2626

2727
def is_not_array?(routes)

app/messages/route_create_message.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,5 @@ def domain_guid
9191
HashUtils.dig(domain, :data, :guid)
9292
end
9393
end
94-
95-
9694
end
9795
end

app/messages/route_options_message.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
module VCAP::CloudController
44
class RouteOptionsMessage < BaseMessage
5-
65
VALID_MANIFEST_ROUTE_OPTIONS = %i[loadbalancing-algorithm].freeze
76
VALID_ROUTE_OPTIONS = %i[lb_algo].freeze
87
VALID_LOADBALANCING_ALGORITHMS = %w[round-robin least-connections].freeze

app/messages/route_update_message.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,5 @@ def options_message
1616
validates_with OptionsValidator, if: options_requested?
1717

1818
validates_with NoAdditionalKeysValidator
19-
2019
end
2120
end

app/messages/validators.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,6 @@ def validate(record)
242242

243243
class OptionsValidator < ActiveModel::Validator
244244
def validate(record)
245-
246245
# Empty option hashes are allowed, so we skip further validation
247246
record.options.blank? && return
248247

app/presenters/v3/route_presenter.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ def to_hash
4848
},
4949
links: build_links
5050
}
51-
unless route.options.nil?
52-
hash.merge!(options: route.options)
53-
end
51+
hash.merge!(options: route.options) unless route.options.nil?
5452

5553
@decorators.reduce(hash) { |memo, d| d.decorate(memo, [route]) }
5654
end

lib/cloud_controller/app_manifest/manifest_route.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class ManifestRoute
66
SUPPORTED_TCP_SCHEMES = %w[tcp unspecified].freeze
77
WILDCARD_HOST = '*'.freeze
88

9-
def self.parse(route, options = nil)
9+
def self.parse(route, options=nil)
1010
parsed_uri = Addressable::URI.heuristic_parse(route, scheme: 'unspecified')
1111

1212
attrs = if parsed_uri.nil?

spec/request/space_manifests_spec.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -749,11 +749,9 @@
749749

750750
app1_model.reload
751751
expect(app1_model.routes.first.options).to eq({ 'lb_algo' => 'least-connections' })
752-
753752
end
754753
end
755754
end
756-
757755
end
758756

759757
describe 'audit events' do

spec/unit/lib/cloud_controller/app_manifest/manifest_route_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ module VCAP::CloudController
119119

120120
context 'when there is an invalid loadbalancing-algorithm' do
121121
let(:route) { 'http://example.com' }
122-
let(:options) { { :'loadbalancing-algorithm' => 'invalid' } }
122+
let(:options) { { 'loadbalancing-algorithm': 'invalid' } }
123123

124124
it 'is invalid' do
125125
manifest_route = ManifestRoute.parse(route, options)

spec/unit/messages/manifest_routes_update_message_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ module VCAP::CloudController
230230
{ 'routes' =>
231231
[
232232
{ 'route' => 'existing.example.com',
233-
'options' => {'invalid' => 'invalid'} }
233+
'options' => { 'invalid' => 'invalid' } }
234234
] }
235235
end
236236

0 commit comments

Comments
 (0)