guillaumegentil-integrity-jabber 1.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.
@@ -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,38 @@
1
+ require 'integrity'
2
+ require 'xmpp4r-simple'
3
+
4
+ module Integrity
5
+ class Notifier
6
+ class Jabber < Notifier::Base
7
+ attr_reader :recipients
8
+
9
+ def self.to_haml
10
+ File.read(File.dirname(__FILE__) / "config.haml")
11
+ end
12
+
13
+ def initialize(build, config = {})
14
+ host = config["host"].blank? ? nil : config.delete("host")
15
+ post = config["port"].blank? ? 5222 : config.delete("port")
16
+ @server = ::Jabber::Simple.new(config.delete("user"), config.delete("pass"), nil, "Available", host, port)
17
+ sleep 4
18
+ @recipients = config["recipients"].nil? ? [] : config.delete("recipients").split(/\s+/)
19
+ super
20
+ end
21
+
22
+ def deliver!
23
+ @recipients.each do |r|
24
+ @server.deliver(r, message)
25
+ end
26
+ end
27
+
28
+ def message
29
+ @message ||= <<-content
30
+ #{build.project.name}: #{short_message} (#{commit.committed_at} by #{commit.author.name})
31
+ Message: #{commit.message}
32
+ Link: #{build_url}
33
+ content
34
+
35
+ end
36
+ end
37
+ end
38
+ end
metadata ADDED
@@ -0,0 +1,73 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: guillaumegentil-integrity-jabber
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.5
5
+ platform: ruby
6
+ authors:
7
+ - Pier-Hugues Pellerin
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-06-12 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: 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/integrity/notifier/config.haml
45
+ - lib/integrity/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
+