Sha256: a9ba0877c0b812da79560355b8a878697876b3bee8c071baf143f6053f2081da

Contents?: true

Size: 756 Bytes

Versions: 3

Compression:

Stored size: 756 Bytes

Contents

# frozen_string_literal: true

require "core"
require "forwardable"
require "hanami/view"

module Milestoner
  module Views
    # Provides a common context for all views.
    class Context < Hanami::View::Context
      extend Forwardable

      include Import[:input]

      delegate %i[
        generator_label
        generator_uri
        generator_version
        project_author
        project_description
        project_generator
        project_label
        project_name
        project_uri
        project_version
      ] => :input

      def project_slug
        [project_name, project_version].compact.join("_").tr ".", Core::EMPTY_STRING
      end

      def project_title = [project_label, project_version].compact.join " "
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
milestoner-17.11.0 lib/milestoner/views/context.rb
milestoner-17.10.0 lib/milestoner/views/context.rb
milestoner-17.9.0 lib/milestoner/views/context.rb