lib/boom/platform.rb in boom-0.4.0 vs lib/boom/platform.rb in boom-0.5.0

- old
+ new

@@ -8,10 +8,17 @@ # clipboard, pasteboard, or whatever they decide to call it. # module Boom class Platform class << self + # Public: tests if currently running on cygwin. + # + # Returns true if running on Cygwin, else false + def cygwin? + !!(RbConfig::CONFIG['host_os'] =~ /cygwin/) + end + # Public: tests if currently running on darwin. # # Returns true if running on darwin (MacOS X), else false def darwin? !!(RbConfig::CONFIG['host_os'] =~ /darwin/) @@ -35,10 +42,12 @@ def open_command if darwin? 'open' elsif windows? 'start' + elsif cygwin? + 'cygstart' else 'xdg-open' end end @@ -61,10 +70,10 @@ # # Returns a String with the bin def copy_command if darwin? 'pbcopy' - elsif windows? + elsif windows? || cygwin? 'clip' else 'xclip -selection clipboard' end end