rnotify 0.1 → 0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,9 @@
1
+ README.md
2
+ Rakefile
3
+ lib/adapters/cucumber.rb
4
+ lib/adapters/logger.rb
5
+ lib/adapters/rspec.rb
6
+ lib/resources/warn.png
7
+ lib/rnotify.rb
8
+ rnotify.gemspec
9
+ Manifest
data/README.md CHANGED
@@ -4,12 +4,48 @@ This small gem is supposed to be used on Ubuntu only (for now). It's actually wo
4
4
 
5
5
  * Results of running rspec/cucumber/test::unit test suits
6
6
 
7
- In order to use it you need to make sure you have a 'notify-bin' package installed:
7
+ ## 2 possible notifications styles
8
+
9
+ ### New Ubuntu style:
10
+
11
+ ![rnotify screenshot](http://germaninthetown.com/rnotify_screenshot.png)
12
+
13
+ In order to use it you just need to make sure you have a 'libnotify-bin' package installed:
14
+
15
+ ```sh
16
+ $ sudo apt-get install libnotify-bin
17
+ ```
18
+
19
+ ### Old Ubuntu style (preferred, since it supports stacking of messages):
20
+
21
+ ![rnotify screenshot with notification-daemon](http://germaninthetown.com/rnotify_screenshot2.png)
22
+
23
+ if you already have notify-osd installed:
8
24
 
9
25
  ```sh
10
- sudo apt-get install notify-bin
26
+ $ sudo apt-get install notification-daemon
27
+ $ sudo mv /usr/lib/notify-osd/notify-osd /usr/lib/notify-osd/notify-osd-original
28
+ $ sudo killall notify-osd
29
+ $ sudo ln -s /usr/lib/notification-daemon/notification-daemon /usr/lib/notify-osd/notify-osd
11
30
  ```
12
31
 
32
+ otherwise:
33
+
34
+ ```sh
35
+ $ sudo apt-get install notification-daemon
36
+ $ sudo ln -s /usr/lib/notification-daemon/notification-daemon /usr/lib/notify-osd/notify-osd
37
+ ```
38
+
39
+ Then you could change the look-and-feel of notification window if you want:
40
+
41
+ ```sh
42
+ $ notification-properties
43
+ ```
44
+
45
+ ![customizing old notifications style and position](http://germaninthetown.com/rnotify_screenshot3.png)
46
+
47
+ ## Installing
48
+
13
49
  then just add this line to your Gemfile:
14
50
 
15
51
  ```ruby
@@ -24,7 +60,8 @@ bundle install
24
60
 
25
61
  TODO:
26
62
 
27
- * messages merging
63
+ * add minitest adapter
64
+ * messages merging [done - only possible with old ubuntu *notification-daemon* library]
28
65
  * more icons
29
66
 
30
67
  Copyright © 2011 Dmitrii Samoilov, released under the MIT license
@@ -0,0 +1,18 @@
1
+ #require 'psych'
2
+ require 'rubygems'
3
+ require 'rake'
4
+
5
+ require 'echoe'
6
+
7
+ Echoe.new('rnotify', '0.2') do |p|
8
+ p.description = "Using NotifyOSD system in Ubuntu to display Rails logger messages and TDD/BDD messages"
9
+ p.url = "https://github.com/german/rnotify"
10
+ p.author = "Dmitrii Samoilov"
11
+ p.email = "germaninthetown@gmail.com"
12
+ p.dependencies = ["activesupport >=3.0.0", "rspec-rails >=2.7.0"]
13
+ end
14
+
15
+
16
+ #require 'rake/testtask'
17
+ #$LOAD_PATH << File.join(File.dirname(__FILE__), 'lib')
18
+
@@ -0,0 +1,31 @@
1
+ if respond_to?(:After)
2
+ $failed_cucumber_specs = 0
3
+
4
+ After do |scenario|
5
+ if(scenario.failed?)
6
+ $failed_cucumber_specs += 1
7
+ `notify-send "Cucumber: #{scenario.exception.class}", "#{scenario.exception.message.gsub(/"/, "'")}"`
8
+ end
9
+ end
10
+ end
11
+
12
+ at_exit do
13
+ # test global variable: it's set only if cucumber is loaded (Object responds_to? :After message)
14
+ if $failed_cucumber_specs
15
+ if $failed_cucumber_specs == 0
16
+ `notify-send "Cucumber: no failed specs", "No failed specs"`
17
+ else
18
+ `notify-send "Cucumber: #{$failed_cucumber_specs} failed specs", "#{$failed_cucumber_specs} failed specs"`
19
+ end
20
+ end
21
+ end
22
+
23
+
24
+ require 'cucumber/formatter/pretty'
25
+
26
+ class NotifyOSDCucumberFormatter < Cucumber::Formatter::Pretty
27
+ def exception(exception, status)
28
+ super(exception, status)
29
+ `notify-send "Cucumber: #{exception.class}", "#{exception.message.gsub(/("|`)/, "'")}"`
30
+ end
31
+ end
@@ -6,3 +6,4 @@ require 'rspec/core/formatters/progress_formatter'
6
6
 
