minitest-libnotify 0.0.1
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/.gitignore +4 -0
- data/Gemfile +4 -0
- data/README.rdoc +27 -0
- data/Rakefile +1 -0
- data/lib/minitest/libnotify.rb +50 -0
- data/minitest-libnotify.gemspec +23 -0
- metadata +73 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/README.rdoc
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
= minitest-libnotify
|
2
|
+
|
3
|
+
Test notifier for minitest via libnotify.
|
4
|
+
|
5
|
+
Source[http://github.com/splattael/minitest-libnotify] |
|
6
|
+
RDoc[http://rdoc.info/github/splattael/minitest-libnotify/master/file/README.rdoc]
|
7
|
+
|
8
|
+
== Usage
|
9
|
+
|
10
|
+
require 'minitest/autorun'
|
11
|
+
require 'minitest/libnotify'
|
12
|
+
|
13
|
+
== Installation
|
14
|
+
|
15
|
+
gem install minitest-libnotify
|
16
|
+
|
17
|
+
== Authors
|
18
|
+
|
19
|
+
* Peter Suschlik (http://github.com/splattael)
|
20
|
+
|
21
|
+
== License
|
22
|
+
|
23
|
+
MIT License[http://www.opensource.org/licenses/mit-license.php]
|
24
|
+
|
25
|
+
== TODO
|
26
|
+
|
27
|
+
* Write tests
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,50 @@
|
|
1
|
+
require 'minitest/unit'
|
2
|
+
require 'libnotify'
|
3
|
+
|
4
|
+
module MiniTest
|
5
|
+
# Test notifier for minitest via libnotify.
|
6
|
+
#
|
7
|
+
# == Usage
|
8
|
+
#
|
9
|
+
# In your test helper put:
|
10
|
+
#
|
11
|
+
# require 'minitest/autorun'
|
12
|
+
# require 'minitest/libnotify'
|
13
|
+
#
|
14
|
+
class Libnotify
|
15
|
+
VERSION = "0.0.1"
|
16
|
+
|
17
|
+
def initialize io
|
18
|
+
@io = io
|
19
|
+
@libnotify = begin
|
20
|
+
require 'libnotify'
|
21
|
+
::Libnotify.new(:timeout => 2.5, :append => false)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def puts(*o)
|
26
|
+
if o.first =~ /(\d+) failures, (\d+) errors/
|
27
|
+
description = [ defined?(RUBY_ENGINE) ? RUBY_ENGINE : "ruby", RUBY_VERSION, RUBY_PLATFORM ].join(" ")
|
28
|
+
@libnotify.body = o.first
|
29
|
+
if $1.to_i > 0 || $2.to_i > 0 # fail?
|
30
|
+
@libnotify.summary = ":-( #{description}"
|
31
|
+
@libnotify.urgency = :critical
|
32
|
+
@libnotify.icon_path = "face-angry.*"
|
33
|
+
else
|
34
|
+
@libnotify.summary += ":-) #{description}"
|
35
|
+
@libnotify.urgency = :normal
|
36
|
+
@libnotify.icon_path = "face-laugh.*"
|
37
|
+
end
|
38
|
+
@libnotify.show!
|
39
|
+
else
|
40
|
+
@io.puts(*o)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def method_missing(msg, *args, &block)
|
45
|
+
@io.send(msg, *args, &block)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
MiniTest::Unit.output = MiniTest::Libnotify.new(MiniTest::Unit.output)
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "minitest/libnotify"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "minitest-libnotify"
|
7
|
+
s.version = MiniTest::Libnotify::VERSION
|
8
|
+
s.authors = ["Peter Suschlik"]
|
9
|
+
s.email = ["peter-minitest-libnotify@suschlik.de"]
|
10
|
+
s.homepage = "https://github.com/splattael/minitest-libnotify"
|
11
|
+
s.summary = %q{Test notifier for minitest via libnotify.}
|
12
|
+
s.description = %q{Display graphical notfications when testing with minitest.}
|
13
|
+
|
14
|
+
s.rubyforge_project = "minitest-libnotify"
|
15
|
+
|
16
|
+
s.files = `git ls-files`.split("\n")
|
17
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
+
s.require_paths = ["lib"]
|
20
|
+
|
21
|
+
s.add_runtime_dependency 'minitest'
|
22
|
+
s.add_runtime_dependency 'libnotify'
|
23
|
+
end
|
metadata
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: minitest-libnotify
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Peter Suschlik
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2011-12-04 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: minitest
|
16
|
+
requirement: &76548840 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *76548840
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: libnotify
|
27
|
+
requirement: &76548480 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *76548480
|
36
|
+
description: Display graphical notfications when testing with minitest.
|
37
|
+
email:
|
38
|
+
- peter-minitest-libnotify@suschlik.de
|
39
|
+
executables: []
|
40
|
+
extensions: []
|
41
|
+
extra_rdoc_files: []
|
42
|
+
files:
|
43
|
+
- .gitignore
|
44
|
+
- Gemfile
|
45
|
+
- README.rdoc
|
46
|
+
- Rakefile
|
47
|
+
- lib/minitest/libnotify.rb
|
48
|
+
- minitest-libnotify.gemspec
|
49
|
+
homepage: https://github.com/splattael/minitest-libnotify
|
50
|
+
licenses: []
|
51
|
+
post_install_message:
|
52
|
+
rdoc_options: []
|
53
|
+
require_paths:
|
54
|
+
- lib
|
55
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
56
|
+
none: false
|
57
|
+
requirements:
|
58
|
+
- - ! '>='
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0'
|
61
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
62
|
+
none: false
|
63
|
+
requirements:
|
64
|
+
- - ! '>='
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: '0'
|
67
|
+
requirements: []
|
68
|
+
rubyforge_project: minitest-libnotify
|
69
|
+
rubygems_version: 1.8.10
|
70
|
+
signing_key:
|
71
|
+
specification_version: 3
|
72
|
+
summary: Test notifier for minitest via libnotify.
|
73
|
+
test_files: []
|