lib/compare_linker/formatter/markdown.rb in compare_linker-1.3.0 vs lib/compare_linker/formatter/markdown.rb in compare_linker-1.3.1

- old
+ new

@@ -1,13 +1,11 @@ -require "ostruct" - class CompareLinker class Formatter class Markdown < Base - def format(gem_info) - g = OpenStruct.new(gem_info) + private + def post_format text = "* [ ] " text += case when g.owner && g.old_rev && g.new_rev "[%s](%s): [`%s...%s`](%s)" % [ g.gem_name, @@ -52,24 +50,11 @@ g.old_ver, g.new_ver, ] end - if downgrade?(g.old_ver, g.new_ver, g.old_tag, g.new_tag) - text += " (downgrade)" - end - + text += " (downgrade)" if downgraded text - end - - private - - def github_url(repo_owner, repo_name) - "https://github.com/#{repo_owner}/#{repo_name}" - end - - def github_compare_url(repo_owner, repo_name, old_tag, new_tag) - "#{github_url(repo_owner, repo_name)}/compare/#{old_tag}...#{new_tag}" end end end end