Permalink
Browse files

RIP

  • Loading branch information...
1 parent aacd071 commit 01a4af701b70df1ac6fc328a74599b0a45f0ee4d @sr sr committed Dec 9, 2009
Showing with 1 addition and 259 deletions.
  1. +1 −0 README
  2. +0 −50 README.markdown
  3. +0 −11 Rakefile
  4. +0 −31 integrity-campfire.gemspec
  5. +0 −47 lib/integrity/notifier/campfire.rb
  6. +0 −19 lib/integrity/notifier/config.haml
  7. +0 −63 test/campfire_test.rb
  8. +0 −38 test/helper.rb
View
@@ -0,0 +1 @@
+The Campfire notifier is now part of Integrity itself
View
@@ -1,50 +0,0 @@
-Integrity
-=========
-
-[Integrity][] is your friendly automated Continuous Integration server.
-
-Integrity Campfire Notifier
-===========================
-
-This lets Integrity alert Campfire after each build is made.
-
-Setup Instructions
-==================
-
-Just install this gem via `gem install integrity-campfire`
-and then in your Rackup (ie, `config.ru`) file:
-
- require "rubygems"
- require "integrity/notifier/campfire"
-
-And badabing! Now you can set up your projects to alert Campfire after
-each build (just edit the project and the config options should be
-there)
-
-License
-=======
-
-(The MIT License)
-
-Copyright (c) 2008, 2009 Chris Wanstrath
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-'Software'), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-[Integrity]: http://integrityapp.com
View
@@ -1,11 +0,0 @@
-task :default => :test
-
-task :test do
- ruby "test/campfire_test.rb"
-end
-
-begin
- require "mg"
- MG.new("integrity-campfire.gemspec")
-rescue LoadError
-end
@@ -1,31 +0,0 @@
-Gem::Specification.new do |s|
- s.name = "integrity-campfire"
- s.version = "1.2.0"
- s.date = "2009-3-26"
- s.summary = "Campfire notifier for the Integrity continuous integration server"
- s.description = "Easily let Integrity alert Campfire after each build"
- s.homepage = "http://integrityapp.com"
- s.email = "chris@ozmm.org"
- s.authors = ["Chris Wanstrath"]
- s.has_rdoc = false
-
- s.rubyforge_project = "integrity"
-
- s.add_dependency "integrity"
- s.add_dependency "tinder"
-
- if s.respond_to?(:add_development_dependency)
- s.add_development_dependency "mocha"
- s.add_development_dependency "sr-mg"
- end
-
- s.files = %w[
-README.markdown
-Rakefile
-integrity-campfire.gemspec
-lib/integrity/notifier/campfire.rb
-lib/integrity/notifier/config.haml
-test/campfire_test.rb
-test/helper.rb
-]
-end
@@ -1,47 +0,0 @@
-require "integrity"
-require "tinder"
-
-module Integrity
- class Notifier
- class Campfire < Notifier::Base
- attr_reader :config
-
- def self.to_haml
- File.read File.dirname(__FILE__) / "config.haml"
- end
-
- def deliver!
- room.speak "#{short_message}. #{commit_url}"
- room.paste full_message if commit.failed?
- room.leave
- end
-
- private
- def room
- @room ||= begin
- options = {}
- options[:ssl] = config["use_ssl"] ? true : false
- campfire = Tinder::Campfire.new(config["account"], options)
- campfire.login(config["user"], config["pass"])
- campfire.find_room_by_name(config["room"])
- end
- end
-
- def short_message
- "Build #{commit.short_identifier} of #{commit.project.name} #{commit.successful? ? "was successful" : "failed"}"
- end
-
- def full_message
- <<-EOM
-Commit Message: #{commit.message}
-Commit Date: #{commit.committed_at}
-Commit Author: #{commit.author.name}
-
-#{stripped_commit_output}
-EOM
- end
- end
-
- register Campfire
- end
-end
@@ -1,19 +0,0 @@
-%p.normal
- %label{ :for => "campfire_notifier_account" } Subdomain
- %input.text#campfire_notifier_account{ :name => "notifiers[Campfire][account]", :type => "text", :value => config["account"] }
-
-%p.normal
- %label{ :for => "campfire_notifier_use_ssl" } SSL?
- %input#campfire_notifier_use_ssl{ :name => "notifiers[Campfire][use_ssl]", :type => "checkbox", :checked => config["use_ssl"], :value => "1" }
-
-%p.normal
- %label{ :for => "campfire_notifier_room" } Room Name
- %input.text#campfire_notifier_room{ :name => "notifiers[Campfire][room]", :type => "text", :value => config["room"] }
-
-%p.normal
- %label{ :for => "campfire_notifier_user" } User
- %input.text#campfire_notifier_user{ :name => "notifiers[Campfire][user]", :value => config["user"], :type => "text" }
-
-%p.normal
- %label{ :for => "campfire_notifier_pass" } Password
- %input.text#campfire_notifier_pass{ :name => "notifiers[Campfire][pass]", :value => config["pass"], :type => "text" }
View
@@ -1,63 +0,0 @@
-require File.dirname(__FILE__) + "/helper"
-
-context "The Campfire notifier" do
- setup do
- setup_database
-
- @config = { "account" => "integrity",
- "use_ssl" => false,
- "room" => "ci",
- "user" => "foo",
- "pass" => "bar" }
- @notifier = Integrity::Notifier::Campfire
- @room = stub(:speak => nil, :paste => nil, :leave => nil)
- end
-
- def notifier
- "Campfire"
- end
-
- test "it registers itself" do
- assert_equal @notifier, Integrity::Notifier.available["Campfire"]
- end
-
- test "configuration form" do
- assert_form_have_option "account", @config["account"]
- assert_form_have_option "use_ssl", @config["use_ssl"]
- assert_form_have_option "room", @config["room"]
- assert_form_have_option "user", @config["user"]
- assert_form_have_option "pass", @config["pass"]
- end
-
- test "ssl" do
- @config["use_ssl"] = true
-
- Tinder::Campfire.expects(:new).with(@config["account"], { :ssl => true }).
- returns(stub(:login => true, :find_room_by_name => @room))
-
- @notifier.notify_of_build(Integrity::Build.gen, @config)
- end
-
- test "successful build" do
- build = Integrity::Build.gen(:successful)
-
- @notifier.any_instance.stubs(:room).at_least_once.returns(@room)
- @room.expects(:speak).with { |value| value.include?(build.commit.identifier) }
- @room.expects(:paste).never
-
- @notifier.notify_of_build(build, @config)
- end
-
- test "failed build" do
- build = Integrity::Build.gen(:failed)
-
- @notifier.any_instance.stubs(:room).at_least_once.returns(@room)
- @room.expects(:speak).with { |value| value.include?(build.commit.identifier) }
- @room.expects(:paste).with { |value|
- value.include?(build.commit.message) &&
- value.include?(build.output)
- }
-
- @notifier.notify_of_build(build, @config)
- end
-end
View
@@ -1,38 +0,0 @@
-require "test/unit"
-require "mocha"
-require "integrity/notifier/test"
-require File.dirname(__FILE__) + "/../lib/integrity/notifier/campfire"
-
-begin
- require "redgreen"
-rescue LoadError
-end
-
-class Test::Unit::TestCase
- include Integrity::Notifier::Test
-end
-
-# NOTE: Because of a bug in integrity/notifier/test/fixtures
-class Array
- def pick
- slice(Kernel.rand(size))
- end
-end
-
-##
-# test/spec/mini 2
-# http://gist.github.com/25455
-# chris@ozmm.org
-#
-def context(*args, &block)
- return super unless (name = args.first) && block
- klass = Class.new(defined?(ActiveSupport::TestCase) ? ActiveSupport::TestCase : Test::Unit::TestCase) do
- def self.test(name, &block)
- define_method("test_#{name.gsub(/\W/,"_")}", &block) if block
- end
- def self.xtest(*args) end
- def self.setup(&block) define_method(:setup, &block) end
- def self.teardown(&block) define_method(:teardown, &block) end
- end
- klass.class_eval &block
-end

0 comments on commit 01a4af7

Please sign in to comment.