Sha256: 037f03e197872eedd85d4893a0a029398a3b166fc3e32babe0999072b9484cee

Contents?: true

Size: 467 Bytes

Versions: 4

Compression:

Stored size: 467 Bytes

Contents

module Markup::Preview::Command
  module Util

    def command_exist? (command)
      system "which #{command} >/dev/null 2>&1"
    end

    def browser_command
      return "gnome-open" if command_exist? "gnome-open"
      return "open"       if command_exist? "open"
      return "cygstart"   if command_exist? "cygstart"
      return "kfmclient"  if command_exist? "kfmclient"
      return "exo-open"   if command_exist? "exo-open"
      exit 1
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
markup-preview-command-0.0.9 lib/markup-preview-command/util/util.rb
markup-preview-command-0.0.8 lib/markup-preview-command/util/util.rb
markup-preview-command-0.0.7 lib/markup-preview-command/util/util.rb
markup-preview-command-0.0.6 lib/markup-preview-command/util/util.rb