cwsaylor-integrity-twitter 1.0.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,49 @@
1
+ Integrity
2
+ =========
3
+
4
+ [Integrity][] is your friendly automated Continuous Integration server.
5
+
6
+ Integrity Twitter Notifier
7
+ ===========================
8
+
9
+ This lets Integrity send a tweet 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
+ cwsaylor-integrity-twitter`
16
+
17
+ Step 2. Add the following lines to your Rackup (ie, `config.ru`) file:
18
+
19
+ require "rubygems"
20
+ require "notifier/twitter"
21
+
22
+ Step 3. Profit! Just kidding. Edit the project and update your twitter email
23
+ address and password.
24
+
25
+ License
26
+ =======
27
+
28
+ (The MIT License)
29
+
30
+ Copyright (c) 2008 Chris Saylor
31
+
32
+ Permission is hereby granted, free of charge, to any person obtaining
33
+ a copy of this software and associated documentation files (the
34
+ 'Software'), to deal in the Software without restriction, including
35
+ without limitation the rights to use, copy, modify, merge, publish,
36
+ distribute, sublicense, and/or sell copies of the Software, and to
37
+ permit persons to whom the Software is furnished to do so, subject to
38
+ the following conditions:
39
+
40
+ The above copyright notice and this permission notice shall be
41
+ included in all copies or substantial portions of the Software.
42
+
43
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
44
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
45
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
46
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
47
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
48
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
49
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile ADDED
@@ -0,0 +1,16 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+ require 'echoe'
4
+
5
+ Echoe.new('integrity-twitter', '1.0.0') do |e|
6
+ e.summary = "Twitter notifier for the Integrity continuous integration server"
7
+ e.description = "Easily let Integrity tweet after each build"
8
+ e.url = "http://integrityapp.com"
9
+ e.author = "Chris Saylor"
10
+ e.email = "chris@justhack.com"
11
+ e.has_rdoc = false
12
+ e.development_dependencies = []
13
+ e.runtime_dependencies = ['foca-integrity', 'twitter']
14
+ end
15
+
16
+ Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each { |ext| load ext }
@@ -0,0 +1,36 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{integrity-twitter}
5
+ s.version = "1.0.0"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["Chris Saylor"]
9
+ s.date = %q{2008-12-12}
10
+ s.description = %q{Easily let Integrity tweet after each build}
11
+ s.email = %q{chris@justhack.com}
12
+ s.extra_rdoc_files = ["lib/notifier/config.haml", "lib/notifier/integrity_twitter.rb", "README.markdown"]
13
+ s.files = ["integrity-twitter.gemspec", "lib/notifier/config.haml", "lib/notifier/integrity_twitter.rb", "Manifest", "Rakefile", "README.markdown", "spec/spec_helper.rb", "spec/twitter_spec.rb"]
14
+ s.homepage = %q{http://integrityapp.com}
15
+ s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Integrity-twitter", "--main", "README.markdown"]
16
+ s.require_paths = ["lib"]
17
+ s.rubyforge_project = %q{integrity-twitter}
18
+ s.rubygems_version = %q{1.3.1}
19
+ s.summary = %q{Twitter notifier for the Integrity continuous integration server}
20
+
21
+ if s.respond_to? :specification_version then
22
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
23
+ s.specification_version = 2
24
+
25
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
26
+ s.add_runtime_dependency(%q<foca-integrity>, [">= 0"])
27
+ s.add_runtime_dependency(%q<twitter>, [">= 0"])
28
+ else
29
+ s.add_dependency(%q<foca-integrity>, [">= 0"])
30
+ s.add_dependency(%q<twitter>, [">= 0"])
31
+ end
32
+ else
33
+ s.add_dependency(%q<foca-integrity>, [">= 0"])
34
+ s.add_dependency(%q<twitter>, [">= 0"])
35
+ end
36
+ end
@@ -0,0 +1,7 @@
1
+ %p.normal
2
+ %label{ :for => "integrity_twitter_notifier_email" } Email Address
3
+ %input.text#integrity_twitter_notifier_email{ :name => "notifiers[IntegrityTwitter][email]", :value => config["email"], :type => "text" }
4
+
5
+ %p.normal
6
+ %label{ :for => "integrity_twitter_notifier_pass" } Password
7
+ %input.text#integrity_twitter_notifier_pass{ :name => "notifiers[IntegrityTwitter][pass]", :value => config["pass"], :type => "text" }
@@ -0,0 +1,20 @@
1
+ require 'rubygems'
2
+ require 'integrity'
3
+ require 'twitter'
4
+
5
+ module Integrity
6
+ class Notifier
7
+ class IntegrityTwitter < Notifier::Base
8
+
9
+ def self.to_haml
10
+ File.read File.dirname(__FILE__) / "config.haml"
11
+ end
12
+
13
+ def deliver!
14
+ @tweet = Twitter::Base.new(@config["email"], @config["pass"])
15
+ @tweet.post(short_message)
16
+ end
17
+
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,5 @@
1
+ require "rubygems"
2
+ require "integrity"
3
+ require File.dirname(__FILE__) / ".." / "lib" / "notifier" / "twitter"
4
+
5
+ require Integrity.root / "spec" / "spec_helper"
@@ -0,0 +1,56 @@
1
+ require File.dirname(__FILE__) + "/spec_helper"
2
+
3
+ describe Integrity::Notifier::Twitter do
4
+ include AppSpecHelper
5
+ include NotifierSpecHelper
6
+
7
+ it_should_behave_like "A notifier"
8
+
9
+ def klass
10
+ Integrity::Notifier::Twitter
11
+ end
12
+
13
+ describe "notifying the world of a build" do
14
+ before { klass.stub!(:new).and_return(notifier) }
15
+
16
+ it "should instantiate a notifier with the given build and config" do
17
+ klass.should_receive(:new).with(mock_build, anything).and_return(notifier)
18
+ klass.notify_of_build(mock_build, notifier_config)
19
+ end
20
+
21
+ it "should pass the notifier options to the notifier" do
22
+ klass.should_receive(:new).with(anything, notifier_config).and_return(notifier)
23
+ klass.notify_of_build(mock_build, notifier_config)
24
+ end
25
+
26
+ it "should deliver the notification" do
27
+ notifier.should_receive(:deliver!)
28
+ klass.notify_of_build(mock_build, notifier_config)
29
+ end
30
+ end
31
+
32
+ describe "generating a form for configuration" do
33
+ describe "with a field for the email" do
34
+ it "should have the proper name, id and label" do
35
+ the_form.should have_textfield("twitter_notifier_email").named("notifiers[twitter][user]").with_label("Email Address").with_value(nil)
36
+ end
37
+
38
+ it "should use the config's 'email' value if available" do
39
+ the_form(:config => { 'email' => 'test@example.com' }).should have_textfield("twitter_notifier_email").with_value("test@example.com")
40
+ end
41
+ end
42
+
43
+ describe "with a field for the pass" do
44
+ it "should have the proper name, id and label" do
45
+ the_form.should have_textfield("twitter_notifier_pass").named("notifiers[twitter][pass]").with_label("Password").with_value(nil)
46
+ end
47
+
48
+ it "should use the config's 'pass' value if available" do
49
+ the_form(:config => { 'pass' => 'mypass' }).should have_textfield("twitter_notifier_pass").with_value("mypass")
50
+ end
51
+ end
52
+ end
53
+
54
+
55
+
56
+ end
metadata ADDED
@@ -0,0 +1,84 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cwsaylor-integrity-twitter
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Chris Saylor
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-12-12 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: twitter
26
+ version_requirement:
27
+ version_requirements: !ruby/object:Gem::Requirement
28
+ requirements:
29
+ - - ">="
30
+ - !ruby/object:Gem::Version
31
+ version: "0"
32
+ version:
33
+ description: Easily let Integrity tweet after each build
34
+ email: chris@justhack.com
35
+ executables: []
36
+
37
+ extensions: []
38
+
39
+ extra_rdoc_files:
40
+ - lib/notifier/config.haml
41
+ - lib/notifier/integrity_twitter.rb
42
+ - README.markdown
43
+ files:
44
+ - integrity-twitter.gemspec
45
+ - lib/notifier/config.haml
46
+ - lib/notifier/integrity_twitter.rb
47
+ - Manifest
48
+ - Rakefile
49
+ - README.markdown
50
+ - spec/spec_helper.rb
51
+ - spec/twitter_spec.rb
52
+ has_rdoc: false
53
+ homepage: http://integrityapp.com
54
+ post_install_message:
55
+ rdoc_options:
56
+ - --line-numbers
57
+ - --inline-source
58
+ - --title
59
+ - Integrity-twitter
60
+ - --main
61
+ - README.markdown
62
+ require_paths:
63
+ - lib
64
+ required_ruby_version: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: "0"
69
+ version:
70
+ required_rubygems_version: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: "1.2"
75
+ version:
76
+ requirements: []
77
+
78
+ rubyforge_project: integrity-twitter
79
+ rubygems_version: 1.2.0
80
+ signing_key:
81
+ specification_version: 2
82
+ summary: Twitter notifier for the Integrity continuous integration server
83
+ test_files: []
84
+