test_notifier 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc ADDED
@@ -0,0 +1,81 @@
1
+ = Test Notifier
2
+
3
+ Inspired by http://railstips.org/2007/7/23/autotest-growl-pass-fail-notifications
4
+
5
+ After using Growl notification, I decided to write my own plugin because I have
6
+ to work on Ubuntu and Mac OS X and I missed the notification on my Linux box.
7
+ This plugin works with Linux, Mac OS X and Windows. All you need to do is
8
+ install the specific notification library for your OS.
9
+
10
+ Instead of displaying lots of notifications for each failure, I prefer to be
11
+ notified about the whole test result (you'll have to check your log
12
+ file anyway in order to clean up the failures/errors).
13
+
14
+ == Installation
15
+
16
+ === Mac OS X
17
+
18
+ * Install Growl - http://growl.info/
19
+ * Install the growlnotify script located on the "Extras" directory
20
+ * Open the Growl Preference Page (System > Growl) and activate the options "Listen for incoming notifications" and "Allow remote application registration" on the Network tab.
21
+
22
+ === Linux
23
+
24
+ If you're a linux guy, you can choose on of these methods:
25
+
26
+ * Install libnotify-bin and its dependencies: <tt>sudo aptitude install libnotify-bin</tt>
27
+ * Install xosd-bin: <tt>sudo aptitude install xosd-bin</tt>
28
+ * KDE users don't need to install anything: Test Notifier will use +knotify+.
29
+
30
+ === Windows
31
+
32
+ * Install Snarl: download from http://www.fullphat.net
33
+ * Install ruby-snarl: <tt>gem install ruby-snarl</tt>
34
+
35
+ === All
36
+
37
+ Then, install the gem with <tt>sudo gem install test_notifier</tt>
38
+
39
+ == Usage
40
+
41
+ If you're using Test::Unit you should add <tt>require "test_notifier/test_unit"</tt>
42
+
43
+ If you're using RSpec you should add <tt>require "test_notifier/rspec"</tt>
44
+
45
+ If you're using Autotest you should add <tt>require test_notifier/autotest"</tt> to
46
+ the file <tt>~/.autotest</tt>
47
+
48
+ If you want to customize the images, create a directory at <tt>~/.test_notifier</tt>
49
+ and save the images <tt>none.png</tt>, <tt>passed.png<tt>, <tt>failure.png</tt> and <tt>error.png</tt>.
50
+
51
+ == Maintainer
52
+
53
+ * Nando Vieira - http://simplesideias.com.br
54
+
55
+ == Collaborators
56
+
57
+ * jeznet - http://github.com/jeznet
58
+ * Steve Halasz - http://github.com/woodchuck
59
+
60
+ == License
61
+
62
+ (The MIT License)
63
+
64
+ Permission is hereby granted, free of charge, to any person obtaining
65
+ a copy of this software and associated documentation files (the
66
+ 'Software'), to deal in the Software without restriction, including
67
+ without limitation the rights to use, copy, modify, merge, publish,
68
+ distribute, sublicense, and/or sell copies of the Software, and to
69
+ permit persons to whom the Software is furnished to do so, subject to
70
+ the following conditions:
71
+
72
+ The above copyright notice and this permission notice shall be
73
+ included in all copies or substantial portions of the Software.
74
+
75
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
76
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
77
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
78
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
79
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
80
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
81
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/lib/test_notifier.rb CHANGED
@@ -60,6 +60,9 @@ module TestNotifier
60
60
  "eventname \'#{title}\' \'#{msg}\' '' '' 16 2"
61
61
  end
62
62
  knotify title, message
63
+ # if kdialog is available
64
+ elsif `which kdialog` && $? == 0
65
+ system("kdialog --title #{title} --passivepopup \"#{message}\" 5")
63
66
  # if notify-send is avaible
64
67
  elsif `which notify-send` && $? == 0
65
68
  system("notify-send -i #{image} #{title} \"#{message}\"")
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test_notifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 1
8
+ - 1
9
+ version: 0.1.1
5
10
  platform: ruby
6
11
  authors:
7
12
  - Nando Vieira
@@ -9,70 +14,61 @@ autorequire:
9
14
  bindir: bin
10
15
  cert_chain: []
11
16
 
