Class: EagerEye::CLI
- Inherits:
-
Object
- Object
- EagerEye::CLI
- Defined in:
- lib/eager_eye/cli.rb
Instance Attribute Summary collapse
-
#argv ⇒ Object
readonly
Returns the value of attribute argv.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(argv = ARGV) ⇒ CLI
constructor
A new instance of CLI.
- #run ⇒ Object
Constructor Details
#initialize(argv = ARGV) ⇒ CLI
Returns a new instance of CLI.
9 10 11 12 |
# File 'lib/eager_eye/cli.rb', line 9 def initialize(argv = ARGV) @argv = argv @options = end |
Instance Attribute Details
#argv ⇒ Object (readonly)
Returns the value of attribute argv.
7 8 9 |
# File 'lib/eager_eye/cli.rb', line 7 def argv @argv end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
7 8 9 |
# File 'lib/eager_eye/cli.rb', line 7 def @options end |
Instance Method Details
#run ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/eager_eye/cli.rb', line 14 def run return 0 if [:help] || [:version] issues = analyze if [:suggest_fixes] fixer = AutoFixer.new(issues) fixer.suggest return 0 end if [:fix] fixer = AutoFixer.new(issues, interactive: ![:force]) fixer.run return 0 end output_report(issues) exit_code(issues) end |