Sha256: 0716766b020e737475ada54caf37a92a7a8d7c06072d49dd3bab74c48a068be0

Contents?: true

Size: 625 Bytes

Versions: 3

Compression:

Stored size: 625 Bytes

Contents

module RuboCop
  module Extension
    module Generator
      class CLI
        BANNER = <<~TEXT
          Usage: rubocop-extension-generator NAME
        TEXT

        def self.run(argv)
          new(argv).run
        end

        def initialize(argv)
          @argv = argv
        end

        def run
          # For --help
          opt = OptionParser.new(BANNER)
          args = opt.parse(@argv)

          name = args.first
          raise "It must be named `rubocop-*`. For example: rubocop-rspec" unless name.match?(/\Arubocop-\w+\z/)

          Generator.new(name).generate
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rubocop-extension-generator-0.2.2 lib/rubocop/extension/generator/cli.rb
rubocop-extension-generator-0.2.1 lib/rubocop/extension/generator/cli.rb
rubocop-extension-generator-0.2.0 lib/rubocop/extension/generator/cli.rb