Sha256: 462f536e37d27bdc76eb02c9b34115a2227c7445ce9b931b238145515bb3f2cf

Contents?: true

Size: 652 Bytes

Versions: 18

Compression:

Stored size: 652 Bytes

Contents

module Hanami
  class CLI
    module Commands
      # @since 1.1.0
      # @api private
      class Templates
        NAMESPACE = name.sub(Utils::String.demodulize(name), "").freeze

        # @since 1.1.0
        # @api private
        def initialize(klass)
          word = klass.name.sub(NAMESPACE, "").split("::").map(&:downcase)
          @root = Pathname.new(File.join(__dir__, *word))
          freeze
        end

        # @since 1.1.0
        # @api private
        def find(*names)
          @root.join(*names)
        end

        private

        # @since 1.1.0
        # @api private
        attr_reader :root
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
hanami-1.3.5 lib/hanami/cli/commands/templates.rb
hanami-1.3.4 lib/hanami/cli/commands/templates.rb
hanami-1.3.3 lib/hanami/cli/commands/templates.rb
hanami-1.3.2 lib/hanami/cli/commands/templates.rb
hanami-1.3.1 lib/hanami/cli/commands/templates.rb
hanami-1.3.0 lib/hanami/cli/commands/templates.rb
hanami-1.3.0.beta1 lib/hanami/cli/commands/templates.rb
hanami-1.2.0 lib/hanami/cli/commands/templates.rb
hanami-1.2.0.rc2 lib/hanami/cli/commands/templates.rb
hanami-1.2.0.rc1 lib/hanami/cli/commands/templates.rb
hanami-1.2.0.beta2 lib/hanami/cli/commands/templates.rb
hanami-1.2.0.beta1 lib/hanami/cli/commands/templates.rb
hanami-1.1.1 lib/hanami/cli/commands/templates.rb
hanami-1.1.0 lib/hanami/cli/commands/templates.rb
hanami-1.1.0.rc1 lib/hanami/cli/commands/templates.rb
hanami-1.1.0.beta3 lib/hanami/cli/commands/templates.rb
hanami-1.1.0.beta2 lib/hanami/cli/commands/templates.rb
hanami-1.1.0.beta1 lib/hanami/cli/commands/templates.rb