Sha256: c526d332d0d01e2b8f0b501429b5670f6da4bcbb100793fc5e34a14f22ca12cb

Contents?: true

Size: 1.63 KB

Versions: 17

Compression:

Stored size: 1.63 KB

Contents

class CompareLinker
  class Formatter
    class Markdown < Base
      private

      def post_format
        text = "* [ ] "
        text += case
        when g.owner && g.old_rev && g.new_rev
          "[%s](%s): [`%s...%s`](%s)" % [
            g.gem_name,
            github_url(g.owner, g.gem_name),
            g.old_rev,
            g.new_rev,
            github_compare_url(g.owner, g.gem_name, g.old_rev, g.new_rev),
          ]
        when g.homepage_uri && g.old_tag && g.new_tag
          "[%s](%s): [`%s...%s`](%s)" % [
            g.gem_name,
            github_url(g.repo_owner, g.repo_name),
            g.old_ver,
            g.new_ver,
            github_compare_url(g.repo_owner, g.repo_name, g.old_tag, g.new_tag),
          ]
        when g.homepage_uri
          "[%s](%s): `%s...%s`" % [
            g.gem_name,
            g.homepage_uri,
            g.old_ver,
            g.new_ver,
          ]
        when g.old_tag && g.new_tag
          "[%s](%s): [`%s...%s`](%s)" % [
            g.gem_name,
            github_url(g.repo_owner, g.repo_name),
            g.old_ver,
            g.new_ver,
            github_compare_url(g.repo_owner, g.repo_name, g.old_tag, g.new_tag),
          ]
        when g.repo_owner && g.repo_name
          "[%s](%s): `%s...%s`" % [
            g.gem_name,
            github_url(g.repo_owner, g.repo_name),
            g.old_ver,
            g.new_ver,
          ]
        else
          "%s: (link not found) `%s...%s`" % [
            g.gem_name,
            g.old_ver,
            g.new_ver,
          ]
        end

        text += " (downgrade)" if downgraded
        text
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
compare_linker-1.4.8 lib/compare_linker/formatter/markdown.rb
compare_linker-1.4.7 lib/compare_linker/formatter/markdown.rb
compare_linker-1.4.6 lib/compare_linker/formatter/markdown.rb
compare_linker-1.4.5 lib/compare_linker/formatter/markdown.rb
compare_linker-1.4.4 lib/compare_linker/formatter/markdown.rb
compare_linker-1.4.3 lib/compare_linker/formatter/markdown.rb
compare_linker-1.4.2 lib/compare_linker/formatter/markdown.rb
compare_linker-1.4.1 lib/compare_linker/formatter/markdown.rb
compare_linker-1.4.0 lib/compare_linker/formatter/markdown.rb
compare_linker-1.3.8 lib/compare_linker/formatter/markdown.rb
compare_linker-1.3.7 lib/compare_linker/formatter/markdown.rb
compare_linker-1.3.6 lib/compare_linker/formatter/markdown.rb
compare_linker-1.3.5 lib/compare_linker/formatter/markdown.rb
compare_linker-1.3.4 lib/compare_linker/formatter/markdown.rb
compare_linker-1.3.3 lib/compare_linker/formatter/markdown.rb
compare_linker-1.3.2 lib/compare_linker/formatter/markdown.rb
compare_linker-1.3.1 lib/compare_linker/formatter/markdown.rb