Skip to content

Instantly share code, notes, and snippets.

View peleteiro's full-sized avatar
🏠
Working from home

Jose Peleteiro peleteiro

🏠
Working from home
View GitHub Profile
require 'spec/matchers/wrap_expectation'
require 'nokogiri'
class BeHtmlWith
def matches?(stwing, &block)
@scope.wrap_expectation self do
begin
bwock = block || @block || proc{}
builder = Nokogiri::HTML::Builder.new(&bwock)
match = builder.doc.root
@peleteiro
peleteiro / url_dsl.rb
Created December 14, 2009 19:26 — forked from defunkt/url_dsl.rb
require 'open-uri'
# url dsl -- the ultimate url dsl!
#
# You just can't beat this:
#
# $ irb -r url_dsl
# >> include URLDSL
# => Object
# >> http://github.com/defunkt.json
# http://unicorn.bogomips.org/SIGNALS.html
rails_env = ENV['RAILS_ENV'] || 'production'
rails_root = ENV['RAILS_ROOT'] || "/data/github/current"
God.watch do |w|
w.name = "unicorn"
w.interval = 30.seconds # default
# unicorn needs to be run from the rails root
#!/usr/bin/env ruby
$:.unshift File.dirname(__FILE__)+"/../lib"
require 'mongomapper'
require 'irb'
IRB.setup(nil)
irb = IRB::Irb.new
IRB.conf[:MAIN_CONTEXT] = irb.context