Permalink
Browse files

Use Rack sessions and reloader instead of cookies and shotgun.

  • Loading branch information...
1 parent 91bc61f commit 7c66e16eafaff46c3adb42467c3c01409c544ad3 James Martin committed Sep 4, 2011
Showing with 25 additions and 1 deletion.
  1. +4 −0 Examples/Calculator/Gemfile
  2. +14 −0 Examples/Calculator/Gemfile.lock
  3. +7 −1 Examples/Calculator/lib/web_calculator.rb
@@ -3,3 +3,7 @@ gem "cukesalad", ">=0.7"
gem "rspec", ">=2.5.0", :require => 'spec'
gem "capybara", ">=0.4.1.2"
gem "sinatra", ">=1.2.0"
+
+group :test, :development do
+ gem 'sinatra-reloader', '0.5.0'
+end
@@ -7,6 +7,7 @@ GEM
cucumber (>= 0.10.7)
rdiscount (>= 1.6.8)
rspec (>= 2.6.0)
+ backports (2.3.0)
bcat (0.6.1)
rack (~> 1.0)
builder (3.0.0)
@@ -36,6 +37,8 @@ GEM
json (1.5.3)
json_pure (1.5.3)
mime-types (1.16)
+ monkey-lib (0.5.4)
+ backports
nokogiri (1.5.0)
rack (1.3.0)
rack-test (0.6.0)
@@ -58,6 +61,16 @@ GEM
sinatra (1.2.6)
rack (~> 1.1)
tilt (< 2.0, >= 1.2.2)
+ sinatra-advanced-routes (0.5.1)
+ monkey-lib (~> 0.5.0)
+ sinatra (~> 1.0)
+ sinatra-sugar (~> 0.5.0)
+ sinatra-reloader (0.5.0)
+ sinatra (~> 1.0)
+ sinatra-advanced-routes (~> 0.5.0)
+ sinatra-sugar (0.5.1)
+ monkey-lib (~> 0.5.0)
+ sinatra (~> 1.0)
term-ansicolor (1.0.5)
tilt (1.3.2)
xpath (0.1.4)
@@ -71,3 +84,4 @@ DEPENDENCIES
cukesalad (>= 0.7)
rspec (>= 2.5.0)
sinatra (>= 1.2.0)
+ sinatra-reloader (= 0.5.0)
@@ -1,13 +1,19 @@
require 'sinatra/base'
require 'erb'
+
$:.unshift(File.dirname(__FILE__), '.')
require 'calculator'
Sinatra::Base.enable :inline_templates
-Sinatra::Base.enable :sessions
class WebCalculator < Sinatra::Base
+ use Rack::Session::Pool
+
+ configure :development, :test do
+ require 'sinatra/reloader'
+ end
+
helpers do
def operate_with
{ 'plus' => :+, 'minus' => :-}

0 comments on commit 7c66e16

Please sign in to comment.