Module: Markup::Preview::Command::Util
- Included in:
- Runner
- Defined in:
- lib/markup-preview-command/util/util.rb
Instance Method Summary collapse
Instance Method Details
#browser_command ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/markup-preview-command/util/util.rb', line 8 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 |
#command_exist?(command) ⇒ Boolean
4 5 6 |
# File 'lib/markup-preview-command/util/util.rb', line 4 def command_exist? (command) system "which #{command} >/dev/null 2>&1" end |