grempe-integrity-jabber 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,10 @@
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
+ - ["user", "pass", "host", "port"].each do |field|
8
+ %p.normal
9
+ %label{ :for => "jabber_notifier_#{field}" }= field.upcase
10
+ %input.text{ :name => "notifiers[Jabber][#{field}]", :id => "jabber_notifier_#{field}" :value => config["#{field}"], :type => "text", :value => config["#{field}"] }
@@ -0,0 +1,39 @@
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
+ host = config["host"].blank? ? nil : config.delete("host")
16
+ post = config["port"].blank? ? 5222 : config.delete("port")
17
+ @server = ::Jabber::Simple.new(config.delete("user"), config.delete("pass"), nil, "Available", host, port)
18
+ sleep 4
19
+ @recipients = config["recipients"].nil? ? [] : config.delete("recipients").split(/\s+/)
20
+ super
21
+ end
22
+
23
+ def deliver!
24
+ @recipients.each do |r|
25
+ @server.deliver(r, message)
26
+ end
27
+ end
28
+
29
+ def message
30
+ @message ||= <<-content
31
+ #{build.project.name}: #{short_message} (#{commit.committed_at} by #{commit.author.name})
32
+ Message: #{commit.message}
33
+ Link: #{build_url}
34
+ content
35
+
36
+ end
37
+ end
38
+ end
39
+ end
metadata ADDED
@@ -0,0 +1,73 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: grempe-integrity-jabber
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.4
5
+ platform: ruby
6
+ authors:
7
+ - Pier-Hugues Pellerin
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-04-19 00:00:00 -07:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: integrity-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: jfcouture-xmpp4r-simple
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: Easily let Integrity send jabber messages after each build
36
+ email: ph@heykimo.com
37
+ executables: []
38
+
39
+ extensions: []
40
+
41
+ extra_rdoc_files: []
42
+
43
+ files:
44
+ - lib/notifier/config.haml
45
+ - lib/notifier/jabber.rb
46
+ has_rdoc: false
47
+ homepage: http://integrityapp.com
48
+ post_install_message:
49
+ rdoc_options: []
50
+
51
+ require_paths:
52
+ - lib
53
+ required_ruby_version: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: "0"
58
+ version:
59
+ required_rubygems_version: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: "0"
64
+ version:
65
+ requirements: []
66
+
67
+ rubyforge_project:
68
+ rubygems_version: 1.2.0
69
+ signing_key:
70
+ specification_version: 2
71
+ summary: Jabber notifier for the Integrity continuous integration server
72
+ test_files: []
73
+