Class: Lolcommits::CLI::Launcher

Inherits:
Object
  • Object
show all
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

Class Method Details

.open_folder(path) ⇒ Object



16
17
18
# File 'lib/lolcommits/cli/launcher.rb', line 16

def self.open_folder(path)
  open_with_launchy(path)
end

.open_image(path) ⇒ Object



12
13
14
# File 'lib/lolcommits/cli/launcher.rb', line 12

def self.open_image(path)
  open_with_launchy(path)
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.



24
25
26
# File 'lib/lolcommits/cli/launcher.rb', line 24

def self.open_with_launchy(thing)
  Launchy.open(thing)
end