Sha256: 00c8acbc39e18f7100eb43f80f98c833f3f1534dd3e70450d76ae7a02eb5c5dc

Contents?: true

Size: 891 Bytes

Versions: 9

Compression:

Stored size: 891 Bytes

Contents

module Almanack
  module ServerContext
    module Helpers
      # @return The URL to your consolidated iCal feed.
      def feed_url
        File.join(request.base_url, "#{settings.feed_path}.ics")
      end

      # @return The URL to Almanack's project homepage.
      def almanack_project_url
        Almanack::HOMEPAGE
      end

      # @return The URL to Almanack's issues page.
      def almanack_issues_url
        Almanack::ISSUES
      end

      # @return The current time.
      def now
        Time.now
      end

      # @return The calendar.
      def calendar
        @calendar ||= Almanack.calendar
      end

      # @return The title of the page.
      def page_title(separator: " – ")
        [@title, calendar.title].compact.join(separator)
      end

      # Use to set the title of the page.
      def title(value)
        @title = value
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
almanack-1.3.1 lib/almanack/server/helpers.rb
almanack-1.3.0 lib/almanack/server/helpers.rb
almanack-1.3.0.rc1 lib/almanack/server/helpers.rb
almanack-1.2.1 lib/almanack/server/helpers.rb
almanack-1.2.0 lib/almanack/server/helpers.rb
almanack-1.1.5 lib/almanack/server/helpers.rb
almanack-1.1.3 lib/almanack/server/helpers.rb
almanack-1.1.3.rc1 lib/almanack/server/helpers.rb
almanack-1.1.2 lib/almanack/server/helpers.rb