Class: Lolcommits::CLI::Launcher
- Inherits:
-
Object
- Object
- Lolcommits::CLI::Launcher
- Defined in:
- lib/lolcommits/cli/launcher.rb
Overview
Helper class for wrapping the opening of files on the desktop in a cross-platform way.
Right now this is mostly just a wrapper for Launchy, in case we want to factor out it’s dependency later or swap it out.
Class Method Summary collapse
- .open_file(path) ⇒ Object
- .open_folder(path) ⇒ Object
- .open_url(url) ⇒ Object
-
.open_with_launchy(thing) ⇒ Object
Opens with Launchy, which knows how to open pretty much anything local files, urls, etc.
Class Method Details
.open_file(path) ⇒ Object
11 12 13 |
# File 'lib/lolcommits/cli/launcher.rb', line 11 def self.open_file(path) open_with_launchy(path) end |
.open_folder(path) ⇒ Object
15 16 17 |
# File 'lib/lolcommits/cli/launcher.rb', line 15 def self.open_folder(path) open_with_launchy(path) end |
.open_url(url) ⇒ Object
19 20 21 |
# File 'lib/lolcommits/cli/launcher.rb', line 19 def self.open_url(url) open_with_launchy(url) end |
.open_with_launchy(thing) ⇒ Object
Opens with Launchy, which knows how to open pretty much anything local files, urls, etc.
Private so we replace it later easier if we want.
27 28 29 |
# File 'lib/lolcommits/cli/launcher.rb', line 27 def self.open_with_launchy(thing) Launchy.open(thing) end |