Sha256: 4d28dd37a97bcaf589ce7927fd7d5517c92cd745af962c1f3e23836a214552c3

Contents?: true

Size: 844 Bytes

Versions: 7

Compression:

Stored size: 844 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[:settings]

      delegate %i[
        build_stylesheet
        generator_label
        generator_uri
        generator_version
        project_author
        project_description
        project_label
        project_name
        project_uri_home
        project_uri_icon
        project_uri_logo
        project_uri_version
        project_version
      ] => :settings

      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

7 entries across 7 versions & 1 rubygems

Version Path
milestoner-18.5.0 lib/milestoner/views/context.rb
milestoner-18.4.0 lib/milestoner/views/context.rb
milestoner-18.3.0 lib/milestoner/views/context.rb
milestoner-18.2.0 lib/milestoner/views/context.rb
milestoner-18.1.0 lib/milestoner/views/context.rb
milestoner-18.0.1 lib/milestoner/views/context.rb
milestoner-18.0.0 lib/milestoner/views/context.rb