Class: Tailor::CLI
- Inherits:
-
Object
- Object
- Tailor::CLI
- Includes:
- LogSwitch::Mixin
- Defined in:
- lib/tailor/cli.rb,
lib/tailor/cli/options.rb
Overview
The Command-Line Interface worker. Execution from the command line comes through here.
Defined Under Namespace
Classes: Options
Class Method Summary collapse
-
.run(args) ⇒ Object
The main method of execution from the command line.
Instance Method Summary collapse
-
#execute! ⇒ Boolean
This checks all of the files detected during the configuration gathering process, then hands results over to the Reporter to be reported.
-
#initialize(args) ⇒ CLI
constructor
A new instance of CLI.
Constructor Details
#initialize(args) ⇒ CLI
Returns a new instance of CLI.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/tailor/cli.rb', line 20 def initialize(args) Tailor::Logger.log = false = Options.parse!(args) @configuration = Configuration.new(args, ) @configuration.load! if .show_config @configuration.show exit end @critic = Critic.new @reporter = Reporter.new(@configuration.formatters) end |
Class Method Details
.run(args) ⇒ Object
The main method of execution from the command line.
15 16 17 |
# File 'lib/tailor/cli.rb', line 15 def self.run(args) new(args).execute! end |
Instance Method Details
#execute! ⇒ Boolean
This checks all of the files detected during the configuration gathering process, then hands results over to the Reporter to be reported.
41 42 43 44 45 46 47 48 49 |
# File 'lib/tailor/cli.rb', line 41 def execute! @critic.critique(@configuration.file_sets) do |problems_for_file, label| @reporter.file_report(problems_for_file, label) end @reporter.summary_report(@critic.problems) @critic.problem_count(:error) > 0 end |