Permalink
Browse files

Adds support for copying and opening list items under Cygwin

`cygstart` is used for opening and the standard Windows `clip` utility for copying.
  • Loading branch information...
1 parent a586538 commit d83b0823abc600d59a1ea0f0631b83818a9b8dd6 @00dani 00dani committed Jul 10, 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 d83b082

Please sign in to comment.