0.0
No commit activity in last 3 years
No release in over 3 years
This gem is for printing hyperlinks in supported terminal emulators. It is a simple wrapper that abstracts the ANSI characters usually required to achieve this, which are annoying to type out. Check out the gist that inspired this gem at: https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

terminal_link

terminal_link is a simple Ruby gem meant to abstract the ANSI characters required to print hyperlinks in supported terminals. It's a wrapper that makes printing hyperlinks easy!

This was inspired by the gist written by @egmontkob.

Installation & Usage

To install:

gem install terminal_link

Import and use:

require 'terminal_link'

...

link = TerminalLink::Link.new('https://github.com', 'GitHub')
link.print 
# prints "GitHub", which you can ctrl/cmd + click on to follow

# ...can be instantiated without text...
link = TerminalLink::Link.new('https://github.com')
link.print
# prints "https://github.com"

# ...or without either, which will default to the gist above...
link = TerminalLink::Link.new
link.print
# prints gist link

# ...and can be instantiated with just text, but won't print.
link = TerminalLink::Link.new(nil, 'GitHub')
link.print
# nothing happens