Sha256: dd03ea5bd2c299cded665bb012204e711fb6d7c9622fea057a962efaebdf9cd1

Contents?: true

Size: 604 Bytes

Versions: 6

Compression:

Stored size: 604 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 "#{configuration.dig :gem, :name}/bin/#{configuration.dig :gem, :name}", 0o755
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
gemsmith-9.6.0 lib/gemsmith/generators/cli.rb
gemsmith-9.5.0 lib/gemsmith/generators/cli.rb
gemsmith-9.4.0 lib/gemsmith/generators/cli.rb
gemsmith-9.3.0 lib/gemsmith/generators/cli.rb
gemsmith-9.2.0 lib/gemsmith/generators/cli.rb
gemsmith-9.1.0 lib/gemsmith/generators/cli.rb