matflores-integrity-tumblr 0.1.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/.document ADDED
@@ -0,0 +1,5 @@
1
+ README.rdoc
2
+ lib/**/*.rb
3
+ bin/*
4
+ features/**/*.feature
5
+ LICENSE
data/.gitignore ADDED
@@ -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.
data/README.markdown ADDED
@@ -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
data/README.rdoc ADDED
@@ -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.
data/Rakefile ADDED
@@ -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.0
@@ -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.0"
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" } Tumblr account's email address
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 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,88 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: matflores-integrity-tumblr
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - "Mat\xC3\xADas Flores"
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-09-21 00:00:00 -07: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: thoughtbot-shoulda
27
+ type: :development
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: Let Integrity post notifications to a Tumblr weblog after each build
36
+ email: mflores@atlanware.com
37
+ executables: []
38
+
39
+ extensions: []
40
+
41
+ extra_rdoc_files:
42
+ - LICENSE
43
+ - README.markdown
44
+ - README.rdoc
45
+ files:
46
+ - .document
47
+ - .gitignore
48
+ - LICENSE
49
+ - README.markdown
50
+ - README.rdoc
51
+ - Rakefile
52
+ - VERSION
53
+ - integrity-tumblr.gemspec
54
+ - lib/integrity/notifier/config.haml
55
+ - lib/integrity/notifier/tumblr.rb
56
+ - lib/integrity/notifier/tumblr_client.rb
57
+ - test/integrity-tumblr_test.rb
58
+ - test/test_helper.rb
59
+ has_rdoc: false
60
+ homepage: http://github.com/matflores/integrity-tumblr
61
+ licenses:
62
+ post_install_message:
63
+ rdoc_options:
64
+ - --charset=UTF-8
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: "0"
78
+ version:
79
+ requirements: []
80
+
81
+ rubyforge_project: integrity
82
+ rubygems_version: 1.3.5
83
+ signing_key:
84
+ specification_version: 3
85
+ summary: Tumblr notifier for the Integrity continuous integration server
86
+ test_files:
87
+ - test/test_helper.rb
88
+ - test/integrity-tumblr_test.rb