brentd-integrity-growl 1.0.1 → 1.0.2

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.
Files changed (3) hide show
  1. data/README.markdown +1 -1
  2. data/lib/notifier/growl.rb +21 -16
  3. metadata +5 -4
@@ -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
- calavera-integrity-growl` and then in your Rackup (ie, `config.ru`) file:
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)
@@ -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
- @growl = ::Growl.new "localhost", "Integrity", ["Integrity build notification"]
11
- @addresses = config[:addresses].nil? ? [] : config.delete(:addresses).split(/,|\s+/)
12
- @growl = @addresses.map do |address|
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
- @growl.each do |g|
24
- g.notify "Integrity build notification", short_message, message
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 ||= <<-content
30
- #{build.project.name}: #{short_message} (at #{build.commited_at} by #{build.commit_author.name})
31
- Commit Message: '#{build.commit_message}'
32
- Link: #{build_url}
33
- content
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.1
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-02 00:00:00 -07:00
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: foca-integrity
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: calavera@apache.org
37
+ email: brentdillingham@gmail.com
37
38
  executables: []
38
39
 
39
40
  extensions: []