Skip to content

Instantly share code, notes, and snippets.

.....
# create a transaction which records the details of the notification
object.txns.create(:transaction_id => ipn.transaction_id,
:amount => ipn.gross,
:fee => ipn.fee,
:currency_type => ipn.currency,
:status => ipn.status,
:received_at => ipn.received_at)
# if ipn.acknowledge
ack = nil
@yortz
yortz / Capfile.rb
Created October 19, 2009 15:02 — forked from roidrage/Capfile.rb
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
set :application, "host.name"
set :domain, "host.name"
set :repository, "git@github.com:user/jekyll-blog.git"
set :use_sudo, false
set :deploy_to, "/var/www/#{application}"
ssh_options[:forward_agent] = true
default_run_options[:pty] = true
@yortz
yortz / Rakefile
Created October 19, 2009 15:02 — forked from jlong/Rakefile
require 'active_support'
def ok_failed(condition)
if (condition)
puts "OK"
else
puts "FAILED"
end
end
set :user, "deploy"
set :deploy_to, "/usr/local/www/nb_blog_jekyll"
set :jekyll_command, "/usr/local/jekyll/bin/jekyll --lsi"
role :web, "blog.new-bamboo.co.uk"
task :deploy do
run "cd #{deploy_to}; git pull; #{jekyll_command}; exit 0"
end
@yortz
yortz / gist:258928
Created December 17, 2009 18:43 — forked from mrichman/gist:118095
Cucumber is a Integration test harness, so your features should be
specifying who can authenticate via what URLs and your steps should be
exercising the controllers an filters that enforce those features.
The point being, you should be going through your views and hitting
the database, checking to see if the http response body contains what
you expect to see and not worrying about directly testing authlogic
itself.
# Authentication.feature
#!/usr/bin/env ruby
# Written by Kieran P
# http://github.com/KieranP
# http://twitter.com/k776
# http://k776.tumblr.com
#
# Feel free to fork and modify.
# If you do, send me a message on
# Github details changes and I'll
#!/usr/bin/env ruby
# Written by Kieran P
# http://github.com/KieranP
# http://twitter.com/k776
# http://k776.tumblr.com
#
# Feel free to fork and modify.
# If you do, send me a message on
# Github details changes and I'll
#!/usr/bin/env ruby
# Written by Kieran P
# http://github.com/KieranP
# http://twitter.com/k776
# http://k776.tumblr.com
#
# Feel free to fork and modify.
# If you do, send me a message on
# Github details changes and I'll
require 'rack/test'
require 'webrat'
require File.expand_path(File.dirname(__FILE__) + '/../../lib/stats')
Webrat.configure do |config|
config.mode = :rack
end
Stats::App.set :environment, 'cucumber'
Stats::App.enable :raise_errors
@yortz
yortz / spec.rb
Created February 14, 2010 16:59 — forked from jnicklas/spec.rb
require 'rubygems'
require 'spec'
require 'spec/autorun'
require 'capybara'
require 'capybara/dsl'
Capybara.app = proc { |env| [200, {}, "Hello World"]}
Spec::Runner.configure do |config|
config.include Capybara