foca-integrity-email 1.0

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 ADDED
@@ -0,0 +1,52 @@
1
+ Integrity
2
+ =========
3
+
4
+ [Integrity][] is your friendly automated Continuous Integration server.
5
+
6
+ Integrity Email Notifier
7
+ ========================
8
+
9
+ This lets Integrity send emails after each build is made.
10
+
11
+ Setup Instructions
12
+ ==================
13
+
14
+ Just install this gem via `sudo gem install -s http://gems.github.com
15
+ foca-integrity-email` and then in your Rackup (ie, `config.ru`) file:
16
+
17
+ require "rubygems"
18
+ require "notifier/email"
19
+
20
+ And badabing! Now you can set up your projects to send emails after
21
+ each build (just edit the project and the config options should be
22
+ there)
23
+
24
+ License
25
+ =======
26
+
27
+ (The MIT License)
28
+
29
+ Copyright (c) 2008 [Nicolás Sanguinetti][foca], [entp][]
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
51
+ [foca]: http://nicolassanguinetti.info
52
+ [entp]: http://entp.com
@@ -0,0 +1,27 @@
1
+ %p.normal
2
+ %label{ :for => "email_notifier_to" } Send to
3
+ %input.text#email_notifier_to{ :name => "notifiers[Email][to]", :type => "text", :value => config["to"] }
4
+
5
+ %p.normal
6
+ %label{ :for => "email_notifier_from" } Send from
7
+ %input.text#email_notifier_from{ :name => "notifiers[Email][from]", :type => "text", :value => config["from"] }
8
+
9
+ %h3 SMTP Server Configuration
10
+
11
+ %p.normal
12
+ %label{ :for => "email_notifier_host" } Host : Port
13
+ = succeed " : " do
14
+ %input.text#email_notifier_host{ :name => "notifiers[Email][host]", :value => config["host"], :style => "width: 24.5em;", :type => "text" }
15
+ %input.text#email_notifier_port{ :name => "notifiers[Email][port]", :value => config["port"], :style => "width: 3.5em;", :type => "text" }
16
+
17
+ %p.normal
18
+ %label{ :for => "email_notifier_user" } User
19
+ %input.text#email_notifier_user{ :name => "notifiers[Email][user]", :value => config["user"], :type => "text" }
20
+
21
+ %p.normal
22
+ %label{ :for => "email_notifier_pass" } Password
23
+ %input.text#email_notifier_pass{ :name => "notifiers[Email][pass]", :value => config["pass"], :type => "text" }
24
+
25
+ %p.normal
26
+ %label{ :for => "email_notifier_auth" } Auth type
27
+ %input.text#email_notifier_auth{ :name => "notifiers[Email][auth]", :value => (config["auth"] || "plain"), :type => "text" }
@@ -0,0 +1,50 @@
1
+ require 'rubygems'
2
+ require 'integrity'
3
+ require 'diddies/mailer'
4
+
5
+ module Integrity
6
+ class Notifier
7
+ class Email < Notifier::Base
8
+ attr_reader :to, :from
9
+
10
+ def initialize(build, config={})
11
+ @to = config.delete("to")
12
+ @from = config.delete("from")
13
+ super
14
+ configure_mailer
15
+ end
16
+
17
+ def deliver!
18
+ email.deliver!
19
+ end
20
+
21
+ def email
22
+ @email ||= Sinatra::Mailer::Email.new(
23
+ :to => to,
24
+ :from => from,
25
+ :text => body,
26
+ :subject => subject
27
+ )
28
+ end
29
+
30
+ def subject
31
+ "[Integrity] #{build.project.name}: #{short_message}"
32
+ end
33
+
34
+ alias :body :full_message
35
+
36
+ private
37
+
38
+ def configure_mailer
39
+ Sinatra::Mailer.delivery_method = "net_smtp"
40
+ Sinatra::Mailer.config = {
41
+ :host => @config["host"],
42
+ :port => @config["port"],
43
+ :user => @config["user"],
44
+ :pass => @config["pass"],
45
+ :auth => @config["auth"]
46
+ }
47
+ end
48
+ end
49
+ end
50
+ end
metadata ADDED
@@ -0,0 +1,72 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: foca-integrity-email
3
+ version: !ruby/object:Gem::Version
4
+ version: "1.0"
5
+ platform: ruby
6
+ authors:
7
+ - "Nicol\xC3\xA1s Sanguinetti"
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-11-13 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: foca-sinatra-diddies
26
+ version_requirement:
27
+ version_requirements: !ruby/object:Gem::Requirement
28
+ requirements:
29
+ - - ">="
30
+ - !ruby/object:Gem::Version
31
+ version: 0.0.2
32
+ version:
33
+ description: Easily let Integrity send emails after each build
34
+ email: contacto@nicolassanguinetti.info
35
+ executables: []
36
+
37
+ extensions: []
38
+
39
+ extra_rdoc_files: []
40
+
41
+ files:
42
+ - README.markdown
43
+ - lib/notifier/config.haml
44
+ - lib/notifier/email.rb
45
+ has_rdoc: false
46
+ homepage: http://integrityapp.com
47
+ post_install_message:
48
+ rdoc_options: []
49
+
50
+ require_paths:
51
+ - lib
52
+ required_ruby_version: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: "0"
57
+ version:
58
+ required_rubygems_version: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: "0"
63
+ version:
64
+ requirements: []
65
+
66
+ rubyforge_project:
67
+ rubygems_version: 1.2.0
68
+ signing_key:
69
+ specification_version: 2
70
+ summary: Email notifier for the Integrity continuous integration server
71
+ test_files: []
72
+