Class: Gemstar::Outputs::Markdown

Inherits:
Basic
  • Object
show all
Defined in:
lib/gemstar/outputs/markdown.rb

Instance Method Summary collapse

Instance Method Details

#render_diff(diff_command) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/gemstar/outputs/markdown.rb', line 11

def render_diff(diff_command)
  project_name = diff_command.project_name
  body = diff_command.updates.sort.map do |gem_name, info|
    render_entry(gem_name, info)
  end.join("\n\n---\n\n")

  <<~MARKDOWN
    # #{project_name}: Package Updates

    _Showing changes from #{diff_command.from} to #{diff_command.to || "now"}, generated on #{Time.now.strftime("%Y-%m-%d %H:%M:%S %z")}._

    #{range_details(diff_command)}

    #{body}

    #{considered_commits(diff_command)}
  MARKDOWN
end