Skip to content

Commit

Permalink
Switched icon and contentImage because 10.9 does not seem to support …
Browse files Browse the repository at this point in the history
…contentImages, and we want at least the status icon. Also added Guard.icns instead of PNG.
  • Loading branch information
Wouter de Vos committed Nov 2, 2014
1 parent 3eec505 commit df82582
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Binary file added icons/Guard.icns
Binary file not shown.
Binary file removed icons/guard.png
Binary file not shown.
4 changes: 2 additions & 2 deletions lib/terminal-notifier-guard.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module TerminalNotifier
module Guard
VERSION = "1.6.2"
ICONS_PATH = File.expand_path("../../icons", __FILE__)
GUARD_ICON = File.join(ICONS_PATH, 'guard.png')
GUARD_ICON = File.join(ICONS_PATH, 'Guard.icns')

def self.osx_version
Gem::Version.new(`sw_vers -productVersion`.strip)
Expand Down Expand Up @@ -46,7 +46,7 @@ def self.bin_path

def self.execute(verbose, options)
if available? && installed?
options.merge!({ :appIcon => GUARD_ICON, :contentImage => icon(options.delete(:type)) })
options.merge!({ :contentImage=> GUARD_ICON, :appIcon => icon(options.delete(:type)) })

command = [bin_path, *options.map { |k,v| ["-#{k}", v.to_s] }.flatten]
if RUBY_VERSION < '1.9'
Expand Down
10 changes: 5 additions & 5 deletions spec/terminal-notifier-guard_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
describe "TerminalNotifier::Guard" do
describe ".execute" do
it "executes the tool with the given options" do
command = [TerminalNotifier::Guard.bin_path, '-message', 'ZOMG', '-appIcon', TerminalNotifier::Guard::GUARD_ICON, '-contentImage', TerminalNotifier::Guard.icon]
command = [TerminalNotifier::Guard.bin_path, '-message', 'ZOMG', '-contentImage', TerminalNotifier::Guard::GUARD_ICON, '-appIcon', TerminalNotifier::Guard.icon]
if RUBY_VERSION < '1.9'
require 'shellwords'
command = Shellwords.shelljoin(command)
Expand All @@ -21,7 +21,7 @@
end

it "executes with the right icon path according to the type option" do
command = [TerminalNotifier::Guard.bin_path, '-message', 'ZOMG', '-appIcon', TerminalNotifier::Guard::GUARD_ICON, '-contentImage', TerminalNotifier::Guard.icon(:success)]
command = [TerminalNotifier::Guard.bin_path, '-message', 'ZOMG', '-contentImage', TerminalNotifier::Guard::GUARD_ICON, '-appIcon', TerminalNotifier::Guard.icon(:success)]
if RUBY_VERSION < '1.9'
require 'shellwords'
command = Shellwords.shelljoin(command)
Expand Down Expand Up @@ -87,7 +87,7 @@

describe ".failed" do
it "executes with the 'failed' icon flag" do
command = [TerminalNotifier::Guard.bin_path, '-message', 'ZOMG', '-appIcon', TerminalNotifier::Guard::GUARD_ICON, '-contentImage', TerminalNotifier::Guard.icon(:failed)]
command = [TerminalNotifier::Guard.bin_path, '-message', 'ZOMG', '-contentImage', TerminalNotifier::Guard::GUARD_ICON, '-appIcon', TerminalNotifier::Guard.icon(:failed)]
if RUBY_VERSION < '1.9'
require 'shellwords'
command = Shellwords.shelljoin(command)
Expand All @@ -99,7 +99,7 @@

describe ".success" do
it "executes with the 'success' icon flag" do
command = [TerminalNotifier::Guard.bin_path, '-message', 'ZOMG', '-appIcon', TerminalNotifier::Guard::GUARD_ICON, '-contentImage', TerminalNotifier::Guard.icon(:success)]
command = [TerminalNotifier::Guard.bin_path, '-message', 'ZOMG', '-contentImage', TerminalNotifier::Guard::GUARD_ICON, '-appIcon', TerminalNotifier::Guard.icon(:success)]
if RUBY_VERSION < '1.9'
require 'shellwords'
command = Shellwords.shelljoin(command)
Expand All @@ -111,7 +111,7 @@

describe ".pending" do
it "executes with the 'pending' icon flag" do
command = [TerminalNotifier::Guard.bin_path, '-message', 'ZOMG', '-appIcon', TerminalNotifier::Guard::GUARD_ICON, '-contentImage', TerminalNotifier::Guard.icon(:pending)]
command = [TerminalNotifier::Guard.bin_path, '-message', 'ZOMG', '-contentImage', TerminalNotifier::Guard::GUARD_ICON, '-appIcon', TerminalNotifier::Guard.icon(:pending)]
if RUBY_VERSION < '1.9'
require 'shellwords'
command = Shellwords.shelljoin(command)
Expand Down

0 comments on commit df82582

Please sign in to comment.