Skip to content

Instantly share code, notes, and snippets.

@kerrizor
Last active April 4, 2019 21:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kerrizor/bf1541af4590d6f4794db01e12a26071 to your computer and use it in GitHub Desktop.
Save kerrizor/bf1541af4590d6f4794db01e12a26071 to your computer and use it in GitHub Desktop.
def link_to_github(rubygem)
[rubygem.linkset.code, rubygem.linkset.home].detect do |linkset|
URI(linkset.to_s).host == "github.com"
end
rescue URI::InvalidURIError
nil
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment