Skip to content

Instantly share code, notes, and snippets.

@chischaschos
Created November 12, 2010 20:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chischaschos/674599 to your computer and use it in GitHub Desktop.
Save chischaschos/674599 to your computer and use it in GitHub Desktop.
module Rack
require 'rails/all'
class Actor < ::ActiveRecord::Base
end
class ActiveRecord
def initialize
setup
end
def call(env)
[200, { 'Content-Type' => 'text/html' }, 'Hello World']
end
def setup
::ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => ":memory:")
::ActiveRecord::Schema.define(:version => 1) do
create_table :actors do |t|
t.column :name, :string
end
Actor.create(:name => 'Alpha')
end
end
def close
::ActiveRecord::Base.connection.tables.each do |table|
::ActiveRecord::Base.connection.drop_table(table)
end
end
end
end
use Rack::Lint
use Rack::ContentLength
run Rack::ActiveRecord.new
---
BUNDLE_DISABLE_SHARED_GEMS: "1"
source :gemcutter
gem 'rack'
gem 'rails', '3.0.0'
gem 'sqlite3-ruby'
GEM
remote: http://rubygems.org/
specs:
abstract (1.0.0)
actionmailer (3.0.0)
actionpack (= 3.0.0)
mail (~> 2.2.5)
actionpack (3.0.0)
activemodel (= 3.0.0)
activesupport (= 3.0.0)
builder (~> 2.1.2)
erubis (~> 2.6.6)
i18n (~> 0.4.1)
rack (~> 1.2.1)
rack-mount (~> 0.6.12)
rack-test (~> 0.5.4)
tzinfo (~> 0.3.23)
activemodel (3.0.0)
activesupport (= 3.0.0)
builder (~> 2.1.2)
i18n (~> 0.4.1)
activerecord (3.0.0)
activemodel (= 3.0.0)
activesupport (= 3.0.0)
arel (~> 1.0.0)
tzinfo (~> 0.3.23)
activeresource (3.0.0)
activemodel (= 3.0.0)
activesupport (= 3.0.0)
activesupport (3.0.0)
arel (1.0.1)
activesupport (~> 3.0.0)
builder (2.1.2)
erubis (2.6.6)
abstract (>= 1.0.0)
i18n (0.4.2)
mail (2.2.9)
activesupport (>= 2.3.6)
i18n (~> 0.4.1)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.16)
polyglot (0.3.1)
rack (1.2.1)
rack-mount (0.6.13)
rack (>= 1.0.0)
rack-test (0.5.6)
rack (>= 1.0)
rails (3.0.0)
actionmailer (= 3.0.0)
actionpack (= 3.0.0)
activerecord (= 3.0.0)
activeresource (= 3.0.0)
activesupport (= 3.0.0)
bundler (~> 1.0.0)
railties (= 3.0.0)
railties (3.0.0)
actionpack (= 3.0.0)
activesupport (= 3.0.0)
rake (>= 0.8.4)
thor (~> 0.14.0)
rake (0.8.7)
sqlite3-ruby (1.3.2)
thor (0.14.4)
treetop (1.4.8)
polyglot (>= 0.3.1)
tzinfo (0.3.23)
PLATFORMS
ruby
DEPENDENCIES
rack
rails (= 3.0.0)
sqlite3-ruby
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment