integrity-tumblr 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,5 @@
1
+ README.rdoc
2
+ lib/**/*.rb
3
+ bin/*
4
+ features/**/*.feature
5
+ LICENSE
@@ -0,0 +1,5 @@
1
+ *.sw?
2
+ .DS_Store
3
+ coverage
4
+ rdoc
5
+ pkg
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ (The MIT License)
2
+
3
+ Copyright (c) 2009 Matías Flores
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,51 @@
1
+ Integrity
2
+ =========
3
+
4
+ [Integrity][] is your friendly automated Continuous Integration server.
5
+
6
+ Integrity Tumblr Notifier
7
+ =========================
8
+
9
+ This lets Integrity post notifications to a Tumblr weblog after each build is made.
10
+
11
+ Setup Instructions
12
+ ==================
13
+
14
+ Just install this gem via `sudo gem install matflores-integrity-tumblr` and then in your
15
+ Rackup (ie, `config.ru`) file:
16
+
17
+ require "rubygems"
18
+ require "integrity/notifier/tumblr"
19
+
20
+ And badabing! Now you can set up your projects to post notifications to your
21
+ Tumblr weblog after each build (just edit the project and the config options
22
+ should be there)
23
+
24
+ License
25
+ =======
26
+
27
+ (The MIT License)
28
+
29
+ Copyright (c) 2009 [Matías Flores][matflores]
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
45
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
46
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
47
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
48
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
49
+
50
+ [Integrity]: http://integrityapp.com
51
+ [matflores]: http://matflores.com
@@ -0,0 +1,7 @@
1
+ = integrity-tumblr
2
+
3
+ A Tumblr based notifier for the Integrity continuous integration server.
4
+
5
+ == Copyright
6
+
7
+ Copyright (c) 2009 Matías Flores. See LICENSE for details.
@@ -0,0 +1,58 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ begin
5
+ require 'jeweler'
6
+ Jeweler::Tasks.new do |gem|
7
+ gem.name = "integrity-tumblr"
8
+ gem.summary = "Tumblr notifier for the Integrity continuous integration server"
9
+ gem.description = "Let Integrity post notifications to a Tumblr weblog after each build"
10
+ gem.email = "mflores@atlanware.com"
11
+ gem.homepage = "http://github.com/matflores/integrity-tumblr"
12
+ gem.authors = ["Matías Flores"]
13
+ gem.add_dependency "integrity"
14
+ gem.add_development_dependency "thoughtbot-shoulda"
15
+ gem.rubyforge_project = "integrity"
16
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
17
+ end
18
+ rescue LoadError
19
+ puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
20
+ end
21
+
22
+ require 'rake/testtask'
23
+ Rake::TestTask.new(:test) do |test|
24
+ test.libs << 'lib' << 'test'
25
+ test.pattern = 'test/**/*_test.rb'
26
+ test.verbose = true
27
+ end
28
+
29
+ begin
30
+ require 'rcov/rcovtask'
31
+ Rcov::RcovTask.new do |test|
32
+ test.libs << 'test'
33
+ test.pattern = 'test/**/*_test.rb'
34
+ test.verbose = true
35
+ end
36
+ rescue LoadError
37
+ task :rcov do
38
+ abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
39
+ end
40
+ end
41
+
42
+ task :test => :check_dependencies
43
+
44
+ task :default => :test
45
+
46
+ require 'rake/rdoctask'
47
+ Rake::RDocTask.new do |rdoc|
48
+ if File.exist?('VERSION')
49
+ version = File.read('VERSION')
50
+ else
51
+ version = ""
52
+ end
53
+
54
+ rdoc.rdoc_dir = 'rdoc'
55
+ rdoc.title = "integrity-tumblr #{version}"
56
+ rdoc.rdoc_files.include('README*')
57
+ rdoc.rdoc_files.include('lib/**/*.rb')
58
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.1
@@ -0,0 +1,61 @@
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-tumblr}
8
+ s.version = "0.1.1"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Mat\303\255as Flores"]
12
+ s.date = %q{2009-09-21}
13
+ s.description = %q{Let Integrity post notifications to a Tumblr weblog after each build}
14
+ s.email = %q{mflores@atlanware.com}
15
+ s.extra_rdoc_files = [
16
+ "LICENSE",
17
+ "README.markdown",
18
+ "README.rdoc"
19
+ ]
20
+ s.files = [
21
+ ".document",
22
+ ".gitignore",
23
+ "LICENSE",
24
+ "README.markdown",
25
+ "README.rdoc",
26
+ "Rakefile",
27
+ "VERSION",
28
+ "integrity-tumblr.gemspec",
29
+ "lib/integrity/notifier/config.haml",
30
+ "lib/integrity/notifier/tumblr.rb",
31
+ "lib/integrity/notifier/tumblr_client.rb",
32
+ "test/integrity-tumblr_test.rb",
33
+ "test/test_helper.rb"
34
+ ]
35
+ s.homepage = %q{http://github.com/matflores/integrity-tumblr}
36
+ s.rdoc_options = ["--charset=UTF-8"]
37
+ s.require_paths = ["lib"]
38
+ s.rubyforge_project = %q{integrity}
39
+ s.rubygems_version = %q{1.3.5}
40
+ s.summary = %q{Tumblr notifier for the Integrity continuous integration server}
41
+ s.test_files = [
42
+ "test/test_helper.rb",
43
+ "test/integrity-tumblr_test.rb"
44
+ ]
45
+
46
+ if s.respond_to? :specification_version then
47
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
48
+ s.specification_version = 3
49
+
50
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
51
+ s.add_runtime_dependency(%q<integrity>, [">= 0"])
52
+ s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
53
+ else
54
+ s.add_dependency(%q<integrity>, [">= 0"])
55
+ s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
56
+ end
57
+ else
58
+ s.add_dependency(%q<integrity>, [">= 0"])
59
+ s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
60
+ end
61
+ end
@@ -0,0 +1,7 @@
1
+ %p.normal
2
+ %label{ :for => "tumblr_notifier_email" } Email
3
+ %input.text#tumblr_notifier_email{ :name => "notifiers[Tumblr][email]", :value => config['email'], :type => 'text' }
4
+
5
+ %p.normal
6
+ %label{ :for => "tumblr_notifier_password" } Password
7
+ %input.text#tumblr_notifier_password{ :name => "notifiers[Tumblr][password]", :value => config['password'], :type => 'text' }
@@ -0,0 +1,24 @@
1
+ require 'integrity'
2
+ require File.dirname(__FILE__) + '/tumblr_client.rb'
3
+
4
+ module Integrity
5
+ class Notifier
6
+ class Tumblr < Notifier::Base
7
+ attr_reader :config
8
+
9
+ def self.to_haml
10
+ File.read(File.dirname(__FILE__) + "/config.haml")
11
+ end
12
+
13
+ def deliver!
14
+ TumblrClient.post(config['email'], config['password'], short_message, full_message)
15
+ end
16
+
17
+ def to_s
18
+ 'Tumblr'
19
+ end
20
+ end
21
+
22
+ register Tumblr
23
+ end
24
+ end
@@ -0,0 +1,16 @@
1
+ require 'httparty'
2
+
3
+ module Integrity
4
+ class Notifier
5
+ class TumblrClient
6
+ def self.post(email, password, title, body)
7
+ HTTParty.post 'http://www.tumblr.com/api/write', :body => { :email => email,
8
+ :password => password,
9
+ :type => 'regular',
10
+ :title => title,
11
+ :body => body,
12
+ :generator => 'integrity-tumblr notifier' }
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,42 @@
1
+ require 'test_helper'
2
+ require 'integrity/notifier/test'
3
+ require 'integrity/notifier/tumblr'
4
+
5
+ begin
6
+ require "redgreen"
7
+ rescue LoadError
8
+ end
9
+
10
+ class IntegrityTumblrTest < Test::Unit::TestCase
11
+ include Integrity::Notifier::Test
12
+
13
+ def notifier
14
+ "Tumblr"
15
+ end
16
+
17
+ context "A tumblr-based notifier" do
18
+ setup { setup_database }
19
+
20
+ should "register itself" do
21
+ assert_equal Integrity::Notifier::Tumblr,
22
+ Integrity::Notifier.available["Tumblr"]
23
+ end
24
+
25
+ should "have a configuration form" do
26
+ assert_form_have_option "email", "foo@example.org"
27
+ assert_form_have_option "password", "secret"
28
+ end
29
+
30
+ [:successful, :failed, :pending].each do |status|
31
+ should "post a notification to the tumblelog after completing a #{status} build" do
32
+ commit = Integrity::Commit.gen(status)
33
+ config = { :email => "foo@example.org", :password => "secret" }
34
+ notifier = Integrity::Notifier::Tumblr.new(commit, config)
35
+
36
+ mock(Integrity::Notifier::TumblrClient).post(config['email'], config['password'], notifier.short_message, notifier.full_message)
37
+
38
+ notifier.deliver!
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,11 @@
1
+ require 'rubygems'
2
+ require 'test/unit'
3
+ require 'shoulda'
4
+ require 'rr'
5
+
6
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
7
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
8
+
9
+ class Test::Unit::TestCase
10
+ include RR::Adapters::TestUnit
11
+ end
metadata ADDED
@@ -0,0 +1,100 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: integrity-tumblr
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 1
8
+ - 1
9
+ version: 0.1.1
10
+ platform: ruby
11
+ authors:
12
+ - "Mat\xC3\xADas Flores"
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2009-09-21 00:00:00 -03:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: integrity
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 0
29
+ version: "0"
30
+ type: :runtime
31
+ version_requirements: *id001
32
+ - !ruby/object:Gem::Dependency
33
+ name: thoughtbot-shoulda
34
+ prerelease: false
35
+ requirement: &id002 !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ segments:
40
+ - 0
41
+ version: "0"
42
+ type: :development
43
+ version_requirements: *id002
44
+ description: Let Integrity post notifications to a Tumblr weblog after each build
45
+ email: mflores@atlanware.com
46
+ executables: []
47
+
48
+ extensions: []
49
+
50
+ extra_rdoc_files:
51
+ - LICENSE
52
+ - README.markdown
53
+ - README.rdoc
54
+ files:
55
+ - .document
56
+ - .gitignore
57
+ - LICENSE
58
+ - README.markdown
59
+ - README.rdoc
60
+ - Rakefile
61
+ - VERSION
62
+ - integrity-tumblr.gemspec
63
+ - lib/integrity/notifier/config.haml
64
+ - lib/integrity/notifier/tumblr.rb
65
+ - lib/integrity/notifier/tumblr_client.rb
66
+ - test/integrity-tumblr_test.rb
67
+ - test/test_helper.rb
68
+ has_rdoc: true
69
+ homepage: http://github.com/matflores/integrity-tumblr
70
+ licenses: []
71
+
72
+ post_install_message:
73
+ rdoc_options:
74
+ - --charset=UTF-8
75
+ require_paths:
76
+ - lib
77
+ required_ruby_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ segments:
82
+ - 0
83
+ version: "0"
84
+ required_rubygems_version: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ segments:
89
+ - 0
90
+ version: "0"
91
+ requirements: []
92
+
93
+ rubyforge_project: integrity
94
+ rubygems_version: 1.3.6
95
+ signing_key:
96
+ specification_version: 3
97
+ summary: Tumblr notifier for the Integrity continuous integration server
98
+ test_files:
99
+ - test/test_helper.rb
100
+ - test/integrity-tumblr_test.rb