Skip to content

Commit

Permalink
Use Rack sessions and reloader instead of cookies and shotgun.
Browse files Browse the repository at this point in the history
  • Loading branch information
James Martin committed Sep 4, 2011
1 parent 91bc61f commit 7c66e16
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Examples/Calculator/Gemfile
Expand Up @@ -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
14 changes: 14 additions & 0 deletions Examples/Calculator/Gemfile.lock
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -71,3 +84,4 @@ DEPENDENCIES
cukesalad (>= 0.7)
rspec (>= 2.5.0)
sinatra (>= 1.2.0)
sinatra-reloader (= 0.5.0)
8 changes: 7 additions & 1 deletion Examples/Calculator/lib/web_calculator.rb
@@ -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' => :-}
Expand Down

0 comments on commit 7c66e16

Please sign in to comment.