Class: Jazzy::Doc

Inherits:
Mustache
  • Object
show all
Includes:
Config::Mixin
Defined in:
lib/jazzy/doc.rb

Instance Method Summary collapse

Methods included from Config::Mixin

#config

Instance Method Details



15
16
17
18
19
20
21
22
23
24
# File 'lib/jazzy/doc.rb', line 15

def copyright
  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]
    "© #{year} [#{config.author_name}](#{config.author_url}). " \
    "All rights reserved. (Last updated: #{date})"
  )
  Markdown.render_copyright(copyright).chomp
end

#docs_titleObject



43
44
45
46
47
48
49
50
51
52
53
# File 'lib/jazzy/doc.rb', line 43

def docs_title
  if config.title_configured
    config.title
  elsif config.version_configured
    # Fake version for integration tests
    version = ENV['JAZZY_FAKE_MODULE_VERSION'] || config.version
    "#{config.module_name} #{version} Docs"
  else
    "#{config.module_name} Docs"
  end
end

#jazzy_versionObject



26
27
28
29
# File 'lib/jazzy/doc.rb', line 26

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

#language_stubObject



35
36
37
# File 'lib/jazzy/doc.rb', line 35

def language_stub
  objc_first? ? 'objc' : 'swift'
end

#module_versionObject



39
40
41
# File 'lib/jazzy/doc.rb', line 39

def module_version
  config.version_configured ? config.version : nil
end

#objc_first?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/jazzy/doc.rb', line 31

def objc_first?
  config.objc_mode && config.hide_declarations != 'objc'
end