7
7
  require File.join(File.dirname(__FILE__), 'adapters', 'logger').to_s
8
8
  require File.join(File.dirname(__FILE__), 'adapters', 'rspec').to_s
9
+ require File.join(File.dirname(__FILE__), 'adapters', 'cucumber').to_s
@@ -0,0 +1,35 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = "rnotify"
5
+ s.version = "0.2"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["Dmitrii Samoilov"]
9
+ s.date = "2012-02-14"
10
+ s.description = "Using NotifyOSD system in Ubuntu to display Rails logger messages and TDD/BDD messages"
11
+ s.email = "germaninthetown@gmail.com"
12
+ s.extra_rdoc_files = ["README.md", "lib/adapters/cucumber.rb", "lib/adapters/logger.rb", "lib/adapters/rspec.rb", "lib/resources/warn.png", "lib/rnotify.rb"]
13
+ s.files = ["README.md", "Rakefile", "lib/adapters/cucumber.rb", "lib/adapters/logger.rb", "lib/adapters/rspec.rb", "lib/resources/warn.png", "lib/rnotify.rb", "rnotify.gemspec", "Manifest"]
14
+ s.homepage = "https://github.com/german/rnotify"
15
+ s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Rnotify", "--main", "README.md"]
16
+ s.require_paths = ["lib"]
17
+ s.rubyforge_project = "rnotify"
18
+ s.rubygems_version = "1.8.15"
19
+ s.summary = "Using NotifyOSD system in Ubuntu to display Rails logger messages and TDD/BDD messages"
20
+
21
+ if s.respond_to? :specification_version then
22
+ s.specification_version = 3
23
+
24
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
25
+ s.add_runtime_dependency(%q<activesupport>, [">= 3.0.0"])
26
+ s.add_runtime_dependency(%q<rspec-rails>, [">= 2.7.0"])
27
+ else
28
+ s.add_dependency(%q<activesupport>, [">= 3.0.0"])
29
+ s.add_dependency(%q<rspec-rails>, [">= 2.7.0"])
30
+ end
31
+ else
32
+ s.add_dependency(%q<activesupport>, [">= 3.0.0"])
33
+ s.add_dependency(%q<rspec-rails>, [">= 2.7.0"])
34
+ end
35
+ end
metadata CHANGED
@@ -1,12 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rnotify
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 1
9
- version: "0.1"
8
+ - 2
9
+ version: "0.2"
10
10
  platform: ruby
11
11
  authors:
12
12
  - Dmitrii Samoilov
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-12-22 00:00:00 Z
17
+ date: 2012-02-14 00:00:00 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: activesupport
@@ -56,21 +56,32 @@ extensions: []
56
56
 
57
57
  extra_rdoc_files:
58
58
  - README.md
59
- - lib/rnotify.rb
59
+ - lib/adapters/cucumber.rb
60
60
  - lib/adapters/logger.rb
61
61
  - lib/adapters/rspec.rb
62
+ - lib/resources/warn.png
63
+ - lib/rnotify.rb
62
64
  files:
63
65
  - README.md
64
- - lib/rnotify.rb
66
+ - Rakefile
67
+ - lib/adapters/cucumber.rb
65
68
  - lib/adapters/logger.rb
66
69
  - lib/adapters/rspec.rb
67
70
  - lib/resources/warn.png
71
+ - lib/rnotify.rb
72
+ - rnotify.gemspec
73
+ - Manifest
68
74
  homepage: https://github.com/german/rnotify
69
75
  licenses: []
70
76
 
71
77
  post_install_message:
72
- rdoc_options: []
73
-
78
+ rdoc_options:
79
+ - --line-numbers
80
+ - --inline-source
81
+ - --title
82
+ - Rnotify
83
+ - --main
84
+ - README.md
74
85
  require_paths:
75
86
  - lib
76
87
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -95,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
106
  requirements: []
96
107
 
97
108
  rubyforge_project: rnotify
98
- rubygems_version: 1.8.6
109
+ rubygems_version: 1.8.15
99
110
  signing_key:
100
111
  specification_version: 3
101
112
  summary: Using NotifyOSD system in Ubuntu to display Rails logger messages and TDD/BDD messages