Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Whip up a quick example

  • Loading branch information...
commit 2e909caca9a1c3e0c34a1d1bc8488691f4a0b542 0 parents
@vanstee authored
1  .gitignore
@@ -0,0 +1 @@
+*.db
7 Gemfile
@@ -0,0 +1,7 @@
+source :rubygems
+
+gem 'hovercraft'
+gem 'activerecord', require: 'active_record'
+gem 'sqlite3'
+gem 'pry'
+gem 'rake', group: :development
54 Gemfile.lock
@@ -0,0 +1,54 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ activemodel (3.2.6)
+ activesupport (= 3.2.6)
+ builder (~> 3.0.0)
+ activerecord (3.2.6)
+ activemodel (= 3.2.6)
+ activesupport (= 3.2.6)
+ arel (~> 3.0.2)
+ tzinfo (~> 0.3.29)
+ activesupport (3.2.6)
+ i18n (~> 0.6)
+ multi_json (~> 1.0)
+ arel (3.0.2)
+ builder (3.0.0)
+ coderay (1.0.6)
+ hovercraft (0.0.1)
+ rack-contrib
+ sinatra-activerecord
+ i18n (0.6.0)
+ method_source (0.7.1)
+ multi_json (1.3.6)
+ pry (0.9.9.6)
+ coderay (~> 1.0.5)
+ method_source (~> 0.7.1)
+ slop (>= 2.4.4, < 3)
+ rack (1.4.1)
+ rack-contrib (1.1.0)
+ rack (>= 0.9.1)
+ rack-protection (1.2.0)
+ rack
+ rake (0.9.2.2)
+ sinatra (1.3.2)
+ rack (~> 1.3, >= 1.3.6)
+ rack-protection (~> 1.2)
+ tilt (~> 1.3, >= 1.3.3)
+ sinatra-activerecord (1.1.0)
+ activerecord (~> 3.0)
+ sinatra (~> 1.0)
+ slop (2.4.4)
+ sqlite3 (1.3.6)
+ tilt (1.3.3)
+ tzinfo (0.3.33)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ activerecord
+ hovercraft
+ pry
+ rake
+ sqlite3
2  Rakefile
@@ -0,0 +1,2 @@
+require 'sinatra/activerecord/rake'
+require_relative 'application'
7 application.rb
@@ -0,0 +1,7 @@
+require 'bundler'
+Bundler.require
+
+environment = ENV['ENV'] || ENV['HOVERCRAFT_ENV'] || ENV['RACK_ENV'] || 'development'
+ENV['ENV'] = ENV['HOVERCRAFT_ENV'] = ENV['RACK_ENV'] = 'development'
+
+ActiveRecord::Base.establish_connection('sqlite3:///development.db')
2  config.ru
@@ -0,0 +1,2 @@
+require './application'
+run Hovercraft::Server.new
12 db/migrate/20120625030904_create_cheeses.rb
@@ -0,0 +1,12 @@
+class CreateCheeses < ActiveRecord::Migration
+ def up
+ create_table :cheeses do |t|
+ t.string :name
+ t.boolean :tasty
+ end
+ end
+
+ def down
+ drop_table :cheeses
+ end
+end
3  models/cheese.rb
@@ -0,0 +1,3 @@
+class Cheese < ActiveRecord::Base
+ attr_accessible :name, :tasty
+end
Please sign in to comment.
Something went wrong with that request. Please try again.