Sha256: 43c4c60d48d1e5819e1616d4c152ef7b8aff0c22dfb018159e2d73458e6fd03b
Contents?: true
Size: 701 Bytes
Versions: 4
Compression:
Stored size: 701 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 warn "Error: #{error}" STATUS_ERROR end def print(message) $stdout.puts message end end end end
Version data entries
4 entries across 4 versions & 1 rubygems