Class: Skunk::Cli::Application
- Inherits:
-
RubyCritic::Cli::Application
- Object
- RubyCritic::Cli::Application
- Skunk::Cli::Application
- Defined in:
- lib/skunk/cli/application.rb
Overview
Knows how to execute command line commands :reek:InstanceVariableAssumption
Constant Summary collapse
- COVERAGE_FILE =
"coverage/.resultset.json"
Instance Method Summary collapse
-
#execute ⇒ Object
:reek:UncommunicativeVariableName.
-
#initialize(argv) ⇒ Application
constructor
A new instance of Application.
Constructor Details
#initialize(argv) ⇒ Application
Returns a new instance of Application.
19 20 21 |
# File 'lib/skunk/cli/application.rb', line 19 def initialize(argv) @options = Skunk::Cli::Options.new(argv) end |
Instance Method Details
#execute ⇒ Object
:reek:UncommunicativeVariableName
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/skunk/cli/application.rb', line 24 def execute warn_coverage_info unless File.exist?(COVERAGE_FILE) # :reek:NilCheck @parsed_options = @options.parse.to_h command = Skunk::CommandFactory.create(@parsed_options) reporter = command.execute print(reporter.) if command.sharing? = command.share(reporter) print() end reporter.status rescue OptionParser::InvalidOption => e warn "Error: #{e}" STATUS_ERROR end |