bdotdub-integrity-prowl 0.2.0

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 ADDED
@@ -0,0 +1,5 @@
1
+ README.rdoc
2
+ lib/**/*.rb
3
+ bin/*
4
+ features/**/*.feature
5
+ LICENSE
data/.gitignore ADDED
@@ -0,0 +1,5 @@
1
+ *.sw?
2
+ .DS_Store
3
+ coverage
4
+ rdoc
5
+ pkg
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ (The MIT License)
2
+
3
+ Copyright (c) 2009 Matías Flores
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 NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.markdown ADDED
@@ -0,0 +1,46 @@
1
+ Integrity
2
+ =========
3
+
4
+ [Integrity][] is your friendly automated Continuous Integration server.
5
+
6
+ Integrity Prowl Notifier
7
+ ========================
8
+
9
+
10
+ Setup Instructions
11
+ ==================
12
+
13
+ Just install this gem via `sudo gem install bdotdub-integrity-prowl` and then in your
14
+ Rackup (ie, `config.ru`) file:
15
+
16
+ require "rubygems"
17
+ require "integrity/notifier/prowl"
18
+
19
+ License
20
+ =======
21
+
22
+ (The MIT License)
23
+
24
+ Copyright (c) 2009 [Matías Flores][matflores]
25
+
26
+ Permission is hereby granted, free of charge, to any person obtaining
27
+ a copy of this software and associated documentation files (the
28
+ 'Software'), to deal in the Software without restriction, including
29
+ without limitation the rights to use, copy, modify, merge, publish,
30
+ distribute, sublicense, and/or sell copies of the Software, and to
31
+ permit persons to whom the Software is furnished to do so, subject to
32
+ the following conditions:
33
+
34
+ The above copyright notice and this permission notice shall be
35
+ included in all copies or substantial portions of the Software.
36
+
37
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
38
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
39
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
40
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
41
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
42
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
43
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
44
+
45
+ [Integrity]: http://integrityapp.com
46
+ [Benny Wong]: http://bwong.net
data/README.rdoc ADDED
@@ -0,0 +1,7 @@
1
+ = integrity-prowl
2
+
3
+ A Prowl notifier for the Integrity continuous integration server.
4
+
5
+ == Copyright
6
+
7
+ Copyright (c) 2009 Benny Wong. See LICENSE for details.
data/Rakefile ADDED
@@ -0,0 +1,59 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ begin
5
+ require 'jeweler'
6
+ Jeweler::Tasks.new do |gem|
7
+ gem.name = "integrity-prowl"
8
+ gem.summary = "Prowl notifier for the Integrity continuous integration server"
9
+ gem.description = "Sends a notification from Integrity to Prowl after each build"
10
+ gem.email = "benny@bwong.net"
11
+ gem.homepage = "http://github.com/bdotdub/integrity-prowl"
12
+ gem.authors = ["Benny Wong"]
13
+ gem.add_dependency "integrity"
14
+ gem.add_dependency "prowl"
15
+ gem.rubyforge_project = "integrity"
16
+ end
17
+
18
+ rescue LoadError
19
+ puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
20
+ end
21
+
22
+ require 'rake/testtask'
23
+ Rake::TestTask.new(:test) do |test|
24
+ test.libs << 'lib' << 'test'
25
+ test.pattern = 'test/**/*_test.rb'
26
+ test.verbose = true
27
+ end
28
+
29
+ begin
30
+ require 'rcov/rcovtask'
31
+ Rcov::RcovTask.new do |test|
32
+ test.libs << 'test'
33
+ test.pattern = 'test/**/*_test.rb'
34
+ test.verbose = true
35
+ end
36
+ rescue LoadError
37
+ task :rcov do
38
+ abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
39
+ end
40
+ end
41
+
42
+
43
+ task :default => :test
44
+
45
+ require 'rake/rdoctask'
46
+ Rake::RDocTask.new do |rdoc|
47
+ if File.exist?('VERSION.yml')
48
+ config = YAML.load(File.read('VERSION.yml'))
49
+ version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
50
+ else
51
+ version = ""
52
+ end
53
+
54
+ rdoc.rdoc_dir = 'rdoc'
55
+ rdoc.title = "integrity-prowl #{version}"
56
+ rdoc.rdoc_files.include('README*')
57
+ rdoc.rdoc_files.include('lib/**/*.rb')
58
+ end
59
+
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.2.0
@@ -0,0 +1,60 @@
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{integrity-prowl}
8
+ s.version = "0.2.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Benny Wong"]
12
+ s.date = %q{2009-09-25}
13
+ s.description = %q{Sends a notification from Integrity to Prowl after each build}
14
+ s.email = %q{benny@bwong.net}
15
+ s.extra_rdoc_files = [
16
+ "LICENSE",
17
+ "README.markdown",
18
+ "README.rdoc"
19
+ ]
20
+ s.files = [
21
+ ".document",
22
+ ".gitignore",
23
+ "LICENSE",
24
+ "README.markdown",
25
+ "README.rdoc",
26
+ "Rakefile",
27
+ "VERSION",
28
+ "integrity-prowl.gemspec",
29
+ "lib/integrity/notifier/config.haml",
30
+ "lib/integrity/notifier/prowl.rb",
31
+ "test/integrity_prowl_test.rb",
32
+ "test/test_helper.rb"
33
+ ]
34
+ s.homepage = %q{http://github.com/bdotdub/integrity-prowl}
35
+ s.rdoc_options = ["--charset=UTF-8"]
36
+ s.require_paths = ["lib"]
37
+ s.rubyforge_project = %q{integrity}
38
+ s.rubygems_version = %q{1.3.5}
39
+ s.summary = %q{Prowl notifier for the Integrity continuous integration server}
40
+ s.test_files = [
41
+ "test/integrity_prowl_test.rb",
42
+ "test/test_helper.rb"
43
+ ]
44
+
45
+ if s.respond_to? :specification_version then
46
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
47
+ s.specification_version = 3
48
+
49
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
50
+ s.add_runtime_dependency(%q<integrity>, [">= 0"])
51
+ s.add_runtime_dependency(%q<prowl>, [">= 0"])
52
+ else
53
+ s.add_dependency(%q<integrity>, [">= 0"])
54
+ s.add_dependency(%q<prowl>, [">= 0"])
55
+ end
56
+ else
57
+ s.add_dependency(%q<integrity>, [">= 0"])
58
+ s.add_dependency(%q<prowl>, [">= 0"])
59
+ end
60
+ end
@@ -0,0 +1,3 @@
1
+ %p.normal
2
+ %label{ :for => "prowl_api_keys" } Email
3
+ %input.text#tumblr_notifier_email{ :name => "notifiers[Prowl][api_keys]", :value => config['api_keys'], :type => 'text' }
@@ -0,0 +1,34 @@
1
+ require 'integrity'
2
+ require 'prowl'
3
+
4
+ module Integrity
5
+ class Notifier
6
+ class Prowl < Notifier::Base
7
+ attr_reader :config
8
+
9
+ def self.to_haml
10
+ File.read(File.dirname(__FILE__) + '/config.haml')
11
+ end
12
+
13
+ def deliver!
14
+ if api_keys = config[:api_keys]
15
+ api_keys.split(',').each do |key|
16
+ prowl_params = {}
17
+ prowl_params[:application] = 'Integrity'
18
+ prowl_params[:event] = short_message
19
+ prowl_params[:description] = full_message
20
+
21
+ ::Prowl.add(key, prowl_params)
22
+ end
23
+ end
24
+ end
25
+
26
+ def to_s
27
+ 'Prowl'
28
+ end
29
+ end
30
+
31
+ register Prowl
32
+ end
33
+ end
34
+
@@ -0,0 +1,47 @@
1
+ require 'test_helper'
2
+ require 'integrity/notifier/test'
3
+ require 'integrity/notifier/prowl'
4
+
5
+ class IntegrityProwlTest < Test::Unit::TestCase
6
+ include Integrity::Notifier::Test
7
+
8
+ context 'A prowl notifier' do
9
+ setup do
10
+ setup_database
11
+ end
12
+
13
+ should 'register itself' do
14
+ assert_equal Integrity::Notifier::Prowl,
15
+ Integrity::Notifier.available['Prowl']
16
+ end
17
+
18
+ context 'with valid API keys' do
19
+ should 'add one prowl message with one key' do
20
+ config = { :api_keys => 'an_api_key' }
21
+ flexmock(::Prowl).should_receive(:add).once
22
+
23
+ notifier = Integrity::Notifier::Prowl
24
+ notifier.notify_of_build(Integrity::Build.gen(:successful), config)
25
+ end
26
+
27
+ should 'add n prowl message with n keys' do
28
+ keys = (0...rand(100)).map{ |n| "api_key_#{n}" }
29
+ config = { :api_keys => keys.join(',') }
30
+ flexmock(::Prowl).should_receive(:add).times(keys.length)
31
+
32
+ notifier = Integrity::Notifier::Prowl
33
+ notifier.notify_of_build(Integrity::Build.gen(:successful), config)
34
+ end
35
+ end
36
+
37
+ should 'not notify prowl if no key is provided' do
38
+ [nil, ''].each do |key|
39
+ config = { :api_keys => key }
40
+ flexmock(::Prowl).should_receive(:add).times(0)
41
+
42
+ notifier = Integrity::Notifier::Prowl
43
+ notifier.notify_of_build(Integrity::Build.gen(:successful), config)
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,10 @@
1
+ require 'rubygems'
2
+ require 'test/unit'
3
+ require 'flexmock/test_unit'
4
+ require 'shoulda'
5
+
6
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
7
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
8
+
9
+ class Test::Unit::TestCase
10
+ end
metadata ADDED
@@ -0,0 +1,87 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bdotdub-integrity-prowl
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: ruby
6
+ authors:
7
+ - Benny Wong
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-09-25 00:00:00 -07:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: integrity
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
+ - !ruby/object:Gem::Dependency
26
+ name: prowl
27
+ type: :runtime
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: "0"
34
+ version:
35
+ description: Sends a notification from Integrity to Prowl after each build
36
+ email: benny@bwong.net
37
+ executables: []
38
+
39
+ extensions: []
40
+
41
+ extra_rdoc_files:
42
+ - LICENSE
43
+ - README.markdown
44
+ - README.rdoc
45
+ files:
46
+ - .document
47
+ - .gitignore
48
+ - LICENSE
49
+ - README.markdown
50
+ - README.rdoc
51
+ - Rakefile
52
+ - VERSION
53
+ - integrity-prowl.gemspec
54
+ - lib/integrity/notifier/config.haml
55
+ - lib/integrity/notifier/prowl.rb
56
+ - test/integrity_prowl_test.rb
57
+ - test/test_helper.rb
58
+ has_rdoc: false
59
+ homepage: http://github.com/bdotdub/integrity-prowl
60
+ licenses:
61
+ post_install_message:
62
+ rdoc_options:
63
+ - --charset=UTF-8
64
+ require_paths:
65
+ - lib
66
+ required_ruby_version: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: "0"
71
+ version:
72
+ required_rubygems_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: "0"
77
+ version:
78
+ requirements: []
79
+
80
+ rubyforge_project: integrity
81
+ rubygems_version: 1.3.5
82
+ signing_key:
83
+ specification_version: 3
84
+ summary: Prowl notifier for the Integrity continuous integration server
85
+ test_files:
86
+ - test/integrity_prowl_test.rb
87
+ - test/test_helper.rb