Skip to content

Instantly share code, notes, and snippets.

@jkraemer
jkraemer / gist:885592
Created March 24, 2011 18:37
monkey patch for test::unit for testing evented libraries
require 'em-synchrony'
require 'test/unit/autorunner'
# Patch test::unit to run stuff inside the EM reactor
module Test
module Unit
class AutoRunner
alias_method :run_alias, :run
module DigestAuthForFunctionalTests
def authenticate_with_http_digest(user = 'admin', password = 'admin', realm = 'Application')
unless ActionController::Base < ActionController::Testing
ActionController::Base.class_eval { include ActionController::Testing }
end
@controller.instance_eval %Q(
alias real_process_with_new_base_test process_with_new_base_test
def process_with_new_base_test(request, response)
# This file is used by Rack-based servers to start the application.
require ::File.expand_path('../config/environment', __FILE__)
require ::File.expand_path('../lib/devise_basic_auth_fix', __FILE__)
use DeviseBasicAuthFix
run MyApp::Application
git clone http://github.com/dbalmain/ferret.git
cd ferret/ruby
rake package
gem install pkg/ferret-0.11.8.1.gem
lib/cap-git-archive.rb:
-------------------------------------------------
require 'capistrano/recipes/deploy/scm/git'
Capistrano::Deploy::SCM::Git.class_eval do
def export(revision, destination)
git = command
execute = []
args = []
args << '--format=tar'
git.rb | 22 +++++++++++++++++++---
1 file changed, 19 insertions(+), 3 deletions(-)
--- ./capistrano/recipes/deploy/scm/git.rb.orig
+++ ./capistrano/recipes/deploy/scm/git.rb
@@ -157,10 +157,26 @@
execute.join(" && ")
end
- # An expensive export. Performs a checkout as above, then
- # removes the repo.