Class: SparkleAppcast::ReleaseNote

Inherits:
Object
  • Object
show all
Defined in:
lib/sparkle_appcast/release_note.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#pathObject (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

#textObject



19
20
21
# File 'lib/sparkle_appcast/release_note.rb', line 19

def text
  @text ||= File.read(path)
end