Skip to content

Commit

Permalink
Fixes proposed in Codaisseur#15 for checking the OSX version by @railsme
Browse files Browse the repository at this point in the history
  • Loading branch information
Wouter de Vos committed Oct 22, 2014
1 parent 682eca8 commit aaaad02
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Ruby/lib/terminal-notifier-guard.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ module Guard
# Returns wether or not the current platform is Mac OS X 10.8, or higher.
def self.available?
if @available.nil?
return @available = false unless `uname`.strip == 'Darwin'
version = `sw_vers -productVersion`.strip.split('.').map(&:to_i)
@available = (version.last >= 8 && version.first == 10) || version.first > 10
@available = `uname`.strip == 'Darwin' &&
Gem::Version.new(`sw_vers -productVersion`.strip) >= Gem::Version.new('10.8')
end
@available
end
Expand Down

0 comments on commit aaaad02

Please sign in to comment.