Skip to content

Instantly share code, notes, and snippets.

context "fills in the search form and clicks the search button that" do
setup do
@searched_for_page = Factory(:page, :slug => "interesting", :translations => [Factory(:page_translation, :page_name => 'An interesting query')])
ActsAsXapian.update_index(true, true)
@query_string = "interesting"
fill_in "q", :with => @query_string
click_button "search_button"
save_and_open_page
end
namespace :metrics do
namespace :check do
desc 'Fails the build if the metrics thresholds are not met'
task :thresholds => :'metrics:all' do
report_file_name = ""
if ENV['CC_BUILD_ARTIFACTS'] != nil
report_file_name = ENV['CC_BUILD_ARTIFACTS'] + '/report.yml'
else
report_file_name = RAILS_ROOT + '/tmp/metric_fu/report.yml'
end
* executing "cd /u/apps/staging-theorytest/releases/20100210170118; rake RAILS_ENV=staging db:migrate"
servers: ["joe.dh.bytemark.co.uk"]
[joe.dh.bytemark.co.uk] executing command
** [out :: joe.dh.bytemark.co.uk] (in /u/apps/staging-theorytest/releases/20100210170118)
** [out :: joe.dh.bytemark.co.uk] == CreateVehicleCategories: migrating ========================================
** [out :: joe.dh.bytemark.co.uk] -- create_table(:vehicle_categories)
** [out :: joe.dh.bytemark.co.uk] rake aborted!
** [out :: joe.dh.bytemark.co.uk]
** [out :: joe.dh.bytemark.co.uk] An error has occurred, all later migrations canceled:
** [out :: joe.dh.bytemark.co.uk]
User.find(:all, :conditions => {:created_at => 2.days.ago..1.day.ago})
# =>
# User Load (0.3ms) SELECT * FROM "users" WHERE ("users"."created_at" BETWEEN '2010-08-09 05:31:57' AND '2010-08-10 05:31:57')
User.find(:all, :conditions => {:created_at => 2.days.ago...1.day.ago})
# =>
# User Load (0.3ms) SELECT * FROM "users" WHERE ("users"."created_at" >= '2010-08-09 05:36:19' AND "users"."created_at" < '2010-08-10 05:36:19')
[2011-02-11 18:53:18] ./Configure darwin64-x86_64-cc -I/Users/tim/.rvm/usr/include -L/Users/tim/.rvm/usr/lib --prefix=/Users/tim/.rvm/usr zlib no-asm no-krb5 shared --build=x86_64-apple-darwin10.6.0 --host=x86_64-apple-darwin10.6.0
Usage: Configure [no-<cipher> ...] [enable-<cipher> ...] [experimental-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [enable-montasm] [no-asm] [no-dso] [no-krb5] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--test-sanity] os/compiler[:flags]
@timharding
timharding / Ruby 1.8.7?!
Created February 11, 2011 19:34
Why is ruby 1.8.7, the system ruby showing up here?
tim@thefactory:~/Documents/Development/theorytest(redirect_to_partner_site)$ cat .rvmrc
rvm 1.8.6@theorytest
tim@thefactory:~/Documents/Development/theorytest(redirect_to_partner_site)$ which rake
/Users/tim/.rvm/gems/ruby-1.8.6-p399/bin/rake
tim@thefactory:~/Documents/Development/theorytest(redirect_to_partner_site)$ which ruby
/Users/tim/.rvm/rubies/ruby-1.8.6-p399/bin/ruby
tim@thefactory:~/Documents/Development/theorytest(redirect_to_partner_site)$ which rake
/Users/tim/.rvm/gems/ruby-1.8.6-p399/bin/rake
tim@thefactory:~/Documents/Development/theorytest(redirect_to_partner_site)$ rake
(in /Users/tim/Documents/Development/theorytest)
@timharding
timharding / event_machine_hellow_world.rb
Created November 3, 2011 22:12
EventMachine hello world...
require 'rubygems'
require 'eventmachine'
require 'evma_httpserver'
class Handler < EventMachine::Connection
include EventMachine::HttpServer
def process_http_request
resp = EventMachine::DelegatedHttpResponse.new( self )
@timharding
timharding / thin_hello_world.rb
Created November 3, 2011 22:35
Thin hello world...
app = proc do |env|
[
200,
{
'Content-Type' => 'text/html',
'Content-Length' => '2'
},
'Hi!'
]
end
@timharding
timharding / iotu.rb
Last active December 10, 2015 11:18
A program that merges together the various archive and current feeds for In Our Time with Melvyn Bragg and delivers one feed with all the programmes ordered by broadcast date.
# a program that merges together the various archive and current
# feeds for In Our Time with Melvyn Bragg and delivers one feed
# with all the programmes ordered by broadcast date.
# this was very helpful
# http://www.subelsky.com/2007/08/roll-your-own-podcast-feed-with-rails.html
require 'rss'
require 'open-uri'
RAW_POST_DATA
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<probe type=\"yaml\"><![CDATA[\n--- !ruby/object:Time {}\n\n]]></probe>"
REMOTE_ADDR
"188.120.254.74"