Skip to content

Commit

Permalink
Deprecation error for OSX 10.8
Browse files Browse the repository at this point in the history
  • Loading branch information
Wouter de Vos committed Oct 23, 2014
1 parent 8a6a04c commit ac6a26e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lib/terminal-notifier-guard.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,22 @@ module Guard
ICONS_PATH = File.expand_path("../../icons", __FILE__)
GUARD_ICON = File.join(ICONS_PATH, 'guard.png')

def self.osx_version
Gem::Version.new(`sw_vers -productVersion`.strip)
end

def self.deprecation_check
if osx_version <= Gem::Version.new('10.8')
raise "OSX 10.8 is no longer supported by this gem. Please revert to version <= 1.5.3."
end
end

# Returns wether or not the current platform is Mac OS X 10.8, or higher.
def self.available?
deprecation_check
if @available.nil?
@available = `uname`.strip == 'Darwin' &&
Gem::Version.new(`sw_vers -productVersion`.strip) >= Gem::Version.new('10.8')
osx_version >= Gem::Version.new('10.9')
end
@available
end
Expand Down

0 comments on commit ac6a26e

Please sign in to comment.