Skip to content

Instantly share code, notes, and snippets.

require File.dirname(__FILE__) + '/test_helper.rb'
module SuperAwesomeTests
def test_truth_from_module
assert true
end
end
class TestModular < Test::Unit::TestCase
include SuperAwesomeTests
require 'rubygems'
require 'ruby2ruby'
class Hello
def wtf(&block)
puts block.to_ruby
end
end
Hello.new.wtf do
require 'rubygems'
require 'ruby-prof'
RubyProf.measure_mode = RubyProf::PROCESS_TIME
RubyProf.start
require 'config/environment'
results = RubyProf.stop
File.open "loading-graph.html", 'w' do |file|
RubyProf::GraphHtmlPrinter.new(results).print(file)
$: << "/Users/lifo/Rails/sinatra/lib"
require 'rubygems'
require 'sinatra'
require 'sinatra/test/unit'
require 'app'
class Rack::Response
attr_accessor :variables
end
module Hello
module World
class << self
def lol
puts "lol"
end
end
end
end
class AsyncApp
# This is a template async response. N.B. Can't use string for body on 1.9
AsyncResponse = [-1, {}, []].freeze
def call(env)
body = DeferrableBody.new
EventMachine::next_tick { env['async.callback'].call [200, {'Content-Type' => 'text/plain'}, body] }
@lifo
lifo / README
Created November 20, 2008 18:53
[lifo@null rock (master)]$ ruby extconf.rb && make
[lifo@null rock (master)]$ ruby run.rb
@lifo
lifo / run.rb
Created November 24, 2008 14:09
module Hello
autoload "World", "world"
class << self
def run
World.after
end
end
end
run "rm public/index.html"
generate(:scaffold, "item name:string")
route "map.root :controller => :items"
rake("db:migrate", "production")
gem 'ruby-openid'
gem 'will-paginate', :git => 'git://github.com/mislav/will_paginate.git'
gem "hpricot", :version => '0.6', :source => "http://code.whytheluckystiff.net"
ServerRoot "/Users/lifo/Apache/install"
Listen 8080
# ErrorLog "logs/error_log"
# LogLevel debug
PassengerRoot /Users/lifo/Apache/src/passenger
PassengerRuby /opt/local/bin/ruby
<VirtualHost *:8080>