Permalink
Browse files

Merge pull request #108 from 00Davo/cygwin

Adds support for copying and opening list items under Cygwin
  • Loading branch information...
2 parents a586538 + d83b082 commit c530f81469318713c0e4f586cc413c6988ca21a8 @holman committed Jul 11, 2014
Showing with 10 additions and 1 deletion.
  1. +10 −1 lib/boom/platform.rb
View
@@ -10,6 +10,13 @@
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
@@ -37,6 +44,8 @@ def open_command
'open'
elsif windows?
'start'
+ elsif cygwin?
+ 'cygstart'
else
'xdg-open'
end
@@ -63,7 +72,7 @@ def open(item)
def copy_command
if darwin?
'pbcopy'
- elsif windows?
+ elsif windows? || cygwin?
'clip'
else
'xclip -selection clipboard'

0 comments on commit c530f81

Please sign in to comment.