Class: RuboCop::Select::CLI
- Inherits:
-
Object
- Object
- RuboCop::Select::CLI
- Defined in:
- lib/rubocop/select/cli.rb
Instance Attribute Summary collapse
-
#config_store ⇒ Object
readonly
Returns the value of attribute config_store.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
Instance Method Summary collapse
-
#initialize ⇒ CLI
constructor
A new instance of CLI.
-
#run(args = ARGV) ⇒ Fixnum
Entry point for the application logic.
Constructor Details
Instance Attribute Details
#config_store ⇒ Object (readonly)
Returns the value of attribute config_store.
4 5 6 |
# File 'lib/rubocop/select/cli.rb', line 4 def config_store @config_store end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
4 5 6 |
# File 'lib/rubocop/select/cli.rb', line 4 def @options end |
#output ⇒ Object (readonly)
Returns the value of attribute output.
4 5 6 |
# File 'lib/rubocop/select/cli.rb', line 4 def output @output end |
Instance Method Details
#run(args = ARGV) ⇒ Fixnum
Entry point for the application logic. Here we do the command line arguments processing and inspect the target files
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/rubocop/select/cli.rb', line 15 def run(args = ARGV) @options, paths = ::RuboCop::Options.new.parse(args) target_finder = ::RuboCop::TargetFinder.new(@config_store) full_scan_files = target_finder.find('') @output.puts File.intersect(full_scan_files, Dir.pwd, paths, Dir.pwd) 0 rescue StandardError => e $stderr.puts e. $stderr.puts e.backtrace return 1 end |