Sha256: fc099ca825654946b3c0c62bf6210bc3844fcae9c25326a729d62b46b163e33b

Contents?: true

Size: 601 Bytes

Versions: 4

Compression:

Stored size: 601 Bytes

Contents

# frozen_string_literal: true

module Gemsmith
  module Generators
    # Generates Command Line Interface (CLI) support.
    class CLI < Base
      # rubocop:disable Metrics/AbcSize
      def run
        return unless configuration.dig(:generate, :cli)

        cli.template "%gem_name%/bin/%gem_name%.tt", configuration
        cli.template "%gem_name%/lib/%gem_path%/cli.rb.tt", configuration
        cli.template "%gem_name%/spec/lib/%gem_path%/cli_spec.rb.tt", configuration
        cli.chmod "#{gem_name}/bin/#{gem_name}", 0o755
      end
      # rubocop:enable Metrics/AbcSize
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
gemsmith-11.2.0 lib/gemsmith/generators/cli.rb
gemsmith-11.1.0 lib/gemsmith/generators/cli.rb
gemsmith-11.0.1 lib/gemsmith/generators/cli.rb
gemsmith-11.0.0 lib/gemsmith/generators/cli.rb