Soph-integrity-twitter 1.0.1

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,54 @@
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
+ Run the tests
26
+ ==================
27
+
28
+ rake spec
29
+
30
+ License
31
+ =======
32
+
33
+ (The MIT License)
34
+
35
+ Copyright (c) 2008 Chris Saylor
36
+
37
+ Permission is hereby granted, free of charge, to any person obtaining
38
+ a copy of this software and associated documentation files (the
39
+ 'Software'), to deal in the Software without restriction, including
40
+ without limitation the rights to use, copy, modify, merge, publish,
41
+ distribute, sublicense, and/or sell copies of the Software, and to
42
+ permit persons to whom the Software is furnished to do so, subject to
43
+ the following conditions:
44
+
45
+ The above copyright notice and this permission notice shall be
46
+ included in all copies or substantial portions of the Software.
47
+
48
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
49
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
50
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
51
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
52
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
53
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
54
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile ADDED
@@ -0,0 +1,27 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+ require 'echoe'
4
+
5
+ Echoe.new('integrity-twitter', '1.0.1') 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 }
17
+
18
+ require 'spec/rake/spectask'
19
+
20
+ Spec::Rake::SpecTask.new(:spec) do |t|
21
+ t.spec_opts = ["--color", "--format", "progress"]
22
+ t.spec_files = Dir['spec/**/*_spec.rb'].sort
23
+ t.libs = ['lib']
24
+ t.rcov = false
25
+ end
26
+
27
+
@@ -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.1"
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-15}
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", "Rakefile", "README.markdown", "spec/integrity_twitter_spec.rb", "spec/spec_helper.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<integrity>, [">= 0"])
27
+ s.add_runtime_dependency(%q<twitter>, [">= 0"])
28
+ else
29
+ s.add_dependency(%q<integrity>, [">= 0"])
30
+ s.add_dependency(%q<twitter>, [">= 0"])
31
+ end
32
+ else
33
+ s.add_dependency(%q<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,56 @@
1
+ require File.dirname(__FILE__) + "/spec_helper"
2
+
3
+ describe Integrity::Notifier::IntegrityTwitter do
4
+ include AppSpecHelper
5
+ include NotifierSpecHelper
6
+
7
+ it_should_behave_like "A notifier"
8
+
9
+ def klass
10
+ Integrity::Notifier::IntegrityTwitter
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("integrity_twitter_notifier_email").named("notifiers[IntegrityTwitter][email]").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("integrity_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("integrity_twitter_notifier_pass").named("notifiers[IntegrityTwitter][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("integrity_twitter_notifier_pass").with_value("mypass")
50
+ end
51
+ end
52
+ end
53
+
54
+
55
+
56
+ end
@@ -0,0 +1,5 @@
1
+ require "rubygems"
2
+ require "integrity"
3
+ require File.dirname(__FILE__) / ".." / "lib" / "notifier" / "integrity_twitter"
4
+
5
+ require Integrity.root / "spec" / "spec_helper"
metadata ADDED
@@ -0,0 +1,85 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: Soph-integrity-twitter
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Chris Saylor
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-12-15 00:00:00 -08:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: integrity
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: twitter
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: Easily let Integrity tweet after each build
36
+ email: chris@justhack.com
37
+ executables: []
38
+
39
+ extensions: []
40
+
41
+ extra_rdoc_files:
42
+ - lib/notifier/config.haml
43
+ - lib/notifier/integrity_twitter.rb
44
+ - README.markdown
45
+ files:
46
+ - integrity-twitter.gemspec
47
+ - lib/notifier/config.haml
48
+ - lib/notifier/integrity_twitter.rb
49
+ - Rakefile
50
+ - README.markdown
51
+ - spec/integrity_twitter_spec.rb
52
+ - spec/spec_helper.rb
53
+ has_rdoc: false
54
+ homepage: http://integrityapp.com
55
+ post_install_message:
56
+ rdoc_options:
57
+ - --line-numbers
58
+ - --inline-source
59
+ - --title
60
+ - Integrity-twitter
61
+ - --main
62
+ - README.markdown
63
+ require_paths:
64
+ - lib
65
+ required_ruby_version: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: "0"
70
+ version:
71
+ required_rubygems_version: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: "1.2"
76
+ version:
77
+ requirements: []
78
+
79
+ rubyforge_project: integrity-twitter
80
+ rubygems_version: 1.2.0
81
+ signing_key:
82
+ specification_version: 2
83
+ summary: Twitter notifier for the Integrity continuous integration server
84
+ test_files: []
85
+