agileanimal-integrity-twitter 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.
data/Manifest ADDED
@@ -0,0 +1,8 @@
1
+ integrity-twitter.gemspec
2
+ lib/notifier/config.haml
3
+ lib/notifier/integrity_twitter.rb
4
+ Manifest
5
+ Rakefile
6
+ README.markdown
7
+ spec/integrity_twitter_spec.rb
8
+ spec/spec_helper.rb
data/README.markdown ADDED
@@ -0,0 +1,66 @@
1
+ Integrity
2
+ =========
3
+
4
+ [Integrity][http://www.integrityapp.com] 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
+ Forked from Chris Saylor.
12
+
13
+ Configuration with Integrity
14
+ ============================
15
+
16
+
17
+
18
+ Setup Instructions
19
+ ==================
20
+
21
+ Step 1. Install this gem via `sudo gem install -s http://gems.github.com
22
+ agileanimal-integrity-twitter`
23
+
24
+ Step 2. Add the following lines to your Rackup (ie, `config.ru`) file:
25
+
26
+ require "rubygems"
27
+ require "notifier/integrity_twitter"
28
+
29
+ ....
30
+
31
+ Integrity::Notifier.register(Integrity::Notifier::IntegrityTwitter)
32
+
33
+ Step 3. Profit! Just kidding. Edit the project and update your twitter username
34
+ and password.
35
+
36
+ Run the tests
37
+ ==================
38
+
39
+ rake spec
40
+
41
+ License
42
+ =======
43
+
44
+ (The MIT License)
45
+
46
+ Copyright (c) 2008 Chris Saylor
47
+ Modified (Forked) 2009 Mark Madsen
48
+
49
+ Permission is hereby granted, free of charge, to any person obtaining
50
+ a copy of this software and associated documentation files (the
51
+ 'Software'), to deal in the Software without restriction, including
52
+ without limitation the rights to use, copy, modify, merge, publish,
53
+ distribute, sublicense, and/or sell copies of the Software, and to
54
+ permit persons to whom the Software is furnished to do so, subject to
55
+ the following conditions:
56
+
57
+ The above copyright notice and this permission notice shall be
58
+ included in all copies or substantial portions of the Software.
59
+
60
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
61
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
62
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
63
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
64
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
65
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
66
+ 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.2') 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 = "Mark Madsen (forked from Chris Saylor)"
10
+ e.email = "mark@___.___"
11
+ e.has_rdoc = false
12
+ e.development_dependencies = []
13
+ e.runtime_dependencies = ['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.2"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["Mark Madsen","Chris Saylor"]
9
+ s.date = %q{2009-07-11}
10
+ s.description = %q{Easily let Integrity tweet after each build}
11
+ s.email = %q{mark@___.___}
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/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.6.12"])
28
+ else
29
+ s.add_dependency(%q<integrity>, [">= 0"])
30
+ s.add_dependency(%q<twitter>, [">= 0.6.12"])
31
+ end
32
+ else
33
+ s.add_dependency(%q<integrity>, [">= 0"])
34
+ s.add_dependency(%q<twitter>, [">= 0.6.12"])
35
+ end
36
+ end
@@ -0,0 +1,7 @@
1
+ %p.normal
2
+ %label{ :for => "integrity_twitter_notifier_email" } Username
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,21 @@
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
+ @httpauth = Twitter::HTTPAuth.new(@config['email'], @config['pass'])
15
+ @tweet = Twitter::Base.new(@httpauth)
16
+ @tweet.post(short_message)
17
+ end
18
+
19
+ end
20
+ end
21
+ 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,87 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: agileanimal-integrity-twitter
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Mark Madsen
8
+ - Chris Saylor
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2009-07-11 00:00:00 -07:00
14
+ default_executable:
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: integrity
18
+ type: :runtime
19
+ version_requirement:
20
+ version_requirements: !ruby/object:Gem::Requirement
21
+ requirements:
22
+ - - ">="
23
+ - !ruby/object:Gem::Version
24
+ version: "0"
25
+ version:
26
+ - !ruby/object:Gem::Dependency
27
+ name: twitter
28
+ type: :runtime
29
+ version_requirement:
30
+ version_requirements: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: 0.6.12
35
+ version:
36
+ description: Easily let Integrity tweet after each build
37
+ email: mark@___.___
38
+ executables: []
39
+
40
+ extensions: []
41
+
42
+ extra_rdoc_files:
43
+ - lib/notifier/config.haml
44
+ - lib/notifier/integrity_twitter.rb
45
+ - README.markdown
46
+ files:
47
+ - integrity-twitter.gemspec
48
+ - lib/notifier/config.haml
49
+ - lib/notifier/integrity_twitter.rb
50
+ - Manifest
51
+ - Rakefile
52
+ - README.markdown
53
+ - spec/integrity_twitter_spec.rb
54
+ - spec/spec_helper.rb
55
+ has_rdoc: false
56
+ homepage: http://integrityapp.com
57
+ post_install_message:
58
+ rdoc_options:
59
+ - --line-numbers
60
+ - --inline-source
61
+ - --title
62
+ - Integrity-twitter
63
+ - --main
64
+ - README.markdown
65
+ require_paths:
66
+ - lib
67
+ required_ruby_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ version: "0"
72
+ version:
73
+ required_rubygems_version: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ version: "1.2"
78
+ version:
79
+ requirements: []
80
+
81
+ rubyforge_project: integrity-twitter
82
+ rubygems_version: 1.2.0
83
+ signing_key:
84
+ specification_version: 2
85
+ summary: Twitter notifier for the Integrity continuous integration server
86
+ test_files: []
87
+