12
- date: 2009-03-24 00:00:00 -03:00
17
+ date: 2010-03-11 00:00:00 -03:00
13
18
  default_executable:
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
16
- name: rubigen
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
20
- requirements:
21
- - - ">="
22
- - !ruby/object:Gem::Version
23
- version: "0"
24
- version:
25
- description: Display system notifications (dbus, growl and snarl) after running tests. It works on Mac OS X, Linux and Windows. Powerful when used with Autotest ZenTest gem for Rails apps.
26
- email:
27
- - fnando.vieira@gmail.com
19
+ dependencies: []
20
+
21
+ description: |
22
+ Display system notifications (dbus, growl and snarl) after
23
+ running tests. It works on Mac OS X, Linux and Windows. Powerful when used
24
+ with Autotest ZenTest gem for Rails apps.
25
+
26
+ email: fnando.vieira@gmail.com
28
27
  executables: []
29
28
 
30
29
  extensions: []
31
30
 
32
- extra_rdoc_files: []
33
-
31
+ extra_rdoc_files:
32
+ - README.rdoc
34
33
  files:
35
- - Rakefile
36
- - test_notifier.gemspec
37
- - History.txt
38
- - License.txt
39
- - README.markdown
40
- - TODO.txt
41
- - lib/test_notifier
34
+ - README.rdoc
35
+ - lib/test_notifier.rb
42
36
  - lib/test_notifier/autotest.rb
43
- - lib/test_notifier/icons
44
37
  - lib/test_notifier/icons/error.png
45
38
  - lib/test_notifier/icons/failure.png
46
39
  - lib/test_notifier/icons/passed.png
47
40
  - lib/test_notifier/register-growl.scpt
48
41
  - lib/test_notifier/rspec.rb
49
42
  - lib/test_notifier/test_unit.rb
50
- - lib/test_notifier.rb
51
- has_rdoc: false
52
- homepage: http://github.com/fnando/test_notifier
53
- post_install_message:
54
- rdoc_options: []
43
+ has_rdoc: true
44
+ homepage: http://github.com/fnando/games_radar
45
+ licenses: []
55
46
 
47
+ post_install_message:
48
+ rdoc_options:
49
+ - --charset=UTF-8
56
50
  require_paths:
57
51
  - lib
58
52
  required_ruby_version: !ruby/object:Gem::Requirement
59
53
  requirements:
60
54
  - - ">="
61
55
  - !ruby/object:Gem::Version
56
+ segments:
57
+ - 0
62
58
  version: "0"
63
- version:
64
59
  required_rubygems_version: !ruby/object:Gem::Requirement
65
60
  requirements:
66
61
  - - ">="
67
62
  - !ruby/object:Gem::Version
63
+ segments:
64
+ - 0
68
65
  version: "0"
69
- version:
70
66
  requirements:
71
67
  - You'll need Growl (Mac OS X), Libnotify (Linux) or Snarl (Windows)
72
68
  rubyforge_project:
73
- rubygems_version: 1.3.1
69
+ rubygems_version: 1.3.6
74
70
  signing_key:
75
- specification_version: 2
71
+ specification_version: 3
76
72
  summary: Display system notifications (dbus, growl and snarl) after running tests.
77
73
  test_files: []
78
74
 
