lib/notifier/adapters/gntp.rb in notifier-0.4.1 vs lib/notifier/adapters/gntp.rb in notifier-0.5.0
- old
+ new
@@ -44,22 +44,22 @@
name = options.fetch(:name, "notification")
register(name)
icon = fetch_icon(options[:icon])
- result = write "GNTP/1.0 NOTIFY NONE",
- "Application-Name: #{application_name}",
- "Notification-Name: #{name}",
- "Notification-Title: #{options[:title]}",
- "Notification-Text: #{options[:message]}",
- "Notification-Icon: x-growl-resource://#{icon[:identifier]}",
- "Notification-Sticky: #{bool options[:sticky]}",
- nil,
- "Identifier: #{icon[:identifier]}",
- "Length: #{icon[:size]}",
- nil,
- icon[:contents]
+ write "GNTP/1.0 NOTIFY NONE",
+ "Application-Name: #{application_name}",
+ "Notification-Name: #{name}",
+ "Notification-Title: #{options[:title]}",
+ "Notification-Text: #{options[:message]}",
+ "Notification-Icon: x-growl-resource://#{icon[:identifier]}",
+ "Notification-Sticky: #{bool options[:sticky]}",
+ nil,
+ "Identifier: #{icon[:identifier]}",
+ "Length: #{icon[:size]}",
+ nil,
+ icon[:contents]
end
def fetch_icon(path)
contents = File.open(path, "rb") {|f| f.read }
@@ -73,17 +73,15 @@
def bool(boolean)
{true => "Yes", false => "No"}[boolean]
end
def register(name)
- result = write(
- "GNTP/1.0 REGISTER NONE",
- "Application-Name: #{application_name}",
- "Notifications-count: 1",
- nil,
- "Notification-Name: #{name}",
- "Notification-Enabled: True"
- )
+ write "GNTP/1.0 REGISTER NONE",
+ "Application-Name: #{application_name}",
+ "Notifications-count: 1",
+ nil,
+ "Notification-Name: #{name}",
+ "Notification-Enabled: True"
end
end
end
end