Skip to content

Commit

Permalink
Fix the examples
Browse files Browse the repository at this point in the history
  • Loading branch information
lifo committed Jan 7, 2010
1 parent 115028d commit fb8ee09
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 12 deletions.
1 change: 0 additions & 1 deletion examples/full.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require File.join(File.dirname(__FILE__), "../vendor/gems/environment")

$: << File.join(File.dirname(__FILE__), "../lib")

require 'cramp/controller'
Expand Down
4 changes: 2 additions & 2 deletions examples/hello_world.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'rubygems'

require File.join(File.dirname(__FILE__), "../vendor/gems/environment")
$: << File.join(File.dirname(__FILE__), "../lib")

require 'cramp/controller'

class WelcomeController < Cramp::Controller::Action
Expand Down
4 changes: 2 additions & 2 deletions examples/orm.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'rubygems'

require File.join(File.dirname(__FILE__), "../vendor/gems/environment")
$: << File.join(File.dirname(__FILE__), "../lib")

require 'cramp/model'

Cramp::Model.init(:username => 'root', :database => 'arel_development')
Expand Down
4 changes: 2 additions & 2 deletions examples/streaming.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'rubygems'

require File.join(File.dirname(__FILE__), "../vendor/gems/environment")
$: << File.join(File.dirname(__FILE__), "../lib")

require 'cramp/controller'

class StreamController < Cramp::Controller::Action
Expand Down
7 changes: 2 additions & 5 deletions examples/with_usher.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
require 'rubygems'

require File.join(File.dirname(__FILE__), "../vendor/gems/environment")
$: << File.join(File.dirname(__FILE__), "../lib")

require 'cramp/controller'

class HomeController < Cramp::Controller::Action
# Optional - These are the default headers
set_default_response 200, 'Content-Type' => 'text/html'

def before_start
if params[:password] != 'foo'
halt 401, {}, "Bad Password"
Expand Down

0 comments on commit fb8ee09

Please sign in to comment.