yeastymobs-integrity-appnotifications 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1 @@
1
+ .DS_Store
@@ -0,0 +1,48 @@
1
+ Integrity
2
+ =========
3
+
4
+ [Integrity](http://integrityapp.com) is your friendly automated Continuous Integration server.
5
+
6
+ Integrity AppNotifications Notifier
7
+ ===========================
8
+
9
+ This lets Integrity send an iPhone push notification (via [AppNotifications](http://appnotifications.com)) after each build is made.
10
+
11
+ Setup Instructions
12
+ ==================
13
+
14
+ Step 1. Install this gem via `sudo gem install -s http://gems.github.com
15
+ yeastymobs-integrity-appnotifications`
16
+
17
+ Step 2. Add the following lines to your Rackup (ie, `config.ru`) file:
18
+
19
+ require "rubygems"
20
+ require "integrity/notifier/appnotifications"
21
+
22
+ Step 3. Profit! Just kidding. Edit the project, add your token(s) and choose the sound to play.
23
+
24
+ License
25
+ =======
26
+
27
+ (The MIT License)
28
+
29
+ Copyright (c) 2009 Yeasty Mobs
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.
@@ -0,0 +1,22 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ begin
5
+ require 'jeweler'
6
+ Jeweler::Tasks.new do |gem|
7
+ gem.name = "integrity-appnotifications"
8
+ gem.summary = %Q{Easily let Integrity push a notification after each build}
9
+ gem.email = "nicolas@yeastymobs.com"
10
+ gem.homepage = "http://github.com/yeastymobs/integrity-appnotifications"
11
+ gem.authors = ["Nicolas Merouze"]
12
+
13
+ gem.add_dependency("mechanize")
14
+ gem.add_dependency("integrity")
15
+ end
16
+
17
+ Jeweler::RubyforgeTasks.new do |rubyforge|
18
+ rubyforge.doc_task = "rdoc"
19
+ end
20
+ rescue LoadError
21
+ puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
22
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 1.0.0
@@ -0,0 +1,47 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{integrity-appnotifications}
8
+ s.version = "1.0.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Nicolas Merouze"]
12
+ s.date = %q{2009-09-18}
13
+ s.email = %q{nicolas@yeastymobs.com}
14
+ s.extra_rdoc_files = [
15
+ "README.md"
16
+ ]
17
+ s.files = [
18
+ ".gitignore",
19
+ "README.md",
20
+ "Rakefile",
21
+ "VERSION",
22
+ "integrity-appnotifications.gemspec",
23
+ "lib/integrity/notifier/appnotifications.rb",
24
+ "lib/integrity/notifier/config.haml"
25
+ ]
26
+ s.homepage = %q{http://github.com/yeastymobs/integrity-appnotifications}
27
+ s.rdoc_options = ["--charset=UTF-8"]
28
+ s.require_paths = ["lib"]
29
+ s.rubygems_version = %q{1.3.5}
30
+ s.summary = %q{Easily let Integrity push a notification after each build}
31
+
32
+ if s.respond_to? :specification_version then
33
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
34
+ s.specification_version = 3
35
+
36
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
37
+ s.add_runtime_dependency(%q<mechanize>, [">= 0"])
38
+ s.add_runtime_dependency(%q<integrity>, [">= 0"])
39
+ else
40
+ s.add_dependency(%q<mechanize>, [">= 0"])
41
+ s.add_dependency(%q<integrity>, [">= 0"])
42
+ end
43
+ else
44
+ s.add_dependency(%q<mechanize>, [">= 0"])
45
+ s.add_dependency(%q<integrity>, [">= 0"])
46
+ end
47
+ end
@@ -0,0 +1,36 @@
1
+ require 'rubygems'
2
+ require 'integrity'
3
+ require 'mechanize'
4
+
5
+ module Integrity
6
+ class Notifier
7
+ class Appnotifications < Notifier::Base
8
+
9
+ def self.to_haml
10
+ File.read File.dirname(__FILE__) / "config.haml"
11
+ end
12
+
13
+ def deliver!
14
+ a = WWW::Mechanize.new { |agent|
15
+ agent.user_agent = "Integrity Notifier 1.0"
16
+ }
17
+
18
+ @config["tokens"].split("\n").each do |token|
19
+ a.post("https://www.appnotifications.com/account/notifications.xml", {
20
+ :user_credentials => token,
21
+ 'notification[title]' => short_message,
22
+ 'notification[long_message]' => full_message,
23
+ 'notification[long_message_preview]' => "Commit Message: #{commit.message}",
24
+ 'notification[message]' => short_message,
25
+ "notification[message_level]" => "0",
26
+ "notification[silent]" => "0",
27
+ "notification[sound]" => commit.successful? ? @config["success_sound"] : @config["fail_sound"],
28
+ })
29
+ end
30
+ end
31
+
32
+ end
33
+
34
+ register Appnotifications
35
+ end
36
+ end
@@ -0,0 +1,27 @@
1
+ %p.normal
2
+ %label{ :for => "appnotifications_notifier_tokens" } Tokens (one per line)
3
+ %textarea#appnotifications_notifier_tokens{ :name => "notifiers[Appnotifications][tokens]", :cols => 40, :rows => 10 }= config["tokens"]
4
+
5
+ %p.normal
6
+ %label{ :for => "appnotifications_notifier_fail_sound" } Fail sound
7
+ %select#appnotifications_notifier_fail_sound{ :name => "notifiers[Appnotifications][fail_sound]" }
8
+ - selected = Proc.new { |s| config["fail_sound"] == s ? "selected" : nil }
9
+ %option{ :selected => selected.call("1.caf") } 1.caf
10
+ %option{ :selected => selected.call("2.caf") } 2.caf
11
+ %option{ :selected => selected.call("3.caf") } 3.caf
12
+ %option{ :selected => selected.call("4.caf") } 4.caf
13
+ %option{ :selected => selected.call("5.caf") } 5.caf
14
+ %option{ :selected => selected.call("6.caf") } 6.caf
15
+ %option{ :selected => selected.call("7.caf") } 7.caf
16
+
17
+ %p.normal
18
+ %label{ :for => "appnotifications_notifier_success_sound" } Success sound
19
+ %select#appnotifications_notifier_success_sound{ :name => "notifiers[Appnotifications][success_sound]" }
20
+ - selected = Proc.new { |s| config["success_sound"] == s ? "selected" : nil }
21
+ %option{ :selected => selected.call("1.caf") } 1.caf
22
+ %option{ :selected => selected.call("2.caf") } 2.caf
23
+ %option{ :selected => selected.call("3.caf") } 3.caf
24
+ %option{ :selected => selected.call("4.caf") } 4.caf
25
+ %option{ :selected => selected.call("5.caf") } 5.caf
26
+ %option{ :selected => selected.call("6.caf") } 6.caf
27
+ %option{ :selected => selected.call("7.caf") } 7.caf
metadata ADDED
@@ -0,0 +1,79 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: yeastymobs-integrity-appnotifications
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Nicolas Merouze
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-09-18 00:00:00 -07:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: mechanize
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: integrity
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:
36
+ email: nicolas@yeastymobs.com
37
+ executables: []
38
+
39
+ extensions: []
40
+
41
+ extra_rdoc_files:
42
+ - README.md
43
+ files:
44
+ - .gitignore
45
+ - README.md
46
+ - Rakefile
47
+ - VERSION
48
+ - integrity-appnotifications.gemspec
49
+ - lib/integrity/notifier/appnotifications.rb
50
+ - lib/integrity/notifier/config.haml
51
+ has_rdoc: false
52
+ homepage: http://github.com/yeastymobs/integrity-appnotifications
53
+ licenses:
54
+ post_install_message:
55
+ rdoc_options:
56
+ - --charset=UTF-8
57
+ require_paths:
58
+ - lib
59
+ required_ruby_version: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: "0"
64
+ version:
65
+ required_rubygems_version: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: "0"
70
+ version:
71
+ requirements: []
72
+
73
+ rubyforge_project:
74
+ rubygems_version: 1.3.5
75
+ signing_key:
76
+ specification_version: 3
77
+ summary: Easily let Integrity push a notification after each build
78
+ test_files: []
79
+