Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use Rack sessions and reloader instead of cookies and shotgun.

  • Loading branch information...
commit 7c66e16eafaff46c3adb42467c3c01409c544ad3 1 parent 91bc61f
James Martin authored
View
4 Examples/Calculator/Gemfile
@@ -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
View
14 Examples/Calculator/Gemfile.lock
@@ -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)
View
8 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' => :-}
Please sign in to comment.
Something went wrong with that request. Please try again.