Sha256: adfe5be7df1a3a69c18af3fb86897d1cfefe305b6f522d0f0f2cc5a5bad2560a
Contents?: true
Size: 730 Bytes
Versions: 25
Compression:
Stored size: 730 Bytes
Contents
# frozen_string_literal: true require 'rubycritic' require 'rubycritic/browser' 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.to_h reporter = RubyCritic::CommandFactory.create(parsed_options).execute print(reporter.status_message) reporter.status rescue OptionParser::InvalidOption => error warn "Error: #{error}" STATUS_ERROR end def print(message) $stdout.puts message end end end end
Version data entries
25 entries across 25 versions & 2 rubygems