Permalink
Browse files

Align examples in README and doc

  • Loading branch information...
1 parent ef4de0f commit 95397d804bd1125432916c7b915262c5a82ca41d @splattael committed May 4, 2011
Showing with 17 additions and 25 deletions.
  1. +8 −8 README.rdoc
  2. +9 −17 lib/libnotify.rb
View
@@ -11,12 +11,12 @@ RDoc[http://rdoc.info/projects/splattael/libnotify]
# Block syntax
n = Libnotify.new do |notify|
- notify.summary = "world"
- notify.body = "hello"
- notify.timeout = 1.5 # 1.5 (s), 1000 (ms), "2", nil, false
- notify.urgency = :critical # :low, :normal, :critical
- notify.append = false # default true - append onto existing notification
- notify.icon_path = "/usr/share/icons/gnome/scalable/emblems/emblem-default.svg"
+ notify.summary = "hello"
+ notify.body = "world"
+ notify.timeout = 1.5 # 1.5 (s), 1000 (ms), "2", nil, false
+ notify.urgency = :critical # :low, :normal, :critical
+ notify.append = false # default true - append onto existing notification
+ notify.icon_path = "/usr/share/icons/gnome/scalable/emblems/emblem-default.svg"
end
n.show!
@@ -38,9 +38,9 @@ You'll need libnotify. On Debian just type:
== Testing
- git co git://github.com/splattael/libnotify.git
+ git clone git://github.com/splattael/libnotify.git
cd libnotify
- gem install bundler
+ (gem install bundler)
bundle install
rake
View
@@ -13,14 +13,18 @@ module Libnotify
#
# @example Block syntax
# n = Libnotify.new do |notify|
- # notify.summary = "world"
- # notify.body = "hello"
- # notify.timeout = 1.5 # 1.5 (s), 1000 (ms), "2", nil, false
- # notify.urgency = :critical # :low, :normal, :critical
- # notify.icon_path = "/usr/share/icons/gnome/scalable/emblems/emblem-default.svg"
+ # notify.summary = "hello"
+ # notify.body = "world"
+ # notify.timeout = 1.5 # 1.5 (s), 1000 (ms), "2", nil, false
+ # notify.urgency = :critical # :low, :normal, :critical
+ # notify.append = false # default true - append onto existing notification
+ # notify.icon_path = "/usr/share/icons/gnome/scalable/emblems/emblem-default.svg"
# end
# n.show!
#
+ # @example Hash syntax
+ # Libnotify.show(:body => "hello", :summary => "world", :timeout => 2.5)
+ #
# @example Mixed syntax
# Libnotify.new(options) do |n|
# n.timeout = 1.5 # overrides :timeout in options
@@ -46,18 +50,6 @@ def self.new(options={}, &block)
# Shows a notification. It takes the same +options+ as Libnotify.new.
#
- # @example Block syntax
- # Libnotify.show do |notify|
- # notify.summary = "world"
- # notify.body = "hello"
- # notify.timeout = 1.5 # 1.5 (s), 1000 (ms), "2", nil, false
- # notify.urgency = :critical # :low, :normal, :critical
- # notify.icon_path = "/usr/share/icons/gnome/scalable/emblems/emblem-default.svg"
- # end
- #
- # @example Hash syntax
- # Libnotify.show(:body => "hello", :summary => "world", :timeout => 2.5)
- #
# @see Libnotify.new
def self.show(options={}, &block)
API.show(options, &block)

0 comments on commit 95397d8

Please sign in to comment.