integrity-integrity-irc 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/README.markdown ADDED
@@ -0,0 +1,50 @@
1
+ Integrity
2
+ =========
3
+
4
+ [Integrity][] is your friendly automated Continuous Integration server.
5
+
6
+ Integrity IRC Notifier
7
+ ========================
8
+
9
+ This lets Integrity alert an IRC channel after each build is made.
10
+
11
+ Setup Instructions
12
+ ==================
13
+
14
+ Just install this gem with `gem install integrity-irc`
15
+ and then in your Rackup (ie, `config.ru`) file:
16
+
17
+ require "rubygems"
18
+ require "integrity/notifier/irc"
19
+
20
+ And badabing! Now you can set up your projects to alert an IRC channel
21
+ after each build (just edit the project and the config options should
22
+ be there)
23
+
24
+ License
25
+ =======
26
+
27
+ (The MIT License)
28
+
29
+ Copyright (c) 2008 [Simon Rozet](http://purl.org/net/sr/)
30
+
31
+ Permission is hereby granted, free of charge, to any person obtaining
32
+ a copy of this software and associated documentation files (the
33
+ 'Software'), to deal in the Software without restriction, including
34
+ without limitation the rights to use, copy, modify, merge, publish,
35
+ distribute, sublicense, and/or sell copies of the Software, and to
36
+ permit persons to whom the Software is furnished to do so, subject to
37
+ the following conditions:
38
+
39
+ The above copyright notice and this permission notice shall be
40
+ included in all copies or substantial portions of the Software.
41
+
42
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
43
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
44
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
45
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
46
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
47
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
48
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
49
+
50
+ [Integrity]: http://integrityapp.com
data/Rakefile ADDED
@@ -0,0 +1,11 @@
1
+ task :default => :test
2
+
3
+ task :test do
4
+ ruby "test/integrity_irc_test.rb"
5
+ end
6
+
7
+ begin
8
+ require "mg"
9
+ MG.new("integrity-irc.gemspec")
10
+ rescue LoadError
11
+ end
@@ -0,0 +1,22 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = "integrity-irc"
3
+ s.rubyforge_project = "integrity"
4
+ s.version = "0.0.7"
5
+ s.date = "2009-03-18"
6
+ s.summary = "IRC notifier for the Integrity continuous integration server"
7
+ s.summary = "IRC notifier for the Integrity continuous integration server"
8
+ s.homepage = "http://integrityapp.com"
9
+ s.email = "simon@rozet.name"
10
+ s.authors = ["Simon Rozet", "Harry Vangberg"]
11
+ s.has_rdoc = false
12
+ s.files = %w[
13
+ README.markdown
14
+ Rakefile
15
+ integrity-irc.gemspec
16
+ lib/integrity/notifier/irc.rb
17
+ test/integrity_irc_test.rb
18
+ ]
19
+ s.test_files = %w[test/integrity_irc_test.rb]
20
+ s.add_dependency "integrity"
21
+ s.add_dependency "shout-bot"
22
+ end
@@ -0,0 +1,35 @@
1
+ require "shout-bot"
2
+
3
+ module Integrity
4
+ class Notifier
5
+ class IRC < Notifier::Base
6
+ attr_reader :uri
7
+
8
+ def self.to_haml
9
+ <<-HAML
10
+ %p.normal
11
+ %label{ :for => "irc_notifier_uri" } Send to
12
+ %input.text#irc_notifier_uri{ |
13
+ :name => "notifiers[IRC][uri]", |
14
+ :type => "text", |
15
+ :value => config["uri"] || |
16
+ "irc://IntegrityBot@irc.freenode.net:6667/#test" } |
17
+ HAML
18
+ end
19
+
20
+ def initialize(build, config={})
21
+ @uri = config.delete("uri")
22
+ super
23
+ end
24
+
25
+ def deliver!
26
+ ShoutBot.shout(uri) do |channel|
27
+ channel.say "#{build.project.name}: #{short_message}"
28
+ channel.say commit_url
29
+ end
30
+ end
31
+ end
32
+
33
+ register IRC
34
+ end
35
+ end
@@ -0,0 +1,38 @@
1
+ require "test/unit"
2
+ require "rr"
3
+ require "integrity/notifier/test"
4
+
5
+ begin
6
+ require "redgreen"
7
+ rescue LoadError
8
+ end
9
+
10
+ require File.dirname(__FILE__) + "/../lib/integrity/notifier/irc"
11
+
12
+ class IntegrityIRCTest < Test::Unit::TestCase
13
+ include RR::Adapters::TestUnit
14
+ include Integrity::Notifier::Test
15
+
16
+ def setup
17
+ setup_database
18
+ end
19
+
20
+ def notifier
21
+ "IRC"
22
+ end
23
+
24
+ def test_configuration_form
25
+ assert_form_have_option "uri", "irc://irc.freenode.net/test"
26
+ end
27
+
28
+ def test_send_notification
29
+ config = { "uri" => "irc://foo:bar@irc.freenode.net/test" }
30
+ stub(ShoutBot).shout("irc://foo:bar@irc.freenode.net/test") { nil }
31
+ Integrity::Notifier::IRC.new(Integrity::Commit.gen, config).deliver!
32
+ end
33
+
34
+ def test_notification_full_message
35
+ assert notification_successful.include?("successful")
36
+ assert notification_failed.include?("failed")
37
+ end
38
+ end
metadata ADDED
@@ -0,0 +1,77 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: integrity-integrity-irc
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.7
5
+ platform: ruby
6
+ authors:
7
+ - Simon Rozet
8
+ - Harry Vangberg
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2009-03-18 00:00:00 -07:00
14
+ default_executable:
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: integrity
18
+ type: :runtime
19
+ version_requirement:
20
+ version_requirements: !ruby/object:Gem::Requirement
21
+ requirements:
22
+ - - ">="
23
+ - !ruby/object:Gem::Version
24
+ version: "0"
25
+ version:
26
+ - !ruby/object:Gem::Dependency
27
+ name: shout-bot
28
+ type: :runtime
29
+ version_requirement:
30
+ version_requirements: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: "0"
35
+ version:
36
+ description:
37
+ email: simon@rozet.name
38
+ executables: []
39
+
40
+ extensions: []
41
+
42
+ extra_rdoc_files: []
43
+
44
+ files:
45
+ - README.markdown
46
+ - Rakefile
47
+ - integrity-irc.gemspec
48
+ - lib/integrity/notifier/irc.rb
49
+ - test/integrity_irc_test.rb
50
+ has_rdoc: false
51
+ homepage: http://integrityapp.com
52
+ post_install_message:
53
+ rdoc_options: []
54
+
55
+ require_paths:
56
+ - lib
57
+ required_ruby_version: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: "0"
62
+ version:
63
+ required_rubygems_version: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: "0"
68
+ version:
69
+ requirements: []
70
+
71
+ rubyforge_project: integrity
72
+ rubygems_version: 1.2.0
73
+ signing_key:
74
+ specification_version: 2
75
+ summary: IRC notifier for the Integrity continuous integration server
76
+ test_files:
77
+ - test/integrity_irc_test.rb