Sha256: e5f17a5a24e5f2d8d490be7cf60cfde970234d9c2c427d12910a0932cc374d8f
Contents?: true
Size: 708 Bytes
Versions: 7
Compression:
Stored size: 708 Bytes
Contents
# frozen_string_literal: true require 'rubycritic' require 'rubycritic/cli/options' require 'rubycritic/command_factory' module RubyCritic module Cli class Application STATUS_SUCCESS = 0 STATUS_ERROR = 1 def initialize(argv) @options = Options.new(argv) end def execute parsed_options = @options.parse reporter = RubyCritic::CommandFactory.create(parsed_options.to_h).execute print(reporter.status_message) reporter.status rescue OptionParser::InvalidOption => error $stderr.puts "Error: #{error}" STATUS_ERROR end def print(message) $stdout.puts message end end end end
Version data entries
7 entries across 7 versions & 1 rubygems