Class: SparkleAppcast::ReleaseNote
- Inherits:
-
Object
- Object
- SparkleAppcast::ReleaseNote
- Defined in:
- lib/sparkle_appcast/release_note.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Class Method Summary collapse
Instance Method Summary collapse
- #html(context = {}) ⇒ Object
-
#initialize(path) ⇒ ReleaseNote
constructor
A new instance of ReleaseNote.
- #text ⇒ Object
Constructor Details
#initialize(path) ⇒ ReleaseNote
Returns a new instance of ReleaseNote.
11 12 13 |
# File 'lib/sparkle_appcast/release_note.rb', line 11 def initialize(path) @path = path end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
9 10 11 |
# File 'lib/sparkle_appcast/release_note.rb', line 9 def path @path end |
Class Method Details
.markdown(text) ⇒ Object
5 6 7 |
# File 'lib/sparkle_appcast/release_note.rb', line 5 def self.markdown(text) Kramdown::Document.new(text, auto_ids: false).to_html end |
Instance Method Details
#html(context = {}) ⇒ Object
15 16 17 |
# File 'lib/sparkle_appcast/release_note.rb', line 15 def html(context = {}) self.class.markdown(Mustache.render(text, context)) end |
#text ⇒ Object
19 20 21 |
# File 'lib/sparkle_appcast/release_note.rb', line 19 def text @text ||= File.read(path) end |