Sha256: 1659d13511ca27d0fb3afcb450f39aceb762986ac2d495373d8a806e10c027ec

Contents?: true

Size: 1.18 KB

Versions: 73

Compression:

Stored size: 1.18 KB

Contents

# frozen_string_literal: true

require 'avm/ruby/rubocop'
require 'eac_ruby_utils/console/docopt_runner'
require 'eac_ruby_utils/core_ext'

module Avm
  module Tools
    class Runner < ::EacRubyUtils::Console::DocoptRunner
      class Ruby < ::EacRubyUtils::Console::DocoptRunner
        class Rubocop < ::EacRubyUtils::Console::DocoptRunner
          include ::EacRubyUtils::Console::Speaker
          include ::EacRubyUtils::SimpleCache

          DOC = <<~DOCOPT
            Runs Rubocop (https://rubygems.org/gems/rubocop).

            Usage:
              __PROGRAM__ [options] [<rubocop-args>...]
              __PROGRAM__ -h | --help

            Options:
              -h --help               Show this screen.
              -C=<path>               Caminho para executar o Rubocop [default: .].
          DOCOPT

          def run
            ::Avm::Ruby::Rubocop.new(path, rubocop_args).run
          end

          private

          def path
            ::Pathname.new(options.fetch('-C')).expand_path
          end

          def rubocop_args
            r = options.fetch('<rubocop-args>')
            r.shift if r.first == '--'
            r
          end
        end
      end
    end
  end
end

Version data entries

73 entries across 73 versions & 1 rubygems

Version Path
avm-tools-0.86.0 lib/avm/tools/runner/ruby/rubocop.rb
avm-tools-0.85.1 lib/avm/tools/runner/ruby/rubocop.rb
avm-tools-0.85.0 lib/avm/tools/runner/ruby/rubocop.rb
avm-tools-0.84.0 lib/avm/tools/runner/ruby/rubocop.rb
avm-tools-0.83.0 lib/avm/tools/runner/ruby/rubocop.rb
avm-tools-0.82.1 lib/avm/tools/runner/ruby/rubocop.rb
avm-tools-0.82.0 lib/avm/tools/runner/ruby/rubocop.rb
avm-tools-0.81.0 lib/avm/tools/runner/ruby/rubocop.rb
avm-tools-0.80.0 lib/avm/tools/runner/ruby/rubocop.rb
avm-tools-0.79.0 lib/avm/tools/runner/ruby/rubocop.rb
avm-tools-0.78.0 lib/avm/tools/runner/ruby/rubocop.rb
avm-tools-0.77.0 lib/avm/tools/runner/ruby/rubocop.rb
avm-tools-0.76.1 lib/avm/tools/runner/ruby/rubocop.rb
avm-tools-0.76.0 lib/avm/tools/runner/ruby/rubocop.rb
avm-tools-0.75.1 lib/avm/tools/runner/ruby/rubocop.rb
avm-tools-0.75.0 lib/avm/tools/runner/ruby/rubocop.rb
avm-tools-0.74.1 lib/avm/tools/runner/ruby/rubocop.rb
avm-tools-0.74.0 lib/avm/tools/runner/ruby/rubocop.rb
avm-tools-0.73.0 lib/avm/tools/runner/ruby/rubocop.rb
avm-tools-0.72.0 lib/avm/tools/runner/ruby/rubocop.rb