Sha256: 780bd5c2cbae5720e7197d21d4800296190a87dca6af78ea5b34760e33ab6774

Contents?: true

Size: 751 Bytes

Versions: 25

Compression:

Stored size: 751 Bytes

Contents

# -*- encoding: utf-8 -*-
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

      # 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

25 entries across 25 versions & 2 rubygems

Version Path
lolcommits-0.9.2 lib/lolcommits/cli/launcher.rb
lolcommits-0.9.2.pre1 lib/lolcommits/cli/launcher.rb
lolcommits-0.9.1 lib/lolcommits/cli/launcher.rb
lolcommits-0.9.1.pre1 lib/lolcommits/cli/launcher.rb
lolcommits-0.9.0 lib/lolcommits/cli/launcher.rb
lolcommits-0.8.1 lib/lolcommits/cli/launcher.rb
lolcommits-0.8.0 lib/lolcommits/cli/launcher.rb
lolcommits-0.7.0 lib/lolcommits/cli/launcher.rb
lolcommits-0.6.7 lib/lolcommits/cli/launcher.rb
lolcommits-0.6.6 lib/lolcommits/cli/launcher.rb
lolcommits-0.6.6.pre1 lib/lolcommits/cli/launcher.rb
snapgit-0.6.5 lib/lolcommits/cli/launcher.rb
lolcommits-0.6.5 lib/lolcommits/cli/launcher.rb
snapgit-0.6.4 lib/lolcommits/cli/launcher.rb
lolcommits-0.6.4 lib/lolcommits/cli/launcher.rb
lolcommits-0.6.3 lib/lolcommits/cli/launcher.rb
lolcommits-0.6.3.pre1 lib/lolcommits/cli/launcher.rb
lolcommits-0.6.2 lib/lolcommits/cli/launcher.rb
lolcommits-0.6.2.pre1 lib/lolcommits/cli/launcher.rb
lolcommits-0.6.1 lib/lolcommits/cli/launcher.rb