From b2a6877fd6f0feda3d06813b8f3e8b5b6102bd21 Mon Sep 17 00:00:00 2001 From: Julien Blanchard Date: Wed, 4 Jun 2014 10:20:27 +0200 Subject: [PATCH] Basic OSX 10.10 compatibility 10.10 is not seen as lower than 10.8 anymore. Closes #92 --- Ruby/lib/terminal-notifier.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Ruby/lib/terminal-notifier.rb b/Ruby/lib/terminal-notifier.rb index 61bf656..e6d2496 100644 --- a/Ruby/lib/terminal-notifier.rb +++ b/Ruby/lib/terminal-notifier.rb @@ -6,7 +6,11 @@ module TerminalNotifier class UnsupportedPlatformError < StandardError; end # Returns wether or not the current platform is Mac OS X 10.8, or higher. def self.available? - @available ||= `uname`.strip == 'Darwin' && `sw_vers -productVersion`.strip >= '10.8' + @available ||= Gem::Version.new(version) > Gem::Version.new('10.8') + end + + def self.version + @version ||= `uname`.strip == 'Darwin' && `sw_vers -productVersion`.strip end def self.execute(verbose, options)