-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix NameError when execute Rails/HttpStatus cop without Rack
Rails/HttpStatus cop with symbolic style raise `NameError (uninitialized constant Rack)`. ```ruby class FooController < ApplicationController def bar render :foo, status: 418 end end ``` ``` $ rubocop --only Rails/HttpStatus app/controllers/foo_controller.rb -d For /Users/onaka/sample_app: configuration from /Users/onaka/.gem/ruby/2.6.0/gems/rubocop-0.54.0/config/default.yml Inheriting configuration from /Users/onaka/.gem/ruby/2.6.0/gems/rubocop-0.54.0/config/enabled.yml Inheriting configuration from /Users/onaka/.gem/ruby/2.6.0/gems/rubocop-0.54.0/config/disabled.yml Inspecting 1 file Scanning /Users/onaka/sample_app/app/controllers/foo_controller.rb An error occurred while Rails/HttpStatus cop was inspecting /Users/onaka/sample_app/app/controllers/foo_controller.rb:3:4. uninitialized constant Rack Did you mean? Racc /Users/onaka/.gem/ruby/2.6.0/gems/rubocop-0.54.0/lib/rubocop/cop/rails/http_status.rb:131:in `custom_http_status_code?' /Users/onaka/.gem/ruby/2.6.0/gems/rubocop-0.54.0/lib/rubocop/cop/rails/http_status.rb:104:in `offensive?' ... ```
- Loading branch information
Showing
3 changed files
with
16 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters