riot_notifier 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1,5 +1,7 @@
1
+ Gemfile.lock
1
2
  doc
2
3
  pkg
3
4
  coverage
4
5
  tags
5
6
  .bundle
7
+ .yardoc
data/.rvmrc CHANGED
@@ -1,2 +1 @@
1
- rvm gemset create riot_notifier
2
- rvm gemset use riot_notifier
1
+ rvm @riot_notifier --create
data/Gemfile CHANGED
@@ -1,12 +1,3 @@
1
- source "http://rubygems.org"
1
+ source :rubygems
2
2
 
3
- # Update Rakefile when changing version
4
- # TODO: Use bundler in Rakefile (jeweler)
5
-
6
- gem "jeweler"
7
- gem "riot", "~> 0.11.0"
8
- gem "riot_notifier"
9
-
10
- group :test do
11
- gem "libnotify", "~> 0.2.0"
12
- end
3
+ gemspec
data/Rakefile CHANGED
@@ -1,34 +1,10 @@
1
- require 'rake'
2
-
3
- begin
4
- require 'jeweler'
5
- Jeweler::Tasks.new do |gem|
6
- gem.name = "riot_notifier"
7
- gem.summary = 'Simple notifier for riot'
8
- gem.email = "peter-riot_notifier@suschlik.de"
9
- gem.homepage = "http://github.com/splattael/riot_notifier"
10
- gem.authors = ["Peter Suschlik"]
11
-
12
- gem.has_rdoc = true
13
- gem.extra_rdoc_files = [ "README.rdoc" ]
14
-
15
- # TODO Use Gemfile!
16
- gem.add_dependency "riot", "~> 0.11.0"
17
- gem.add_development_dependency "riot_notifier"
18
- gem.add_development_dependency "libnotify", "~> 0.2.0"
19
-
20
- gem.test_files = Dir.glob('test/test_*.rb')
21
- end
22
- Jeweler::GemcutterTasks.new
23
- rescue LoadError
24
- puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
25
- end
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
26
3
 
27
4
  # Test
28
5
  require 'rake/testtask'
29
6
  desc 'Default: run unit tests.'
30
7
  task :default => :test
31
- task :test => :check_dependencies
32
8
 
33
9
  Rake::TestTask.new(:test) do |test|
34
10
  test.test_files = FileList.new('test/test_*.rb')
@@ -36,15 +12,18 @@ Rake::TestTask.new(:test) do |test|
36
12
  test.verbose = true
37
13
  end
38
14
 
39
- # RDoc
40
- require 'rake/rdoctask'
41
- Rake::RDocTask.new do |rd|
42
- rd.title = "Riot Notifier"
43
- rd.main = "README.rdoc"
44
- rd.rdoc_files.include("README.rdoc", "lib/*.rb")
45
- rd.rdoc_dir = "doc"
15
+ # Yard
16
+ begin
17
+ require 'yard'
18
+ YARD::Rake::YardocTask.new
19
+ rescue LoadError
20
+ task :yardoc do
21
+ abort "YARD is not available. In order to run yardoc, you must: sudo gem install yard"
22
+ end
46
23
  end
47
24
 
25
+ desc "Alias for `rake yard`"
26
+ task :doc => :yard
48
27
 
49
28
  # Misc
50
29
  desc "Tag files for vim"
data/lib/riot_notifier.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'riot'
2
2
 
3
+ require 'riot_notifier/version'
3
4
  require 'riot_notifier/ext'
4
5
  require 'riot_notifier/module'
5
6
  require 'riot_notifier/base'
@@ -2,15 +2,26 @@
2
2
  module RiotNotifier
3
3
 
4
4
  class Libnotify < Base
5
+ ICON = {
6
+ :green => %w[
7
+ /usr/share/icons/gnome/scalable/emblems/emblem-default.svg
8
+ /usr/share/icons/gnome/256x256/emotes/face-laugh.png
9
+ ],
10
+ :red => %w[
11
+ /usr/share/icons/gnome/scalable/emotes/face-angry.svg
12
+ /usr/share/icons/gnome/256x256/emotes/face-angry.png
13
+ ]
14
+ }
15
+
5
16
  OPTIONS = {
6
17
  :green => {
7
- :icon_path => "/usr/share/icons/gnome/scalable/emblems/emblem-default.svg",
18
+ :icon_path => ICON[:green].find { |path| File.exist?(path) },
8
19
  :timeout => 2.5,
9
20
  :urgency => :normal,
10
21
  :summary => ":-)"
11
22
  },
12
23
  :red => {
13
- :icon_path => "/usr/share/icons/gnome/scalable/emotes/face-angry.svg",
24
+ :icon_path => ICON[:red].find { |path| File.exist?(path) },
14
25
  :timeout => 2.5,
15
26
  :urgency => :critical,
16
27
  :summary => ":-("
@@ -0,0 +1,3 @@
1
+ module RiotNotifier
2
+ VERSION = "0.4.0"
3
+ end
@@ -1,65 +1,24 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
1
+
4
2
  # -*- encoding: utf-8 -*-
3
+ $:.push File.expand_path("../lib", __FILE__)
4
+ require "riot_notifier/version"
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = %q{riot_notifier}
8
- s.version = "0.3.0"
7
+ s.name = "riot_notifier"
8
+ s.version = RiotNotifier::VERSION
9
+ s.platform = Gem::Platform::RUBY
10
+ s.authors = ["Peter Suschlik"]
11
+ s.email = ["peter-riot_notifier@suschlik.de"]
12
+ s.homepage = "http://rubygems.org/gems/riot_notifier"
13
+ s.summary = %q{Simple notifier for riot}
9
14
 
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Peter Suschlik"]
12
- s.date = %q{2010-08-24}
13
- s.email = %q{peter-riot_notifier@suschlik.de}
14
- s.extra_rdoc_files = [
15
- "README.rdoc"
16
- ]
17
- s.files = [
18
- ".gitignore",
19
- ".rvmrc",
20
- ".watchr",
21
- "Gemfile",
22
- "Gemfile.lock",
23
- "README.rdoc",
24
- "Rakefile",
25
- "VERSION",
26
- "lib/riot_notifier.rb",
27
- "lib/riot_notifier/base.rb",
28
- "lib/riot_notifier/ext.rb",
29
- "lib/riot_notifier/libnotify.rb",
30
- "lib/riot_notifier/module.rb",
31
- "lib/riot_notifier/none.rb",
32
- "lib/riot_notifier/redgreen_binary.rb",
33
- "riot_notifier.gemspec",
34
- "test/helper.rb",
35
- "test/test_riot_notifier.rb"
36
- ]
37
- s.homepage = %q{http://github.com/splattael/riot_notifier}
38
- s.rdoc_options = ["--charset=UTF-8"]
15
+ s.files = `git ls-files`.split("\n")
16
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
17
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
39
18
  s.require_paths = ["lib"]
40
- s.rubygems_version = %q{1.3.7}
41
- s.summary = %q{Simple notifier for riot}
42
- s.test_files = [
43
- "test/test_riot_notifier.rb"
44
- ]
45
19
 
46
- if s.respond_to? :specification_version then
47
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
48
- s.specification_version = 3
20
+ s.add_development_dependency('yard')
49
21
 
50
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
51
- s.add_runtime_dependency(%q<riot>, ["~> 0.11.0"])
52
- s.add_development_dependency(%q<riot_notifier>, [">= 0"])
53
- s.add_development_dependency(%q<libnotify>, ["~> 0.2.0"])
54
- else
55
- s.add_dependency(%q<riot>, ["~> 0.11.0"])
56
- s.add_dependency(%q<riot_notifier>, [">= 0"])
57
- s.add_dependency(%q<libnotify>, ["~> 0.2.0"])
58
- end
59
- else
60
- s.add_dependency(%q<riot>, ["~> 0.11.0"])
61
- s.add_dependency(%q<riot_notifier>, [">= 0"])
62
- s.add_dependency(%q<libnotify>, ["~> 0.2.0"])
63
- end
22
+ s.add_runtime_dependency('riot', "~> 0.11.0")
23
+ s.add_runtime_dependency('libnotify', "~> 0.2.0")
64
24
  end
65
-
@@ -100,4 +100,9 @@ context "RiotNotifier" do
100
100
  asserts("escape <") { topic.notify(:red, "<Topic>") }.matches(/&lt;Topic>/)
101
101
  asserts("quote double quotes") { topic.notify(:red, %{"errored"}) }.matches(/\\"errored\\"/)
102
102
  end
103
+
104
+ context "version" do
105
+ setup { RiotNotifier::VERSION }
106
+ asserts_topic.matches(/\d+\.\d+\.\d+/)
107
+ end
103
108
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: riot_notifier
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 15
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 3
8
+ - 4
9
9
  - 0
10
- version: 0.3.0
10
+ version: 0.4.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Peter Suschlik
@@ -15,38 +15,38 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-08-24 00:00:00 +02:00
18
+ date: 2011-04-23 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
- name: riot
22
+ name: yard
23
23
  prerelease: false
24
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
25
  none: false
26
26
  requirements:
27
- - - ~>
27
+ - - ">="
28
28
  - !ruby/object:Gem::Version
29
- hash: 51
29
+ hash: 3
30
30
  segments:
31
31
  - 0
32
- - 11
33
- - 0
34
- version: 0.11.0
35
- type: :runtime
32
+ version: "0"
33
+ type: :development
36
34
  version_requirements: *id001
37
35
  - !ruby/object:Gem::Dependency
38
- name: riot_notifier
36
+ name: riot
39
37
  prerelease: false
40
38
  requirement: &id002 !ruby/object:Gem::Requirement
41
39
  none: false
42
40
  requirements:
43
- - - ">="
41
+ - - ~>
44
42
  - !ruby/object:Gem::Version
45
- hash: 3
43
+ hash: 51
46
44
  segments:
47
45
  - 0
48
- version: "0"
49
- type: :development
46
+ - 11
47
+ - 0
48
+ version: 0.11.0
49
+ type: :runtime
50
50
  version_requirements: *id002
51
51
  - !ruby/object:Gem::Dependency
52
52
  name: libnotify
@@ -62,22 +62,22 @@ dependencies:
62
62
  - 2
63
63
  - 0
64
64
  version: 0.2.0
65
- type: :development
65
+ type: :runtime
66
66
  version_requirements: *id003
67
67
  description:
68
- email: peter-riot_notifier@suschlik.de
68
+ email:
69
+ - peter-riot_notifier@suschlik.de
69
70
  executables: []
70
71
 
71
72
  extensions: []
72
73
 
73
- extra_rdoc_files:
74
- - README.rdoc
74
+ extra_rdoc_files: []
75
+
75
76
  files:
76
77
  - .gitignore
77
78
  - .rvmrc
78
79
  - .watchr
79
80
  - Gemfile
80
- - Gemfile.lock
81
81
  - README.rdoc
82
82
  - Rakefile
83
83
  - VERSION
@@ -88,16 +88,17 @@ files:
88
88
  - lib/riot_notifier/module.rb
89
89
  - lib/riot_notifier/none.rb
90
90
  - lib/riot_notifier/redgreen_binary.rb
91
+ - lib/riot_notifier/version.rb
91
92
  - riot_notifier.gemspec
92
93
  - test/helper.rb
93
94
  - test/test_riot_notifier.rb
94
95
  has_rdoc: true
95
- homepage: http://github.com/splattael/riot_notifier
96
+ homepage: http://rubygems.org/gems/riot_notifier
96
97
  licenses: []
97
98
 
98
99
  post_install_message:
99
- rdoc_options:
100
- - --charset=UTF-8
100
+ rdoc_options: []
101
+
101
102
  require_paths:
102
103
  - lib
103
104
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -126,4 +127,5 @@ signing_key:
126
127
  specification_version: 3
127
128
  summary: Simple notifier for riot
128
129
  test_files:
130
+ - test/helper.rb
129
131
  - test/test_riot_notifier.rb
data/Gemfile.lock DELETED
@@ -1,47 +0,0 @@
1
- ---
2
- dependencies:
3
- libnotify:
4
- group:
5
- - :test
6
- version: ~> 0.2.0
7
- jeweler:
8
- group:
9
- - :default
10
- version: ">= 0"
11
- riot_notifier:
12
- group:
13
- - :default
14
- version: ">= 0"
15
- riot:
16
- group:
17
- - :default
18
- version: ~> 0.11.0
19
- specs:
20
- - rake:
21
- version: 0.8.7
22
- - ffi:
23
- version: 0.6.3
24
- - gemcutter:
25
- version: 0.6.1
26
- - git:
27
- version: 1.2.5
28
- - json_pure:
29
- version: 1.4.6
30
- - rubyforge:
31
- version: 2.0.4
32
- - jeweler:
33
- version: 1.4.0
34
- - libnotify:
35
- version: 0.2.0
36
- - rr:
37
- version: 1.0.0
38
- - term-ansicolor:
39
- version: 1.0.5
40
- - riot:
41
- version: 0.11.3
42
- - riot_notifier:
43
- version: 0.2.0
44
- hash: a92e357b98e61ed637d518ddbe08484869671c28
45
- sources:
46
- - Rubygems:
47
- uri: http://rubygems.org