data/History.txt DELETED
@@ -1,40 +0,0 @@
1
- == 0.0.1 2007-10-11
2
-
3
- * 1 major enhancement:
4
- * Initial release
5
-
6
- == 0.0.2 2007-10-17
7
-
8
- * Removed ANSI characters for playing nice with RedGreen
9
-
10
- == 0.0.3 2007-10-18
11
-
12
- * growlnotify wasn't working as expected
13
-
14
- == 0.0.4 2007-10-18
15
-
16
- * title was displayed incorrectly on growlnotify
17
-
18
- == 0.0.5 2007-10-18
19
-
20
- * bug fix
21
-
22
- == 0.0.6 2008-01-14
23
-
24
- * added support for both Test::Unit and RSpec, with or without Autotest
25
-
26
- == 0.0.7 2008-01-16
27
-
28
- * bug fix
29
-
30
- == 0.0.8 2008-01-18
31
-
32
- * bug fix
33
-
34
- == 0.0.9
35
-
36
- * minor fix: added freebsd pattern
37
-
38
- == 0.0.10
39
-
40
- * minor fix: fixed path for custom images
data/License.txt DELETED
@@ -1,20 +0,0 @@
1
- Copyright (c) 2008 Nando Vieira
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.markdown DELETED
@@ -1,107 +0,0 @@
1
- test_notifier
2
- =============
3
-
4
- DESCRIPTION:
5
- ------------
6
-
7
- Inspired by <http://railstips.org/2007/7/23/autotest-growl-pass-fail-notifications>
8
-
9
- After using Growl notification, I decided to write my own plugin because I have
10
- to work on Ubuntu and Mac OS X and I missed the notification on my Linux box.
11
- This plugin works with Linux, Mac OS X and Windows. All you need to do is
12
- install the specific notification library for your OS.
13
-
14
- Instead of displaying lots of notifications for each failure, I prefer to be
15
- notified about the whole test result (you'll have to check your log
16
- file anyway in order to clean up the failures/errors).
17
-
18
- INSTALLATION:
19
- -------------
20
-
21
- ### Mac OS X
22
-
23
- 1. Install Growl (<http://growl.info/>)
24
- 2. Install the growlnotify script located on the "Extras" directory
25
- 3. Open the Growl Preference Page (System > Growl) and activate the
26
- options "Listen for incoming notifications" and "Allow remote
27
- application registration" on the Network tab.
28
-
29
- ### Linux
30
-
31
- If you're a linux guy, you can choose on of these methods:
32
-
33
- 1. Install libnotify-bin and its dependencies:
34
-
35
- sudo aptitude install libnotify-bin
36
-
37
- 2. Install xosd-bin
38
-
39
- sudo aptitude install xosd-bin
40
-
41
- 3. Install
42
-
43
- ### Windows
44
-
45
- 1. Install Snarl: download from <http://www.fullphat.net/>
46
- 2. Install ruby-snarl:
47
-
48
- gem install ruby-snarl
49
-
50
- ### All
51
-
52
- Then, install the gem:
53
-
54
- git clone git://github.com/fnando/test_notifier.git
55
- cd test_notifier
56
- rake gem:install
57
-
58
- or
59
-
60
- sudo gem install fnando-test_notifier --source=http://gems.github.com
61
-
62
- USAGE:
63
- ------
64
-
65
- If you're using Test::Unit you should add `require "test_notifier/test_unit"`
66
-
67
- If you're using RSpec you should add `require "test_notifier/rspec"`
68
-
69
- If you're using Autotest you should add `require "test_notifier/autotest"` to
70
- the file `~/.autotest`
71
-
72
- If you want to customize the images, create a directory at `~/.test_notifier`
73
- and save the images `none.png`, `passed.png`, `failure.png` and `error.png`.
74
-
75
- MAINTAINER
76
- ----------
77
-
78
- * Nando Vieira (<http://simplesideias.com.br>)
79
-
80
- COLLABORATORS
81
- -------------
82
-
83
- * jeznet (<http://github.com/jeznet>)
84
-
85
- LICENSE:
86
- --------
87
-
88
- (The MIT License)
89
-
90
- Permission is hereby granted, free of charge, to any person obtaining
91
- a copy of this software and associated documentation files (the
92
- 'Software'), to deal in the Software without restriction, including
93
- without limitation the rights to use, copy, modify, merge, publish,
94
- distribute, sublicense, and/or sell copies of the Software, and to
95
- permit persons to whom the Software is furnished to do so, subject to
96
- the following conditions:
97
-
98
- The above copyright notice and this permission notice shall be
99
- included in all copies or substantial portions of the Software.
100
-
101
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
102
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
103
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
104
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
105
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
106
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
107
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile DELETED
@@ -1,74 +0,0 @@
1
- require "rubygems"
2
- require "rake"
3
-
4
- PKG_FILES = %w(Rakefile test_notifier.gemspec History.txt License.txt README.markdown TODO.txt) +
5
- Dir["lib/**/*"]
6
-
7
- spec = Gem::Specification.new do |s|
8
- s.name = "test_notifier"
9
- s.version = "0.1.0"
10
- s.summary = "Display system notifications (dbus, growl and snarl) after running tests."
11
- s.authors = ["Nando Vieira"]
12
- s.email = ["fnando.vieira@gmail.com"]
13
- s.homepage = "http://github.com/fnando/test_notifier"
14
- s.description = "Display system notifications (dbus, growl and snarl) after \
15
- running tests. It works on Mac OS X, Linux and Windows. Powerful when used \
16
- with Autotest ZenTest gem for Rails apps."
17
- s.has_rdoc = false
18
- s.files = PKG_FILES
19
-
20
- s.add_dependency "rubigen"
21
- s.requirements << "You'll need Growl (Mac OS X), Libnotify (Linux) or Snarl (Windows)"
22
- end
23
-
24
- namespace :gem do
25
- # Thanks to the Merb project for this code.
26
- desc "Update Github Gemspec"
27
- task :update_gemspec do
28
- skip_fields = %w(new_platform original_platform specification_version loaded required_ruby_version rubygems_version platform )
29
-
30
- result = "# WARNING : RAKE AUTO-GENERATED FILE. DO NOT MANUALLY EDIT!\n"
31
- result << "# RUN : 'rake gem:update_gemspec'\n\n"
32
- result << "Gem::Specification.new do |s|\n"
33
-
34
- spec.instance_variables.each do |ivar|
35
- value = spec.instance_variable_get(ivar)
36
- name = ivar.split("@").last
37
- next if name == "date"
38
-
39
- next if skip_fields.include?(name) || value.nil? || value == "" || (value.respond_to?(:empty?) && value.empty?)
40
- if name == "dependencies"
41
- value.each do |d|
42
- dep, *ver = d.to_s.split(" ")
43
- result << " s.add_dependency #{dep.inspect}, #{ver.join(" ").inspect.gsub(/[()]/, "").gsub(", runtime", "")}\n"
44
- end
45
- else
46
- case value
47
- when Array
48
- value = name != "files" ? value.inspect : value.inspect.split(",").join(",\n")
49
- when FalseClass
50
- when TrueClass
51
- when Fixnum
52
- when String
53
- value = value.inspect
54
- else
55
- value = value.to_s.inspect
56
- end
57
- result << " s.#{name} = #{value}\n"
58
- end
59
- end
60
-
61
- result << "end"
62
- File.open(File.join(File.dirname(__FILE__), "#{spec.name}.gemspec"), "w"){|f| f << result}
63
- end
64
-
65
- desc "Build gem"
66
- task :build => [:update_gemspec] do
67
- system "gem build #{spec.instance_variable_get('@name')}.gemspec"
68
- end
69
-
70
- desc "Install gem"
71
- task :install => [:update_gemspec, :build] do
72
- system "sudo gem install #{spec.instance_variable_get('@name')}"
73
- end
74
- end
data/TODO.txt DELETED
File without changes
@@ -1,34 +0,0 @@
1
- # WARNING : RAKE AUTO-GENERATED FILE. DO NOT MANUALLY EDIT!
2
- # RUN : 'rake gem:update_gemspec'
3
-
4
- Gem::Specification.new do |s|
5
- s.authors = ["Nando Vieira"]
6
- s.require_paths = ["lib"]
7
- s.required_rubygems_version = ">= 0"
8
- s.has_rdoc = false
9
- s.files = ["Rakefile",
10
- "test_notifier.gemspec",
11
- "History.txt",
12
- "License.txt",
13
- "README.markdown",
14
- "TODO.txt",
15
- "lib/test_notifier",
16
- "lib/test_notifier/autotest.rb",
17
- "lib/test_notifier/icons",
18
- "lib/test_notifier/icons/error.png",
19
- "lib/test_notifier/icons/failure.png",
20
- "lib/test_notifier/icons/passed.png",
21
- "lib/test_notifier/register-growl.scpt",
22
- "lib/test_notifier/rspec.rb",
23
- "lib/test_notifier/test_unit.rb",
24
- "lib/test_notifier.rb"]
25
- s.email = ["fnando.vieira@gmail.com"]
26
- s.version = "0.1.0"
27
- s.homepage = "http://github.com/fnando/test_notifier"
28
- s.requirements = ["You'll need Growl (Mac OS X), Libnotify (Linux) or Snarl (Windows)"]
29
- s.name = "test_notifier"
30
- s.summary = "Display system notifications (dbus, growl and snarl) after running tests."
31
- s.description = "Display system notifications (dbus, growl and snarl) after running tests. It works on Mac OS X, Linux and Windows. Powerful when used with Autotest ZenTest gem for Rails apps."
32
- s.add_dependency "rubigen", ">= 0"
33
- s.bindir = "bin"
34
- end