Skip to content

Instantly share code, notes, and snippets.

Pepper:erector chaffee$ git diff-files -c
:100644 100644 47fcf59261053f998aa62dd805079c236a1b45d0 0000000000000000000000000000000000000000 M README.txt
:100644 100644 b7e83edbdaa1d22cba334344a3536359ae492e79 0000000000000000000000000000000000000000 M VERSION.yml
:100755 100755 d0c7c2dc263d3a32d9ed3c88979896fefd0a5195 0000000000000000000000000000000000000000 M bin/erector
:100644 100644 c84df84ea71902cfc84e8d8332aa9fbcf339c897 0000000000000000000000000000000000000000 M lib/erector.rb
:100644 100644 40749e103f221e86a469aef8be92696873da7428 0000000000000000000000000000000000000000 M lib/erector/erect.rb
:100644 100644 0374a1634e2209a4d07e39ffd5253f6ef68694bb 0000000000000000000000000000000000000000 M lib/erector/erected.rb
:100644 100644 84a3e67301d0da2c03c151e06924f218cb495b3d 0000000000000000000000000000000000000000 M lib/erector/extensions/object.rb
:100644 100644 a5f238ffe5a87936a9fed26d38dd3afaf63b8ccc 0000000000000000000000000000000000000000 M lib/erector/externals.rb
:100644 100644 1d16418f79b1ee3007f3951
# == Schema Information
# Schema version: 10
#
# Table name: descriptions
#
# id :integer(4) not null, primary key
# type :string(255) not null
# person_id :integer(4) not null
# mood_id :integer(4) not null
# value :integer(4) not null
# a Rack middleware component that enables ActiveRecord query caching
# To use, put "use QueryCaching" in your Sinatra app.
class QueryCaching
def initialize(app)
@app = app
end
def call(env)
if is_static_file?(env)
# Wraps the passed-in block in an expando/collapso triangle thingy.
# Uses "arrows.png" which is a sprite that I think I got from jQuery.
class Expando < Erector::Widget
needs :title, :expanded => false
external :js, "/lib/jquery.livequery.js"
external :style, <<-STYLE
.expando .title {
require 'rubygems'
require 'tlsmail' # http://rubyforge.org/projects/tlsmail/
# see also http://www.stephenchu.com/2006/06/how-to-use-gmail-smtp-server-to-send.html
# Message - minimal emailer
# Author: Alex Chaffee <[email protected]>
#
# Usage:
#
require 'rubygems'
require 'sinatra/base'
class Fail < Sinatra::Base
error do
"Failed"
end
get "/" do
raise "OMG"
 
 
PSFR100
 
3:53
gerrycanavan: 
PSFR 100! Anything can happen.
3:53
class Comparison
@@window = 64
@@prelude = 12
def self.window
@@window
end
def self.window=(val)
@@window = val
def capturing_output
original = $stdout
captured = StringIO.new
$stdout = captured
yield
captured.string
ensure
# allow nesting
if original.is_a? StringIO
original << captured.string
require "minitest/spec"
MiniTest::Unit.autorun
module DescribeBug
class Foo
def ==(other)
other.is_a? Foo
end
end