Permalink
Browse files

Whip up a quick example

  • Loading branch information...
0 parents commit 2e909caca9a1c3e0c34a1d1bc8488691f4a0b542 @vanstee committed Jul 3, 2012
Showing with 88 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +7 −0 Gemfile
  3. +54 −0 Gemfile.lock
  4. +2 −0 Rakefile
  5. +7 −0 application.rb
  6. +2 −0 config.ru
  7. +12 −0 db/migrate/20120625030904_create_cheeses.rb
  8. +3 −0 models/cheese.rb
@@ -0,0 +1 @@
+*.db
@@ -0,0 +1,7 @@
+source :rubygems
+
+gem 'hovercraft'
+gem 'activerecord', require: 'active_record'
+gem 'sqlite3'
+gem 'pry'
+gem 'rake', group: :development
@@ -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
@@ -0,0 +1,2 @@
+require 'sinatra/activerecord/rake'
+require_relative 'application'
@@ -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')
@@ -0,0 +1,2 @@
+require './application'
+run Hovercraft::Server.new
@@ -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
@@ -0,0 +1,3 @@
+class Cheese < ActiveRecord::Base
+ attr_accessible :name, :tasty
+end

0 comments on commit 2e909ca

Please sign in to comment.