Sha256: bc66d280388a2f581fc1c89a43be9f706d665a0828547d8a7e65c8b64da72999

Contents?: true

Size: 726 Bytes

Versions: 49

Compression:

Stored size: 726 Bytes

Contents

# frozen_string_literal: true

module Gemsmith
  module Helpers
    # Provides Thor CLI helper methods. These methods are necessary to resolve %% file and folder
    # variables and render dynamic content within the Thor ERB *templates* structure.
    module Template
      def gem_name
        configuration.dig :gem, :name
      end

      def gem_path
        configuration.dig :gem, :path
      end

      def gem_class
        configuration.dig :gem, :class
      end

      def rails_version
        configuration.dig :versions, :rails
      end

      def render_namespace &block
        body = capture(&block) if block_given?
        concat Gem::ModuleFormatter.new(gem_class).render(body)
      end
    end
  end
end

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
gemsmith-14.8.0 lib/gemsmith/helpers/template.rb
gemsmith-14.7.0 lib/gemsmith/helpers/template.rb
gemsmith-14.6.0 lib/gemsmith/helpers/template.rb
gemsmith-14.5.0 lib/gemsmith/helpers/template.rb
gemsmith-14.4.0 lib/gemsmith/helpers/template.rb
gemsmith-14.3.0 lib/gemsmith/helpers/template.rb
gemsmith-14.2.0 lib/gemsmith/helpers/template.rb
gemsmith-14.1.3 lib/gemsmith/helpers/template.rb
gemsmith-14.1.2 lib/gemsmith/helpers/template.rb
gemsmith-14.1.1 lib/gemsmith/helpers/template.rb
gemsmith-14.1.0 lib/gemsmith/helpers/template.rb
gemsmith-14.0.2 lib/gemsmith/helpers/template.rb
gemsmith-14.0.1 lib/gemsmith/helpers/template.rb
gemsmith-14.0.0 lib/gemsmith/helpers/template.rb
gemsmith-13.8.0 lib/gemsmith/helpers/template.rb
gemsmith-13.7.2 lib/gemsmith/helpers/template.rb
gemsmith-13.7.1 lib/gemsmith/helpers/template.rb
gemsmith-13.7.0 lib/gemsmith/helpers/template.rb
gemsmith-13.6.0 lib/gemsmith/helpers/template.rb
gemsmith-13.5.0 lib/gemsmith/helpers/template.rb