Skip to content

Instantly share code, notes, and snippets.

@lifo
lifo / evil.rb
Created January 13, 2009 04:21
module Rack
class Evil
def initialize(app)
@app = app
end
def call(env)
catch(:response) { @app.call(env) }
end
end
Query String : x[y][z][]=10&x[y][z][]=5
Rails : [["x[y][z][]", "10"], ["x[y][z][]", "5"]]
Rack::Utils : [["x[y][z][]", ["10", "5"]]]
commit 96e2c827ea2d6f147fbcfc1d986f39f146df3b6e
Author: Pratik Naik <[email protected]>
Date: Sun Dec 28 16:03:49 2008 +0000
Revert "Revert inline docs"
This reverts commit aaea12c497ca86a86fbda8409c226630ade22f89.
diff --git a/actionpack/lib/action_controller/routing/route_set.rb b/actionpack/lib/action_controller/routing/route_set.rb
index 13646ae..d4c53ff 100644
diff --git a/actionpack/lib/action_controller/test_process.rb b/actionpack/lib/action_controller/test_process.rb
index dddad17..acfb10c 100644
--- a/actionpack/lib/action_controller/test_process.rb
+++ b/actionpack/lib/action_controller/test_process.rb
@@ -388,20 +388,33 @@ module ActionController #:nodoc:
module TestProcess
def self.included(base)
- # execute the request simulating a specific HTTP method and set/volley the response
- # TODO: this should be un-DRY'ed for the sake of API documentation.
# Allow the metal piece to run in isolation
require(File.dirname(__FILE__) + "/../../config/environment") unless defined?(Rails)
class Scaling
def self.call(env)
if env["PATH_INFO"] =~ /^\/scaling/
[200, {"Content-Type" => "text/html"}, ["Hello, World!"]]
else
[404, {"Content-Type" => "text/html"}, ["Not Found"]]
end
/*
apxs -c mod_helloworld.c
LoadModule helloworld_module modules/mod_helloworld.so
<Location /helloworld>
SetHandler helloworld
</Location>
*/
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>
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"
@lifo
lifo / run.rb
Created November 24, 2008 14:09
module Hello
autoload "World", "world"
class << self
def run
World.after
end
end
end
@lifo
lifo / README
Created November 20, 2008 18:53
[lifo@null rock (master)]$ ruby extconf.rb && make
[lifo@null rock (master)]$ ruby run.rb