Sha256: 726123bbca1a60af0669b78399da3d5262d2c6b802f361119dfbb8b3a498a756

Contents?: true

Size: 680 Bytes

Versions: 2

Compression:

Stored size: 680 Bytes

Contents

# frozen_string_literal: true

module Gemsmith
  module Generators
    # Abstract class from which all generators inherit from.
    class Base
      def initialize cli, configuration: {}
        @cli = cli
        @configuration = configuration
      end

      def self.run cli, configuration: {}
        new(cli, configuration: configuration).run
      end

      def run
        fail NotImplementedError, "The method, #run, is not implemented yet."
      end

      protected

      attr_reader :cli, :configuration

      def lib_root
        File.join "%gem_name%", "lib"
      end

      def lib_gem_root
        File.join lib_root, "%gem_path%"
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gemsmith-8.1.0 lib/gemsmith/generators/base.rb
gemsmith-8.0.0 lib/gemsmith/generators/base.rb