ph-integrity-jabber 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,13 @@
1
+ %p.normal
2
+ %label{ :for => "jabber_notifier_recipients" } Recipients
3
+ %input.text#jabber_notifier_recipients{ :name => "notifiers[Jabber][recipients]", :type => "text", :value => config['recipients'] }
4
+
5
+ %h3 Jabber Server Configuration
6
+
7
+ %p.normal
8
+ %label{ :for => "jabber_notifier_user" } User
9
+ %input.text#jabber_notifier_user{ :name => "notifiers[Jabber][user]", :value => config["user"], :type => "text", :value => config['user'] }
10
+
11
+ %p.normal
12
+ %label{ :for => "jabber_notifier_pass" } Pass
13
+ %input.text#jabber_notifier_pass{ :name => "notifiers[Jabber][pass]", :value => config["pass"], :type => "text", :value => config['pass'] }
@@ -0,0 +1,35 @@
1
+ require 'rubygems'
2
+ require 'integrity'
3
+ require 'xmpp4r-simple'
4
+
5
+ module Integrity
6
+ class Notifier
7
+ class Jabber < Notifier::Base
8
+ attr_reader :recipients
9
+
10
+ def self.to_haml
11
+ File.read File.dirname(__FILE__) / "config.haml"
12
+ end
13
+
14
+ def initialize(build, config = {})
15
+ @server = ::Jabber::Simple.new(config.delete(:user), config.delete(:pass))
16
+ @recipients = config[:recipients].nil? ? [] : config.delete(:recipients).split(/\s+/)
17
+ super
18
+ end
19
+
20
+ def deliver!
21
+ @recipients.each do |r|
22
+ @server.deliver(r, message)
23
+ end
24
+ end
25
+
26
+ def message
27
+ @message ||= <<-content
28
+ #{build.project.name}: #{short_message} (at #{build.commited_at} by #{build.commit_author.name})
29
+ Commit Message: '#{build.commit_message}'
30
+ Link: #{build_url}
31
+ content
32
+ end
33
+ end
34
+ end
35
+ end
metadata ADDED
@@ -0,0 +1,71 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ph-integrity-jabber
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Pier-Hugues Pellerin
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-11-16 00:00:00 -08:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: foca-integrity
17
+ version_requirement:
18
+ version_requirements: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: "0"
23
+ version:
24
+ - !ruby/object:Gem::Dependency
25
+ name: xmpp4r-simple
26
+ version_requirement:
27
+ version_requirements: !ruby/object:Gem::Requirement
28
+ requirements:
29
+ - - ">="
30
+ - !ruby/object:Gem::Version
31
+ version: "0"
32
+ version:
33
+ description: Easily let Integrity send jabber messages after each build
34
+ email: ph@heykimo.com
35
+ executables: []
36
+
37
+ extensions: []
38
+
39
+ extra_rdoc_files: []
40
+
41
+ files:
42
+ - lib/notifier/config.haml
43
+ - lib/notifier/jabber.rb
44
+ has_rdoc: false
45
+ homepage: http://integrityapp.com
46
+ post_install_message:
47
+ rdoc_options: []
48
+
49
+ require_paths:
50
+ - lib
51
+ required_ruby_version: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: "0"
56
+ version:
57
+ required_rubygems_version: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: "0"
62
+ version:
63
+ requirements: []
64
+
65
+ rubyforge_project:
66
+ rubygems_version: 1.2.0
67
+ signing_key:
68
+ specification_version: 2
69
+ summary: Jabber notifier for the Integrity continuous integration server
70
+ test_files: []
71
+