notify 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,15 +1,17 @@
1
1
  notify
2
2
  ======
3
3
 
4
- The "notify" provides a function to notify on cross platform.
4
+ "Notify" provides notification functionalities on cross platforms.
5
5
 
6
6
  Feature
7
7
  ---------
8
8
 
9
- It supports followings:
9
+ Notify supports the following features:
10
10
 
11
11
  - growl
12
12
  - notify-send
13
+ - Growl for Windows (`ruby_gntp`)
14
+ - libnotify
13
15
 
14
16
  Installation
15
17
  ---------
@@ -28,6 +30,11 @@ or
28
30
  require 'notify'
29
31
  Notify.notify "title", "message"
30
32
 
33
+ Command
34
+ ---------
35
+
36
+ % notify title messages
37
+
31
38
  Copyright
32
39
  ---------
33
40
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.3.0
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+ $:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
3
+ require 'notify'
4
+
5
+ title = ARGV.shift || 'Notify'
6
+ message = ARGV.empty? ? 'notify' : ARGV.join("\n")
7
+
8
+ Notify.notify title, message
@@ -19,7 +19,7 @@ end
19
19
  unless defined? Notify
20
20
  module Notify
21
21
  def self.notify(title, message)
22
- # do nothing
22
+ puts "#{title}: #{message}"
23
23
  end
24
24
  end
25
25
  end
@@ -1,6 +1,6 @@
1
- if system('which growlnotify 2>&1 > /dev/null')
1
+ if system('which growlnotify > /dev/null 2>&1')
2
2
  module Notify
3
- def self.notify(title, message)
3
+ def self.notify(title, message, option = {})
4
4
  system 'growlnotify', '-t', title, '-m', message
5
5
  end
6
6
  end
@@ -0,0 +1,7 @@
1
+ if system('which kdialog > /dev/null 2>&1')
2
+ module Notify
3
+ def self.notify(title, message, option = {})
4
+ system 'kdialog', '--passivepopup', message, '--title',title
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,9 @@
1
+ begin
2
+ require 'libnotify'
3
+ module Notify
4
+ def self.notify(title, message, option={})
5
+ Libnotify.show(:summary => title, :body => message, :icon_path => option[:icon])
6
+ end
7
+ end
8
+ rescue LoadError
9
+ end
@@ -1,6 +1,6 @@
1
- if system('which notify-send 2>&1 > /dev/null')
1
+ if system('which notify-send > /dev/null 2>&1')
2
2
  module Notify
3
- def self.notify(title, message)
3
+ def self.notify(title, message, option = {})
4
4
  system 'notify-send', title, message
5
5
  end
6
6
  end
@@ -3,8 +3,8 @@ begin
3
3
 
4
4
  module Notify
5
5
  @@growl = Growl.new 'localhost', 'ruby', ['notify']
6
- def self.notify(title, message)
7
- @@growl.notify 'notify', title, message
6
+ def self.notify(title, message, option = {})
7
+ @@growl.notify 'notify', title, message, option[:priority] || 0, option[:sticky] || false
8
8
  end
9
9
  end
10
10
  rescue LoadError
@@ -2,8 +2,8 @@ begin
2
2
  require 'ruby_gntp'
3
3
 
4
4
  module Notify
5
- def self.notify(title, message)
6
- GNTP.notify :app_name => "ruby", :title => title, :text => message, :icon => ""
5
+ def self.notify(title, message, option = {})
6
+ GNTP.notify :app_name => "ruby", :title => title, :text => message, :icon => option[:icon] || "", :sticky => option[:sticky] || false
7
7
  end
8
8
  end
9
9
  rescue LoadError
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: notify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 3
8
+ - 0
9
+ version: 0.3.0
5
10
  platform: ruby
6
11
  authors:
7
12
  - jugyo
@@ -9,14 +14,14 @@ autorequire:
9
14
  bindir: bin
10
15
  cert_chain: []
11
16
 
12
- date: 2010-02-01 00:00:00 +09:00
13
- default_executable:
17
+ date: 2010-09-29 00:00:00 +09:00
18
+ default_executable: notify
14
19
  dependencies: []
15
20
 
16
21
  description: The "notify" provides a function to notify on cross platform.
17
22
  email: jugyo.org@gmail.com
18
- executables: []
19
-
23
+ executables:
24
+ - notify
20
25
  extensions: []
21
26
 
22
27
  extra_rdoc_files:
@@ -27,8 +32,11 @@ files:
27
32
  - README.md
28
33
  - Rakefile
29
34
  - VERSION
35
+ - bin/notify
30
36
  - lib/notify.rb
31
37
  - lib/notify/growlnotify.rb
38
+ - lib/notify/kdialog.rb
39
+ - lib/notify/lib_notify.rb
32
40
  - lib/notify/notify-send.rb
33
41
  - lib/notify/ruby-growl.rb
34
42
  - lib/notify/ruby_gntp.rb
@@ -43,21 +51,25 @@ rdoc_options:
43
51
  require_paths:
44
52
  - lib
45
53
  required_ruby_version: !ruby/object:Gem::Requirement
54
+ none: false
46
55
  requirements:
47
56
  - - ">="
48
57
  - !ruby/object:Gem::Version
58
+ segments:
59
+ - 0
49
60
  version: "0"
50
- version:
51
61
  required_rubygems_version: !ruby/object:Gem::Requirement
62
+ none: false
52
63
  requirements:
53
64
  - - ">="
54
65
  - !ruby/object:Gem::Version
66
+ segments:
67
+ - 0
55
68
  version: "0"
56
- version:
57
69
  requirements: []
58
70
 
59
71
  rubyforge_project:
60
- rubygems_version: 1.3.5
72
+ rubygems_version: 1.3.7
61
73
  signing_key:
62
74
  specification_version: 3
63
75
  summary: A function to notify on cross platform.