brentd-integrity-growl 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +1 -1
- data/lib/notifier/growl.rb +21 -16
- metadata +5 -4
data/README.markdown
CHANGED
@@ -12,7 +12,7 @@ Setup Instructions
|
|
12
12
|
==================
|
13
13
|
|
14
14
|
Just install this gem via `sudo gem install -s http://gems.github.com
|
15
|
-
|
15
|
+
brentd-integrity-growl` and then in your Rackup (ie, `config.ru`) file:
|
16
16
|
|
17
17
|
require "notifier/growl"
|
18
18
|
Integrity::Notifier.register(Integrity::Notifier::Growl)
|
data/lib/notifier/growl.rb
CHANGED
@@ -5,34 +5,39 @@ require 'ruby-growl'
|
|
5
5
|
module Integrity
|
6
6
|
class Notifier
|
7
7
|
class Growl < Notifier::Base
|
8
|
-
|
8
|
+
|
9
9
|
def initialize(build, config = {})
|
10
|
-
@
|
11
|
-
@
|
12
|
-
|
13
|
-
::Growl.new address, "Integrity", ["Integrity build notification"]
|
10
|
+
@addresses = config['addresses'].nil? ? [] : config.delete('addresses').split(/,\s+?|\s+/)
|
11
|
+
@growls = @addresses.map do |address|
|
12
|
+
::Growl.new address, "Integrity", ["Build Successful", "Build Failed"]
|
14
13
|
end
|
15
14
|
super
|
16
15
|
end
|
17
|
-
|
16
|
+
|
18
17
|
def self.to_haml
|
19
18
|
File.read File.dirname(__FILE__) / "config.haml"
|
20
19
|
end
|
21
|
-
|
20
|
+
|
22
21
|
def deliver!
|
23
|
-
@
|
24
|
-
g.notify "
|
22
|
+
@growls.each do |g|
|
23
|
+
g.notify growl_type, "#{commit.project.name}: #{growl_type}", message
|
25
24
|
end
|
26
25
|
end
|
27
26
|
|
27
|
+
def growl_type
|
28
|
+
"Build #{commit.successful? ? 'Successful' : 'Failed'}"
|
29
|
+
end
|
30
|
+
|
28
31
|
def message
|
29
|
-
@message ||=
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
32
|
+
@message ||= begin
|
33
|
+
<<-MSG.gsub!(/^ {12}/, '')
|
34
|
+
Author: #{commit.author.name}
|
35
|
+
|
36
|
+
#{commit.message}
|
37
|
+
MSG
|
38
|
+
end
|
34
39
|
end
|
35
|
-
|
40
|
+
|
36
41
|
end
|
37
42
|
end
|
38
|
-
end
|
43
|
+
end
|
metadata
CHANGED
@@ -1,19 +1,20 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: brentd-integrity-growl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Calavera
|
8
|
+
- Brent Dillingham
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
12
|
|
12
|
-
date: 2009-06-
|
13
|
+
date: 2009-06-04 00:00:00 -07:00
|
13
14
|
default_executable:
|
14
15
|
dependencies:
|
15
16
|
- !ruby/object:Gem::Dependency
|
16
|
-
name:
|
17
|
+
name: integrity-integrity
|
17
18
|
type: :runtime
|
18
19
|
version_requirement:
|
19
20
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -33,7 +34,7 @@ dependencies:
|
|
33
34
|
version: "0"
|
34
35
|
version:
|
35
36
|
description: Easily let Integrity show Growl notifications after each build
|
36
|
-
email:
|
37
|
+
email: brentdillingham@gmail.com
|
37
38
|
executables: []
|
38
39
|
|
39
40
|
extensions: []
|