test_notifier 0.0.9 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +5 -1
- data/License.txt +2 -2
- data/README.markdown +107 -0
- data/Rakefile +74 -4
- data/{log/debug.log → TODO.txt} +0 -0
- data/lib/test_notifier/autotest.rb +3 -1
- data/lib/test_notifier/icons/error.png +0 -0
- data/lib/test_notifier/icons/failure.png +0 -0
- data/lib/test_notifier/icons/passed.png +0 -0
- data/lib/test_notifier/register-growl.scpt +0 -0
- data/lib/test_notifier.rb +73 -8
- data/test_notifier.gemspec +34 -0
- metadata +39 -49
- data/Manifest.txt +0 -30
- data/README.txt +0 -44
- data/config/hoe.rb +0 -72
- data/config/requirements.rb +0 -17
- data/lib/test_notifier/version.rb +0 -9
- data/script/destroy +0 -14
- data/script/generate +0 -14
- data/script/txt2html +0 -74
- data/setup.rb +0 -1585
- data/tasks/deployment.rake +0 -27
- data/tasks/environment.rake +0 -7
- data/tasks/website.rake +0 -9
- data/test/test_helper.rb +0 -2
- data/test/test_test_notifier.rb +0 -11
- data/website/index.html +0 -11
- data/website/index.txt +0 -39
- data/website/javascripts/rounded_corners_lite.inc.js +0 -285
- data/website/stylesheets/screen.css +0 -138
- data/website/template.rhtml +0 -48
data/History.txt
CHANGED
data/License.txt
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Copyright (c)
|
1
|
+
Copyright (c) 2008 Nando Vieira
|
2
2
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining
|
4
4
|
a copy of this software and associated documentation files (the
|
@@ -17,4 +17,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
17
17
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
18
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
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.
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.markdown
ADDED
@@ -0,0 +1,107 @@
|
|
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
CHANGED
@@ -1,4 +1,74 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
|
4
|
-
|
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/{log/debug.log → TODO.txt}
RENAMED
File without changes
|
@@ -4,7 +4,9 @@ Autotest.add_hook :ran_command do |at|
|
|
4
4
|
begin
|
5
5
|
content = at.results.to_s
|
6
6
|
|
7
|
-
TestNotifier.rspec?(content) ?
|
7
|
+
TestNotifier.rspec?(content) ?
|
8
|
+
TestNotifier.notification_for_rspec(content) :
|
9
|
+
TestNotifier.notification_for_test_unit(content)
|
8
10
|
rescue
|
9
11
|
end
|
10
12
|
end
|
File without changes
|
File without changes
|
File without changes
|
Binary file
|
data/lib/test_notifier.rb
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'snarl' if RUBY_PLATFORM =~ /mswin/
|
2
|
-
|
3
1
|
module TestNotifier
|
4
2
|
# create a .test_notifier at your home
|
5
3
|
# directory and save the images as passed.png,
|
@@ -13,21 +11,65 @@ module TestNotifier
|
|
13
11
|
RSPEC_REGEX = /(\d+) examples?, (\d+) failures?(, (\d+) pendings?)?/
|
14
12
|
TEST_UNIT_REGEX = /(\d+)\stests,\s(\d+)\sassertions,\s(\d+)\sfailures,\s(\d+)\serrors/
|
15
13
|
|
14
|
+
GROWL_REGISTER_FILE = File.expand_path("~/.test_notifier-growl")
|
15
|
+
|
16
16
|
def self.notify(image, title, message)
|
17
17
|
image ||= "none.png"
|
18
18
|
|
19
|
-
custom_image = File.join(File.expand_path("~/.test_notifier"),
|
19
|
+
custom_image = File.join(File.expand_path("~/.test_notifier"), image)
|
20
20
|
image = File.exists?(custom_image) ? custom_image : File.join(File.dirname(__FILE__), "test_notifier", "icons", image)
|
21
21
|
|
22
22
|
if RUBY_PLATFORM =~ /darwin/
|
23
|
-
|
23
|
+
if `ps -Al | grep GrowlHelper` && `which growlnotify` && $? == 0
|
24
|
+
unless File.file?(GROWL_REGISTER_FILE)
|
25
|
+
script = File.dirname(__FILE__) + "/test_notifier/register-growl.scpt"
|
26
|
+
system "osascript #{script} > #{GROWL_REGISTER_FILE}"
|
27
|
+
end
|
28
|
+
|
29
|
+
system("growlnotify -n test_notifier --image #{image} -p 2 -m \"#{message}\" -t \"#{title}\"")
|
30
|
+
else
|
31
|
+
puts "No compatible popup notification system installed."
|
32
|
+
puts "Try installing these:\n* growl"
|
33
|
+
end
|
24
34
|
elsif RUBY_PLATFORM =~ /mswin/
|
25
|
-
|
26
|
-
|
27
|
-
|
35
|
+
begin
|
36
|
+
require 'snarl'
|
37
|
+
rescue LoadError
|
38
|
+
puts 'To be notified by a popup please install Snarl and a ruby gem "snarl".'
|
39
|
+
else
|
40
|
+
Snarl.show_message(title, message, image)
|
41
|
+
end
|
42
|
+
elsif RUBY_PLATFORM =~ /(linux|freebsd)/
|
43
|
+
# if osd_cat is avaible
|
44
|
+
if `which osd_cat` && $? == 0
|
45
|
+
color = case image
|
46
|
+
when /#{PASSED_IMAGE}/
|
47
|
+
'green'
|
48
|
+
when /#{FAILURE_IMAGE}/
|
49
|
+
'orange'
|
50
|
+
when /#{ERROR_IMAGE}/
|
51
|
+
'red'
|
52
|
+
else
|
53
|
+
'white'
|
54
|
+
end
|
55
|
+
OsdCat.send "#{title} \n #{message}", color
|
56
|
+
# if dcop server is running
|
57
|
+
elsif `ps -Al | grep dcop` && $? == 0
|
58
|
+
def self.knotify title, msg
|
59
|
+
system "dcop knotify default notify " +
|
60
|
+
"eventname \'#{title}\' \'#{msg}\' '' '' 16 2"
|
61
|
+
end
|
62
|
+
knotify title, message
|
63
|
+
# if notify-send is avaible
|
64
|
+
elsif `which notify-send` && $? == 0
|
65
|
+
system("notify-send -i #{image} #{title} \"#{message}\"")
|
66
|
+
else
|
67
|
+
puts "No popup notification software installed."
|
68
|
+
puts "Try installing one of this:\n * osd_cat (apt-get install xosd-bin),\n * knotify (use KDE),\n * notify-send (apt-get install libnotify-bin)"
|
69
|
+
end
|
28
70
|
end
|
29
71
|
end
|
30
|
-
|
72
|
+
|
31
73
|
def self.rspec?(content)
|
32
74
|
(RSPEC_REGEX =~ content)
|
33
75
|
end
|
@@ -76,3 +118,26 @@ module TestNotifier
|
|
76
118
|
notify(image, title, message)
|
77
119
|
end
|
78
120
|
end
|
121
|
+
|
122
|
+
# Provides a method for popup notifications using osd_cat
|
123
|
+
# Extracted from http://theadmin.org/articles/2008/2/10/fail-loudly-with-osd_cat-and-autotest
|
124
|
+
module OsdCat
|
125
|
+
# TODO move this module to a separate file
|
126
|
+
|
127
|
+
# Use xlsfonts to find the different fonts
|
128
|
+
FONT = "-bitstream-charter-bold-r-normal--33-240-100-100-p-206-iso8859-1"
|
129
|
+
|
130
|
+
# Will display the message on the top of the screen centered, adjust these numbers to suit.
|
131
|
+
POSITION = "top" # top|middle|bottom
|
132
|
+
POSITION_OFFSET = "0" # Pixels from position to display (think CSS margin)
|
133
|
+
ALIGN = "center" # left|right|center
|
134
|
+
|
135
|
+
def self.send msg, color='green'
|
136
|
+
osd_command = "echo #{msg.inspect} | osd_cat --font=#{FONT} --shadow=0 --pos=#{POSITION} -o #{POSITION_OFFSET} --delay=4 --outline=4 --align=#{ALIGN} -c #{color}"
|
137
|
+
|
138
|
+
# osd_cat blocks so start a new thread, otherwise Autotest will wait
|
139
|
+
Thread.new do
|
140
|
+
`#{osd_command}`
|
141
|
+
end
|
142
|
+
end
|
143
|
+
end
|
@@ -0,0 +1,34 @@
|
|
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
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: test_notifier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nando Vieira
|
@@ -9,59 +9,50 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2009-03-24 00:00:00 -03:00
|
13
13
|
default_executable:
|
14
|
-
dependencies:
|
15
|
-
|
16
|
-
|
17
|
-
|
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
|
18
28
|
executables: []
|
19
29
|
|
20
30
|
extensions: []
|
21
31
|
|
22
|
-
extra_rdoc_files:
|
23
|
-
|
24
|
-
- License.txt
|
25
|
-
- Manifest.txt
|
26
|
-
- README.txt
|
27
|
-
- website/index.txt
|
32
|
+
extra_rdoc_files: []
|
33
|
+
|
28
34
|
files:
|
35
|
+
- Rakefile
|
36
|
+
- test_notifier.gemspec
|
29
37
|
- History.txt
|
30
38
|
- License.txt
|
31
|
-
-
|
32
|
-
-
|
33
|
-
-
|
34
|
-
- config/hoe.rb
|
35
|
-
- config/requirements.rb
|
36
|
-
- lib/test_notifier.rb
|
37
|
-
- lib/test_notifier/test_unit.rb
|
39
|
+
- README.markdown
|
40
|
+
- TODO.txt
|
41
|
+
- lib/test_notifier
|
38
42
|
- lib/test_notifier/autotest.rb
|
39
|
-
- lib/test_notifier/
|
43
|
+
- lib/test_notifier/icons
|
40
44
|
- lib/test_notifier/icons/error.png
|
41
45
|
- lib/test_notifier/icons/failure.png
|
42
46
|
- lib/test_notifier/icons/passed.png
|
43
|
-
- lib/test_notifier/
|
44
|
-
-
|
45
|
-
-
|
46
|
-
-
|
47
|
-
|
48
|
-
|
49
|
-
- tasks/deployment.rake
|
50
|
-
- tasks/environment.rake
|
51
|
-
- tasks/website.rake
|
52
|
-
- test/test_helper.rb
|
53
|
-
- test/test_test_notifier.rb
|
54
|
-
- website/index.html
|
55
|
-
- website/index.txt
|
56
|
-
- website/javascripts/rounded_corners_lite.inc.js
|
57
|
-
- website/stylesheets/screen.css
|
58
|
-
- website/template.rhtml
|
59
|
-
has_rdoc: true
|
60
|
-
homepage: http://testnotifier.rubyforge.org
|
47
|
+
- lib/test_notifier/register-growl.scpt
|
48
|
+
- lib/test_notifier/rspec.rb
|
49
|
+
- lib/test_notifier/test_unit.rb
|
50
|
+
- lib/test_notifier.rb
|
51
|
+
has_rdoc: false
|
52
|
+
homepage: http://github.com/fnando/test_notifier
|
61
53
|
post_install_message:
|
62
|
-
rdoc_options:
|
63
|
-
|
64
|
-
- README.txt
|
54
|
+
rdoc_options: []
|
55
|
+
|
65
56
|
require_paths:
|
66
57
|
- lib
|
67
58
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -76,13 +67,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
76
67
|
- !ruby/object:Gem::Version
|
77
68
|
version: "0"
|
78
69
|
version:
|
79
|
-
requirements:
|
80
|
-
|
81
|
-
rubyforge_project:
|
82
|
-
rubygems_version: 1.
|
70
|
+
requirements:
|
71
|
+
- You'll need Growl (Mac OS X), Libnotify (Linux) or Snarl (Windows)
|
72
|
+
rubyforge_project:
|
73
|
+
rubygems_version: 1.3.1
|
83
74
|
signing_key:
|
84
75
|
specification_version: 2
|
85
|
-
summary: Display system notifications (dbus, growl and snarl) after running tests.
|
86
|
-
test_files:
|
87
|
-
|
88
|
-
- test/test_test_notifier.rb
|
76
|
+
summary: Display system notifications (dbus, growl and snarl) after running tests.
|
77
|
+
test_files: []
|
78
|
+
|
data/Manifest.txt
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
History.txt
|
2
|
-
License.txt
|
3
|
-
Manifest.txt
|
4
|
-
README.txt
|
5
|
-
Rakefile
|
6
|
-
config/hoe.rb
|
7
|
-
config/requirements.rb
|
8
|
-
lib/test_notifier.rb
|
9
|
-
lib/test_notifier/test_unit.rb
|
10
|
-
lib/test_notifier/autotest.rb
|
11
|
-
lib/test_notifier/rspec.rb
|
12
|
-
lib/test_notifier/icons/error.png
|
13
|
-
lib/test_notifier/icons/failure.png
|
14
|
-
lib/test_notifier/icons/passed.png
|
15
|
-
lib/test_notifier/version.rb
|
16
|
-
log/debug.log
|
17
|
-
script/destroy
|
18
|
-
script/generate
|
19
|
-
script/txt2html
|
20
|
-
setup.rb
|
21
|
-
tasks/deployment.rake
|
22
|
-
tasks/environment.rake
|
23
|
-
tasks/website.rake
|
24
|
-
test/test_helper.rb
|
25
|
-
test/test_test_notifier.rb
|
26
|
-
website/index.html
|
27
|
-
website/index.txt
|
28
|
-
website/javascripts/rounded_corners_lite.inc.js
|
29
|
-
website/stylesheets/screen.css
|
30
|
-
website/template.rhtml
|
data/README.txt
DELETED
@@ -1,44 +0,0 @@
|
|
1
|
-
Test Notifier
|
2
|
-
============
|
3
|
-
|
4
|
-
Inspired by
|
5
|
-
http://railstips.org/2007/7/23/autotest-growl-pass-fail-notifications
|
6
|
-
|
7
|
-
After using Growl notification, I decided to write my own plugin because I have
|
8
|
-
to work on Ubuntu and Mac OS X and I missed the notification on my Linux box.
|
9
|
-
This plugin works with Linux, Mac OS X and Windows. All you need to do is
|
10
|
-
install the specific notification library for your OS.
|
11
|
-
|
12
|
-
Instead of displaying lots of notifications for each failure, I prefer to be
|
13
|
-
notified about the whole test result (you'll have to check your log
|
14
|
-
file anyway in order to clean up the failures/errors).
|
15
|
-
|
16
|
-
Author: Nando Vieira <http://simplesideias.com.br/>
|
17
|
-
|
18
|
-
Installation
|
19
|
-
------------
|
20
|
-
|
21
|
-
Mac OS X
|
22
|
-
1) Install Growl (http://growl.info/)
|
23
|
-
Install the growlnotify script located on the "Extras" directory
|
24
|
-
|
25
|
-
Linux
|
26
|
-
1) Install libnotify-bin ant its dependencies:
|
27
|
-
aptitude install libnotify-bin
|
28
|
-
|
29
|
-
Windows
|
30
|
-
1) Install Snarl:
|
31
|
-
Download from http://www.fullphat.net/
|
32
|
-
2) Install ruby-snarl:
|
33
|
-
gem install ruby-snarl
|
34
|
-
|
35
|
-
Usage
|
36
|
-
-----
|
37
|
-
If you're using Test::Unit you should add `require "test_notifier/test_unit"`
|
38
|
-
If you're using RSpec you should add `require "test_notifier/rspec"`
|
39
|
-
If you're using Autotest you should add `require "test_notifier/autotest"` to the file `~/.autotest`
|
40
|
-
|
41
|
-
--
|
42
|
-
Found this useful? Consider a donation (any amount):
|
43
|
-
Paypal: fnando dot vieira at gmail dot com
|
44
|
-
|
data/config/hoe.rb
DELETED
@@ -1,72 +0,0 @@
|
|
1
|
-
require 'test_notifier/version'
|
2
|
-
|
3
|
-
AUTHOR = 'Nando Vieira' # can also be an array of Authors
|
4
|
-
EMAIL = "fnando.vieira@gmail.com"
|
5
|
-
DESCRIPTION = "Display system notifications (dbus, growl and snarl) after \
|
6
|
-
running tests. It works on Mac OS X, Linux and Windows. Powerful when used \
|
7
|
-
with Autotest ZenTest gem for Rails apps."
|
8
|
-
GEM_NAME = 'test_notifier' # what ppl will type to install your gem
|
9
|
-
RUBYFORGE_PROJECT = 'testnotifier' # The unix name for your project
|
10
|
-
HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
|
11
|
-
DOWNLOAD_PATH = "http://rubyforge.org/projects/#{RUBYFORGE_PROJECT}"
|
12
|
-
|
13
|
-
@config_file = "~/.rubyforge/user-config.yml"
|
14
|
-
@config = nil
|
15
|
-
RUBYFORGE_USERNAME = "unknown"
|
16
|
-
def rubyforge_username
|
17
|
-
unless @config
|
18
|
-
begin
|
19
|
-
@config = YAML.load(File.read(File.expand_path(@config_file)))
|
20
|
-
rescue
|
21
|
-
puts <<-EOS
|
22
|
-
ERROR: No rubyforge config file found: #{@config_file}
|
23
|
-
Run 'rubyforge setup' to prepare your env for access to Rubyforge
|
24
|
-
- See http://newgem.rubyforge.org/rubyforge.html for more details
|
25
|
-
EOS
|
26
|
-
exit
|
27
|
-
end
|
28
|
-
end
|
29
|
-
RUBYFORGE_USERNAME.replace @config["username"]
|
30
|
-
end
|
31
|
-
|
32
|
-
|
33
|
-
REV = nil
|
34
|
-
# UNCOMMENT IF REQUIRED:
|
35
|
-
# REV = `svn info`.each {|line| if line =~ /^Revision:/ then k,v = line.split(': '); break v.chomp; else next; end} rescue nil
|
36
|
-
VERS = TestNotifier::VERSION::STRING + (REV ? ".#{REV}" : "")
|
37
|
-
RDOC_OPTS = ['--quiet', '--title', 'test_notifier documentation',
|
38
|
-
"--opname", "index.html",
|
39
|
-
"--line-numbers",
|
40
|
-
"--main", "README",
|
41
|
-
"--inline-source"]
|
42
|
-
|
43
|
-
class Hoe
|
44
|
-
def extra_deps
|
45
|
-
@extra_deps.reject! { |x| Array(x).first == 'hoe' }
|
46
|
-
@extra_deps
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
# Generate all the Rake tasks
|
51
|
-
# Run 'rake -T' to see list of generated tasks (from gem root directory)
|
52
|
-
hoe = Hoe.new(GEM_NAME, VERS) do |p|
|
53
|
-
p.author = AUTHOR
|
54
|
-
p.description = DESCRIPTION
|
55
|
-
p.email = EMAIL
|
56
|
-
p.summary = DESCRIPTION
|
57
|
-
p.url = HOMEPATH
|
58
|
-
p.rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT
|
59
|
-
p.test_globs = ["test/**/test_*.rb"]
|
60
|
-
p.clean_globs |= ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store'] #An array of file patterns to delete on clean.
|
61
|
-
|
62
|
-
# == Optional
|
63
|
-
p.changes = p.paragraphs_of("History.txt", 0..1).join("\\n\\n")
|
64
|
-
#p.extra_deps = [] # An array of rubygem dependencies [name, version], e.g. [ ['active_support', '>= 1.3.1'] ]
|
65
|
-
|
66
|
-
#p.spec_extras = {} # A hash of extra values to set in the gemspec.
|
67
|
-
|
68
|
-
end
|
69
|
-
|
70
|
-
CHANGES = hoe.paragraphs_of('History.txt', 0..1).join("\\n\\n")
|
71
|
-
PATH = (RUBYFORGE_PROJECT == GEM_NAME) ? RUBYFORGE_PROJECT : "#{RUBYFORGE_PROJECT}/#{GEM_NAME}"
|
72
|
-
hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}\/?/,''), 'rdoc')
|
data/config/requirements.rb
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
require 'fileutils'
|
2
|
-
include FileUtils
|
3
|
-
|
4
|
-
require 'rubygems'
|
5
|
-
%w[rake hoe newgem rubigen].each do |req_gem|
|
6
|
-
begin
|
7
|
-
require req_gem
|
8
|
-
rescue LoadError
|
9
|
-
puts "This Rakefile requires the '#{req_gem}' RubyGem."
|
10
|
-
puts "Installation: gem install #{req_gem} -y"
|
11
|
-
exit
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
$:.unshift(File.join(File.dirname(__FILE__), %w[.. lib]))
|
16
|
-
|
17
|
-
require 'test_notifier'
|