Sha256: 0017babd3c0702c7f5887d44bd2af9faea3c2c6eb203e6993f15aa17e5ec7aa5

Contents?: true

Size: 796 Bytes

Versions: 12

Compression:

Stored size: 796 Bytes

Contents

require 'launchy'

module Lolcommits
  module CLI
    # 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 Launcher
      def self.open_image(path)
        open_with_launchy(path)
      end

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

      def self.open_url(url)
        open_with_launchy(url)
      end

      # 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.
      def self.open_with_launchy(thing)
        Launchy.open(thing)
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
lolcommits-0.12.1 lib/lolcommits/cli/launcher.rb
lolcommits-0.12.0 lib/lolcommits/cli/launcher.rb
lolcommits-0.11.0 lib/lolcommits/cli/launcher.rb
lolcommits-0.11.0.pre lib/lolcommits/cli/launcher.rb
lolcommits-0.10.0 lib/lolcommits/cli/launcher.rb
lolcommits-0.10.0.pre1 lib/lolcommits/cli/launcher.rb
lolcommits-0.9.8 lib/lolcommits/cli/launcher.rb
lolcommits-0.9.7 lib/lolcommits/cli/launcher.rb
lolcommits-0.9.7.pre1 lib/lolcommits/cli/launcher.rb
lolcommits-0.9.6 lib/lolcommits/cli/launcher.rb
lolcommits-0.9.5 lib/lolcommits/cli/launcher.rb
lolcommits-0.9.5.pre1 lib/lolcommits/cli/launcher.rb