sr-integrity-irc 0.0.4 → 0.0.5
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/README.markdown +2 -2
- data/test/irc_test.rb +9 -4
- metadata +4 -3
- data/lib/notifier/irc.rb +0 -31
data/README.markdown
CHANGED
@@ -11,11 +11,11 @@ This lets Integrity alert an IRC channel after each build is made.
|
|
11
11
|
Setup Instructions
|
12
12
|
==================
|
13
13
|
|
14
|
-
Just install this gem via `sudo gem install -s http://gems.github.com
|
14
|
+
Just install this gem via `sudo gem install -s http://gems.github.com
|
15
15
|
sr-integrity-irc` and then in your Rackup (ie, `config.ru`) file:
|
16
16
|
|
17
17
|
require "rubygems"
|
18
|
-
require "notifier/irc"
|
18
|
+
require "integrity/notifier/irc"
|
19
19
|
|
20
20
|
And badabing! Now you can set up your projects to alert an IRC channel
|
21
21
|
after each build (just edit the project and the config options should
|
data/test/irc_test.rb
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
require "test/unit"
|
2
2
|
require "rr"
|
3
|
-
require "integrity/notifier/
|
3
|
+
require "integrity/notifier/test"
|
4
4
|
|
5
5
|
begin
|
6
6
|
require "redgreen"
|
7
7
|
rescue LoadError
|
8
8
|
end
|
9
9
|
|
10
|
-
require File.dirname(__FILE__) + "/../lib/notifier/irc"
|
10
|
+
require File.dirname(__FILE__) + "/../lib/integrity/notifier/irc"
|
11
11
|
|
12
12
|
class IRCTest < Test::Unit::TestCase
|
13
13
|
include RR::Adapters::TestUnit
|
14
|
-
include Integrity::Notifier::
|
14
|
+
include Integrity::Notifier::Test
|
15
15
|
|
16
16
|
def setup
|
17
17
|
setup_database
|
@@ -28,6 +28,11 @@ class IRCTest < Test::Unit::TestCase
|
|
28
28
|
def test_send_notification
|
29
29
|
config = { "uri" => "irc://foo:bar@irc.freenode.net/test" }
|
30
30
|
stub(ShoutBot).shout("irc://foo:bar@irc.freenode.net/test") { nil }
|
31
|
-
Integrity::Notifier::IRC.new(
|
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")
|
32
37
|
end
|
33
38
|
end
|
metadata
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sr-integrity-irc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simon Rozet
|
8
|
+
- Harry Vangberg
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
@@ -13,7 +14,7 @@ date: 2009-03-04 00:00:00 -08:00
|
|
13
14
|
default_executable:
|
14
15
|
dependencies:
|
15
16
|
- !ruby/object:Gem::Dependency
|
16
|
-
name:
|
17
|
+
name: integrity
|
17
18
|
type: :runtime
|
18
19
|
version_requirement:
|
19
20
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -23,7 +24,7 @@ dependencies:
|
|
23
24
|
version: "0"
|
24
25
|
version:
|
25
26
|
- !ruby/object:Gem::Dependency
|
26
|
-
name:
|
27
|
+
name: shout-bot
|
27
28
|
type: :runtime
|
28
29
|
version_requirement:
|
29
30
|
version_requirements: !ruby/object:Gem::Requirement
|
data/lib/notifier/irc.rb
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'integrity' unless defined?(Integrity)
|
3
|
-
require 'shout-bot'
|
4
|
-
|
5
|
-
module Integrity
|
6
|
-
class Notifier
|
7
|
-
class IRC < Notifier::Base
|
8
|
-
attr_reader :uri
|
9
|
-
|
10
|
-
def self.to_haml
|
11
|
-
<<-HAML
|
12
|
-
%p.normal
|
13
|
-
%label{ :for => 'irc_notifier_uri' } Send to
|
14
|
-
%input.text#irc_notifier_uri{ :name => 'notifiers[IRC][uri]', :type => 'text', :value => config['uri'] || 'irc://IntegrityBot@irc.freenode.net:6667/#test' }
|
15
|
-
HAML
|
16
|
-
end
|
17
|
-
|
18
|
-
def initialize(build, config={})
|
19
|
-
@uri = config.delete("uri")
|
20
|
-
super
|
21
|
-
end
|
22
|
-
|
23
|
-
def deliver!
|
24
|
-
ShoutBot.shout(uri) do |channel|
|
25
|
-
channel.say "#{build.project.name}: #{short_message}"
|
26
|
-
channel.say commit_url
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|