rb-notifu 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -16,7 +16,11 @@ There are three possible alternatives to Growl on windows:
16
16
  ```ruby
17
17
  require 'rb-notifu'
18
18
 
19
- p RbNotifu::show :message => "test", :type => :warn
19
+ Notifu::show :message => "test", :type => :warn do |status|
20
+ p Notifu::ERRORS.include? status
21
+ end
22
+
23
+ sleep 1.5
20
24
  ```
21
25
 
22
26
  ## Available options
@@ -26,7 +30,7 @@ p RbNotifu::show :message => "test", :type => :warn
26
30
  info The message is an informational message
27
31
  warn The message is an warning message
28
32
  error The message is an error message
29
- :display The number of milliseconds to display (omit or 0 for infinit)
33
+ :time The number of milliseconds to display (omit or 0 for infinit)
30
34
  :title The title (or prompt) of the ballon
31
35
  :message The message text
32
36
  :icon Specify an icon to use ("parent" uses the icon of the parent process)
@@ -34,8 +38,8 @@ p RbNotifu::show :message => "test", :type => :warn
34
38
  :nosound Do not play a sound when the tooltip is displayed
35
39
  :noquiet Show the tooltip even if the user is in the quiet period that follows his very first login (Windows 7 and up)
36
40
  :xp Use IUserNotification interface event when IUserNotification2 is available
41
+ ```
37
42
 
38
43
  ## TODO
39
44
 
40
45
  - Use FFI instead of embedded executable file
41
- - While showing message it blocks. Need to add thread and :noblock option
@@ -1,11 +1,11 @@
1
1
  require 'pathname'
2
- module RbNotifu
2
+ module Notifu
3
3
 
4
4
  @executable = Pathname.new(__FILE__).parent.parent.realpath.to_s + '/bin/notifu.exe'
5
5
 
6
6
  @option_to_flag = {
7
7
  :type => "t",
8
- :display => "d",
8
+ :time => "d",
9
9
  :title => "p",
10
10
  :message => "m",
11
11
  :icon => "i",
@@ -17,7 +17,7 @@ module RbNotifu
17
17
 
18
18
  @option_default = {
19
19
  :type => :info,
20
- :display => 1000,
20
+ :time => 3,
21
21
  :title => "rb-notifu",
22
22
  :message => " ",
23
23
  :icon => false,
@@ -64,7 +64,7 @@ module RbNotifu
64
64
  # info The message is an informational message
65
65
  # warn The message is an warning message
66
66
  # error The message is an error message
67
- # :display The number of milliseconds to display (omit or 0 for infinit)
67
+ # :time The number of seconds to display (omit or 0 for infinit)
68
68
  # :title The title (or prompt) of the ballon
69
69
  # :message The message text
70
70
  # :icon Specify an icon to use ("parent" uses the icon of the parent process)
@@ -76,8 +76,14 @@ module RbNotifu
76
76
  flags = ""
77
77
  @option_default.each do |key, value|
78
78
  flag = options.key?(key) ? options[key] : value
79
+ if key == :time
80
+ flag = (flag * 1000).to_i
81
+ end
79
82
  if flag
80
- flags += "/" + @option_to_flag[key] + " " + self.escape(flag) + " "
83
+ flags += "/" + @option_to_flag[key] + " "
84
+ if flag != true
85
+ flags += self.escape(flag) + " "
86
+ end
81
87
  end
82
88
  end
83
89
  Thread.new{
@@ -1,3 +1,3 @@
1
- module RbNotifu
2
- VERSION = "0.0.3"
1
+ module Notifu
2
+ VERSION = "0.0.4"
3
3
  end
@@ -4,7 +4,7 @@ require "rb-notifu/version"
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "rb-notifu"
7
- s.version = RbNotifu::VERSION
7
+ s.version = Notifu::VERSION
8
8
  s.platform = Gem::Platform::RUBY
9
9
  s.authors = ["stereobooster"]
10
10
  s.email = ["stereobooster@gmail.com"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rb-notifu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -14,7 +14,7 @@ default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
17
- requirement: &15073368 !ruby/object:Gem::Requirement
17
+ requirement: &20503356 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: '0'
23
23
  type: :development
24
24
  prerelease: false
25
- version_requirements: *15073368
25
+ version_requirements: *20503356
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: rspec
28
- requirement: &1759716 !ruby/object:Gem::Requirement
28
+ requirement: &20503104 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,7 +33,7 @@ dependencies:
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
- version_requirements: *1759716
36
+ version_requirements: *20503104
37
37
  description: Notification system for windows. Trying to be Growl. Ruby wrapper around
38
38
  notifu (http://www.paralint.com/projects/notifu/index.html)
39
39
  email: