Class: EventHub::DocsRenderer
- Inherits:
-
Object
- Object
- EventHub::DocsRenderer
- Defined in:
- lib/eventhub/docs_renderer.rb
Constant Summary collapse
- ASSETS_PATH =
File.("assets", __dir__)
- TEMPLATES_PATH =
File.("templates", __dir__)
- DEFAULT_README_LOCATIONS =
["README.md", "doc/README.md"].freeze
- DEFAULT_CHANGELOG_LOCATIONS =
["CHANGELOG.md", "doc/CHANGELOG.md"].freeze
- DEFAULT_COMPANY_NAME =
"Novartis"- DEFAULT_HTTP_RESOURCES =
[:heartbeat, :version, :docs, :changelog, :configuration].freeze
Instance Method Summary collapse
- #asset(name) ⇒ Object
-
#initialize(processor:, base_path:) ⇒ DocsRenderer
constructor
A new instance of DocsRenderer.
- #render_changelog ⇒ Object
- #render_config ⇒ Object
- #render_readme ⇒ Object
Constructor Details
#initialize(processor:, base_path:) ⇒ DocsRenderer
15 16 17 18 |
# File 'lib/eventhub/docs_renderer.rb', line 15 def initialize(processor:, base_path:) @processor = processor @base_path = base_path end |
Instance Method Details
#asset(name) ⇒ Object
35 36 37 38 39 |
# File 'lib/eventhub/docs_renderer.rb', line 35 def asset(name) path = File.join(ASSETS_PATH, name) return nil unless File.exist?(path) File.read(path) end |
#render_changelog ⇒ Object
25 26 27 28 |
# File 'lib/eventhub/docs_renderer.rb', line 25 def render_changelog content = changelog_html render_layout(title: "CHANGELOG", content: content, content_class: "changelog") end |
#render_config ⇒ Object
30 31 32 33 |
# File 'lib/eventhub/docs_renderer.rb', line 30 def render_config content = config_html render_layout(title: "Configuration", content: content, content_class: "config") end |
#render_readme ⇒ Object
20 21 22 23 |
# File 'lib/eventhub/docs_renderer.rb', line 20 def render_readme content = readme_html render_layout(title: "README", content: content, content_class: "") end |