Class: RuboCop::CLI::Command::Base
- Inherits:
-
Object
- Object
- RuboCop::CLI::Command::Base
- Defined in:
- lib/rubocop/cli/command/base.rb
Overview
A subcommand in the CLI.
Direct Known Subclasses
AutoGenerateConfig, ExecuteRunner, InitDotfile, ShowCops, Version
Class Attribute Summary collapse
-
.command_name ⇒ Object
Returns the value of attribute command_name.
Instance Attribute Summary collapse
-
#env ⇒ Object
readonly
Returns the value of attribute env.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(env) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(env) ⇒ Base
Returns a new instance of Base.
24 25 26 27 28 29 |
# File 'lib/rubocop/cli/command/base.rb', line 24 def initialize(env) @env = env @options = env. @config_store = env.config_store @paths = env.paths end |
Class Attribute Details
.command_name ⇒ Object
Returns the value of attribute command_name.
13 14 15 |
# File 'lib/rubocop/cli/command/base.rb', line 13 def command_name @command_name end |
Instance Attribute Details
#env ⇒ Object (readonly)
Returns the value of attribute env.
8 9 10 |
# File 'lib/rubocop/cli/command/base.rb', line 8 def env @env end |
Class Method Details
.by_command_name(name) ⇒ Object
19 20 21 |
# File 'lib/rubocop/cli/command/base.rb', line 19 def by_command_name(name) @subclasses.detect { |s| s.command_name == name } end |
.inherited(subclass) ⇒ Object
15 16 17 |
# File 'lib/rubocop/cli/command/base.rb', line 15 def inherited(subclass) @subclasses << subclass end |