module Unwrappr::Writers::Title
Add the gem name to the annotation as a heading. If a homepage URI has been determined this heading will link to that page.
Implements the `annotation_writer` interface required by the LockFileAnnotator
.
Public Class Methods
write(gem_change, gem_change_info)
click to toggle source
# File lib/unwrappr/writers/title.rb, line 12 def write(gem_change, gem_change_info) embellished_gem_name = maybe_link( gem_change.name, gem_change_info[:ruby_gems]&.homepage_uri ) "### #{embellished_gem_name}\n" end
Private Class Methods
maybe_link(text, url)
click to toggle source
# File lib/unwrappr/writers/title.rb, line 22 def maybe_link(text, url) if url.nil? text else "[#{text}](#{url})" end end