Skip to content

Commit

Permalink
Remove file:// prefix from image path for GNTP
Browse files Browse the repository at this point in the history
ruby_gtnp supports embedding image data directly in the notification
allowing remote notifications to display an image.

In practice, this change has been tested with Growl for Windows
receiving the notification and it behaves as expected, i.e. the image
appears in the notification.

This also likely resolves issue guard#231, as that involves Growl (for OSX)
refusing to download the images.
  • Loading branch information
jgrocho committed Jul 16, 2012
1 parent 815ca3d commit 2119448
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/guard/notifiers/gntp.rb
Expand Up @@ -104,7 +104,7 @@ def notify(type, title, message, image, options = { })
:name => type, :name => type,
:title => title, :title => title,
:text => message, :text => message,
:icon => "file://#{ image }" :icon => image
})) }))
end end


Expand Down
6 changes: 3 additions & 3 deletions spec/guard/notifiers/gntp_spec.rb
Expand Up @@ -87,7 +87,7 @@ def self.notify(options) end
:name => 'success', :name => 'success',
:title => 'Welcome', :title => 'Welcome',
:text => 'Welcome to Guard', :text => 'Welcome to Guard',
:icon => 'file:///tmp/welcome.png' :icon => '/tmp/welcome.png'
}) })
subject.notify('success', 'Welcome', 'Welcome to Guard', '/tmp/welcome.png', { }) subject.notify('success', 'Welcome', 'Welcome to Guard', '/tmp/welcome.png', { })
end end
Expand All @@ -100,7 +100,7 @@ def self.notify(options) end
:name => 'pending', :name => 'pending',
:title => 'Waiting', :title => 'Waiting',
:text => 'Waiting for something', :text => 'Waiting for something',
:icon => 'file:///tmp/wait.png' :icon => '/tmp/wait.png'
}) })
subject.notify('pending', 'Waiting', 'Waiting for something', '/tmp/wait.png', { subject.notify('pending', 'Waiting', 'Waiting for something', '/tmp/wait.png', {
:sticky => true, :sticky => true,
Expand All @@ -113,7 +113,7 @@ def self.notify(options) end
:name => 'failed', :name => 'failed',
:title => 'Failed', :title => 'Failed',
:text => 'Something failed', :text => 'Something failed',
:icon => 'file:///tmp/fail.png' :icon => '/tmp/fail.png'
}) })
subject.notify('failed', 'Failed', 'Something failed', '/tmp/fail.png', { subject.notify('failed', 'Failed', 'Something failed', '/tmp/fail.png', {
:name => 'custom', :name => 'custom',
Expand Down

0 comments on commit 2119448

Please sign in to comment.