diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2016-08-16 04:30:11 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2016-08-16 04:30:11 -0300 |
commit | 55f9b8129a50206513264824abb44088230793c2 (patch) | |
tree | ff2f01cabfc7e74b0bd831c2272a5517e4e81e99 /actionpack/lib/action_dispatch/journey | |
parent | d0bdd74d7f6fae3d69b3681d5bc2d5ef6f55a0f8 (diff) | |
download | rails-55f9b8129a50206513264824abb44088230793c2.tar.gz rails-55f9b8129a50206513264824abb44088230793c2.tar.bz2 rails-55f9b8129a50206513264824abb44088230793c2.zip |
Add three new rubocop rules
Style/SpaceBeforeBlockBraces
Style/SpaceInsideBlockBraces
Style/SpaceInsideHashLiteralBraces
Fix all violations in the repository.
Diffstat (limited to 'actionpack/lib/action_dispatch/journey')
-rw-r--r-- | actionpack/lib/action_dispatch/journey/formatter.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/journey/router.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/journey/router/utils.rb | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/actionpack/lib/action_dispatch/journey/formatter.rb b/actionpack/lib/action_dispatch/journey/formatter.rb index d3d79f8750..a289c34e8b 100644 --- a/actionpack/lib/action_dispatch/journey/formatter.rb +++ b/actionpack/lib/action_dispatch/journey/formatter.rb @@ -44,7 +44,7 @@ module ActionDispatch return [route.format(parameterized_parts), params] end - message = "No route matches #{Hash[constraints.sort_by{|k,v| k.to_s}].inspect}" + message = "No route matches #{Hash[constraints.sort_by { |k,v| k.to_s }].inspect}" message << " missing required keys: #{missing_keys.sort.inspect}" if missing_keys && !missing_keys.empty? raise ActionController::UrlGenerationError, message diff --git a/actionpack/lib/action_dispatch/journey/router.rb b/actionpack/lib/action_dispatch/journey/router.rb index 727763c972..caa7a3ff51 100644 --- a/actionpack/lib/action_dispatch/journey/router.rb +++ b/actionpack/lib/action_dispatch/journey/router.rb @@ -48,7 +48,7 @@ module ActionDispatch return [status, headers, body] end - return [404, {"X-Cascade" => "pass"}, ["Not Found"]] + return [404, { "X-Cascade" => "pass" }, ["Not Found"]] end def recognize(rails_req) diff --git a/actionpack/lib/action_dispatch/journey/router/utils.rb b/actionpack/lib/action_dispatch/journey/router/utils.rb index e72db2e8f6..ce5d350763 100644 --- a/actionpack/lib/action_dispatch/journey/router/utils.rb +++ b/actionpack/lib/action_dispatch/journey/router/utils.rb @@ -28,7 +28,7 @@ module ActionDispatch US_ASCII = Encoding::US_ASCII UTF_8 = Encoding::UTF_8 EMPTY = "".force_encoding(US_ASCII).freeze - DEC2HEX = (0..255).to_a.map{ |i| ENCODE % i }.map{ |s| s.force_encoding(US_ASCII) } + DEC2HEX = (0..255).to_a.map { |i| ENCODE % i }.map { |s| s.force_encoding(US_ASCII) } ALPHA = "a-zA-Z".freeze DIGIT = "0-9".freeze @@ -60,7 +60,7 @@ module ActionDispatch protected def escape(component, pattern) - component.gsub(pattern){ |unsafe| percent_encode(unsafe) }.force_encoding(US_ASCII) + component.gsub(pattern) { |unsafe| percent_encode(unsafe) }.force_encoding(US_ASCII) end def percent_encode(unsafe) |