Sha256: 445553f5736b6874cb748d00c9ebefb9f5b5feb81ebf2885559c71e7d97d5a12

Contents?: true

Size: 978 Bytes

Versions: 5

Compression:

Stored size: 978 Bytes

Contents

require 'date'
require 'pathname'
require 'mustache'

require 'jazzy/config'
require 'jazzy/gem_version'
require 'jazzy/jazzy_markdown'

module Jazzy
  class Doc < Mustache
    self.template_name = 'doc'

    def copyright
      config = Config.instance
      copyright = config.copyright || (
        # Fake date is used to keep integration tests consistent
        date = ENV['JAZZY_FAKE_DATE'] || DateTime.now.strftime('%Y-%m-%d')
        year = date[0..3]
        "&copy; #{year} [#{config.author_name}](#{config.author_url}). " \
        "All rights reserved. (Last updated: #{date})"
      )
      Markdown.render_copyright(copyright).chomp
    end

    def jazzy_version
      # Fake version is used to keep integration tests consistent
      ENV['JAZZY_FAKE_VERSION'] || Jazzy::VERSION
    end

    def language
      Config.instance.objc_mode ? 'Objective-C' : 'Swift'
    end

    def language_stub
      Config.instance.objc_mode ? 'objc' : 'swift'
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
jazzy-0.9.0 lib/jazzy/doc.rb
jazzy-0.8.4 lib/jazzy/doc.rb
jazzy-0.8.3 lib/jazzy/doc.rb
jazzy-0.8.2 lib/jazzy/doc.rb
jazzy-0.8.1 lib/jazzy/doc.rb