Sha256: 1880bbc57884859a7a54e9571d6c52856a57f7ac2f4babc5f1d451046dcb8e91

Contents?: true

Size: 903 Bytes

Versions: 6

Compression:

Stored size: 903 Bytes

Contents

module Almanack
  module ServerContext
    module Helpers
      # @return The URL to your consolidated iCal feed.
      def feed_url
        "webcal://#{request.host}:#{request.port}/#{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

6 entries across 6 versions & 1 rubygems

Version Path
almanack-1.1.1 lib/almanack/server/helpers.rb
almanack-1.1.0 lib/almanack/server/helpers.rb
almanack-1.1.0.beta6 lib/almanack/server/helpers.rb
almanack-1.1.0.beta5 lib/almanack/server/helpers.rb
almanack-1.1.0.beta4 lib/almanack/server/helpers.rb
almanack-1.1.0.beta3 lib/almanack/server/helpers.rb