autotest-notifyosd 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.document +5 -0
- data/.gitignore +5 -0
- data/LICENSE +22 -0
- data/README.rdoc +20 -0
- data/Rakefile +58 -0
- data/VERSION +1 -0
- data/autotest-notifyosd.gemspec +56 -0
- data/bin/enable-autotest-notifyosd +8 -0
- data/lib/autotest-notifyosd.rb +2 -0
- data/lib/autotest/notify-osd.rb +38 -0
- data/test/autotest-notifyosd_test.rb +7 -0
- data/test/test_helper.rb +9 -0
- metadata +77 -0
data/.document
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2009 Scott Windsor
|
2
|
+
|
3
|
+
(The MIT License)
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
= autotest-notifyosd
|
2
|
+
|
3
|
+
Provides autotest notifications for
|
4
|
+
https://wiki.ubuntu.com/NotifyOSD
|
5
|
+
|
6
|
+
== Requirements
|
7
|
+
|
8
|
+
* ZenTest (to provide core autotest functionality)
|
9
|
+
* Ubuntu 9.04 or later (or notifyosd ported to another linux system)
|
10
|
+
* libnotify (can be install via apt-get)
|
11
|
+
|
12
|
+
== Install
|
13
|
+
* sudo gem install --source=http://gemcutter.org autotest-notifyosd
|
14
|
+
* enable-autotest-notifyosd
|
15
|
+
|
16
|
+
Note: --source=http://gemcutter.org not required if you already have gemcutter listed as a source
|
17
|
+
|
18
|
+
== Copyright
|
19
|
+
|
20
|
+
Copyright (c) 2009 Scott Windsor. See LICENSE for details.
|
data/Rakefile
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'jeweler'
|
6
|
+
Jeweler::Tasks.new do |gem|
|
7
|
+
gem.name = "autotest-notifyosd"
|
8
|
+
gem.summary = %Q{Provides autotest notifications for Ubuntu's NotifyOSD}
|
9
|
+
gem.email = "swindsor@gmail.com"
|
10
|
+
gem.homepage = "http://github.com/sentientmonkey/autotest-notifyosd"
|
11
|
+
gem.authors = ["Scott Windsor"]
|
12
|
+
gem.executables = ['enable-autotest-notifyosd']
|
13
|
+
gem.add_dependency('ZenTest', '>= 4.0.0')
|
14
|
+
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
15
|
+
end
|
16
|
+
Jeweler::GemcutterTasks.new
|
17
|
+
rescue LoadError
|
18
|
+
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
|
19
|
+
end
|
20
|
+
|
21
|
+
require 'rake/testtask'
|
22
|
+
Rake::TestTask.new(:test) do |test|
|
23
|
+
test.libs << 'lib' << 'test'
|
24
|
+
test.pattern = 'test/**/*_test.rb'
|
25
|
+
test.verbose = true
|
26
|
+
end
|
27
|
+
|
28
|
+
begin
|
29
|
+
require 'rcov/rcovtask'
|
30
|
+
Rcov::RcovTask.new do |test|
|
31
|
+
test.libs << 'test'
|
32
|
+
test.pattern = 'test/**/*_test.rb'
|
33
|
+
test.verbose = true
|
34
|
+
end
|
35
|
+
rescue LoadError
|
36
|
+
task :rcov do
|
37
|
+
abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
|
42
|
+
task :default => :test
|
43
|
+
|
44
|
+
require 'rake/rdoctask'
|
45
|
+
Rake::RDocTask.new do |rdoc|
|
46
|
+
if File.exist?('VERSION.yml')
|
47
|
+
config = YAML.load(File.read('VERSION.yml'))
|
48
|
+
version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
|
49
|
+
else
|
50
|
+
version = ""
|
51
|
+
end
|
52
|
+
|
53
|
+
rdoc.rdoc_dir = 'rdoc'
|
54
|
+
rdoc.title = "autotest-notifyosd #{version}"
|
55
|
+
rdoc.rdoc_files.include('README*')
|
56
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
57
|
+
end
|
58
|
+
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.3
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{autotest-notifyosd}
|
8
|
+
s.version = "0.0.3"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Scott Windsor"]
|
12
|
+
s.date = %q{2009-10-08}
|
13
|
+
s.default_executable = %q{enable-autotest-notifyosd}
|
14
|
+
s.email = %q{swindsor@gmail.com}
|
15
|
+
s.executables = ["enable-autotest-notifyosd"]
|
16
|
+
s.extra_rdoc_files = [
|
17
|
+
"LICENSE",
|
18
|
+
"README.rdoc"
|
19
|
+
]
|
20
|
+
s.files = [
|
21
|
+
".document",
|
22
|
+
".gitignore",
|
23
|
+
"LICENSE",
|
24
|
+
"README.rdoc",
|
25
|
+
"Rakefile",
|
26
|
+
"VERSION",
|
27
|
+
"autotest-notifyosd.gemspec",
|
28
|
+
"bin/enable-autotest-notifyosd",
|
29
|
+
"lib/autotest-notifyosd.rb",
|
30
|
+
"lib/autotest/notify-osd.rb",
|
31
|
+
"test/autotest-notifyosd_test.rb",
|
32
|
+
"test/test_helper.rb"
|
33
|
+
]
|
34
|
+
s.homepage = %q{http://github.com/sentientmonkey/autotest-notifyosd}
|
35
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
36
|
+
s.require_paths = ["lib"]
|
37
|
+
s.rubygems_version = %q{1.3.5}
|
38
|
+
s.summary = %q{Provides autotest notifications for Ubuntu's NotifyOSD}
|
39
|
+
s.test_files = [
|
40
|
+
"test/autotest-notifyosd_test.rb",
|
41
|
+
"test/test_helper.rb"
|
42
|
+
]
|
43
|
+
|
44
|
+
if s.respond_to? :specification_version then
|
45
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
46
|
+
s.specification_version = 3
|
47
|
+
|
48
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
49
|
+
s.add_runtime_dependency(%q<ZenTest>, [">= 4.0.0"])
|
50
|
+
else
|
51
|
+
s.add_dependency(%q<ZenTest>, [">= 4.0.0"])
|
52
|
+
end
|
53
|
+
else
|
54
|
+
s.add_dependency(%q<ZenTest>, [">= 4.0.0"])
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# -*- ruby -*-
|
2
|
+
|
3
|
+
module Autotest::NotifyOSD
|
4
|
+
|
5
|
+
def self.notify title, msg, urg = 'normal', img = nil
|
6
|
+
msg += " in #{Dir.pwd.split(/\//).last(3).join("/")}"
|
7
|
+
msg += " at #{Time.now.strftime('%Y-%m-%d %H:%M:%S')}"
|
8
|
+
# TODO: parameterize default image
|
9
|
+
img ||= '/usr/share/icons/Human/scalable/status/dialog-info.svg'
|
10
|
+
cmd = "notify-send -i #{img} -u #{urg} '#{title}' '#{msg}'"
|
11
|
+
system cmd
|
12
|
+
nil
|
13
|
+
end
|
14
|
+
|
15
|
+
Autotest.add_hook :initialize do |at|
|
16
|
+
notify "Autotest running", "Started"
|
17
|
+
end
|
18
|
+
|
19
|
+
Autotest.add_hook :run_command do |at|
|
20
|
+
notify "Tests running", "Testing", 'normal', "/usr/share/icons/Human/scalable/status/dialog-warning.svg" if at.tainted
|
21
|
+
end
|
22
|
+
|
23
|
+
Autotest.add_hook :red do |at|
|
24
|
+
notify "Tests Failed", "#{at.files_to_test.size} tests failed", "critical", "/usr/share/icons/Human/scalable/status/dialog-error.svg"
|
25
|
+
end
|
26
|
+
|
27
|
+
Autotest.add_hook :green do |at|
|
28
|
+
notify "Tests Passed", "Tests passed", "low" if at.tainted
|
29
|
+
end
|
30
|
+
|
31
|
+
Autotest.add_hook :all_good do |at|
|
32
|
+
notify "All Tests Passed", "All tests passed", "low" if at.tainted
|
33
|
+
end
|
34
|
+
|
35
|
+
Autotest.add_hook :quit do |at|
|
36
|
+
notify "autotest exiting", "Exiting"
|
37
|
+
end
|
38
|
+
end
|
data/test/test_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,77 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: autotest-notifyosd
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.3
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Scott Windsor
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-10-08 00:00:00 -07:00
|
13
|
+
default_executable: enable-autotest-notifyosd
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: ZenTest
|
17
|
+
type: :runtime
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 4.0.0
|
24
|
+
version:
|
25
|
+
description:
|
26
|
+
email: swindsor@gmail.com
|
27
|
+
executables:
|
28
|
+
- enable-autotest-notifyosd
|
29
|
+
extensions: []
|
30
|
+
|
31
|
+
extra_rdoc_files:
|
32
|
+
- LICENSE
|
33
|
+
- README.rdoc
|
34
|
+
files:
|
35
|
+
- .document
|
36
|
+
- .gitignore
|
37
|
+
- LICENSE
|
38
|
+
- README.rdoc
|
39
|
+
- Rakefile
|
40
|
+
- VERSION
|
41
|
+
- autotest-notifyosd.gemspec
|
42
|
+
- bin/enable-autotest-notifyosd
|
43
|
+
- lib/autotest-notifyosd.rb
|
44
|
+
- lib/autotest/notify-osd.rb
|
45
|
+
- test/autotest-notifyosd_test.rb
|
46
|
+
- test/test_helper.rb
|
47
|
+
has_rdoc: true
|
48
|
+
homepage: http://github.com/sentientmonkey/autotest-notifyosd
|
49
|
+
licenses: []
|
50
|
+
|
51
|
+
post_install_message:
|
52
|
+
rdoc_options:
|
53
|
+
- --charset=UTF-8
|
54
|
+
require_paths:
|
55
|
+
- lib
|
56
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: "0"
|
61
|
+
version:
|
62
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
63
|
+
requirements:
|
64
|
+
- - ">="
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: "0"
|
67
|
+
version:
|
68
|
+
requirements: []
|
69
|
+
|
70
|
+
rubyforge_project:
|
71
|
+
rubygems_version: 1.3.5
|
72
|
+
signing_key:
|
73
|
+
specification_version: 3
|
74
|
+
summary: Provides autotest notifications for Ubuntu's NotifyOSD
|
75
|
+
test_files:
|
76
|
+
- test/autotest-notifyosd_test.rb
|
77
|
+
- test/test_helper.rb
|