Skip to content
Browse files

Update versions in Gemfile

  • Loading branch information...
1 parent e3eea80 commit 43c502f71a3a770bd7d5c6c03d5c8aa8ccceac77 @ayanko ayanko committed Mar 7, 2013
Showing with 7 additions and 8 deletions.
  1. +2 −1 Gemfile
  2. +5 −7 lib/rack_session_access/middleware.rb
View
3 Gemfile
@@ -4,7 +4,8 @@ gemspec
gem 'rspec', '2.12.0'
gem 'capybara', '1.1.4'
+gem 'selenium-webdriver', '2.31.0'
gem 'rack'
gem 'sinatra', '1.3.4'
-gem 'rails'
+gem 'rails', '3.2.12'
View
12 lib/rack_session_access/middleware.rb
@@ -41,22 +41,20 @@ def show(request)
# force load session because it can be lazy loaded
request.env[@key].delete(:rack_session_access_force_load_session)
+ # session hash object
+ session_hash = request.env[@key].to_hash
+
case File.extname(request.path)
when ".raw"
render do |xml|
xml.h2 "Raw rack session data"
- xml.pre RackSessionAccess.encode(request.env[@key].to_hash)
+ xml.pre RackSessionAccess.encode(session_hash)
end
else
render do |xml|
xml.h2 "Rack session data"
xml.ul do |xml|
- session = request.env[@key]
- if session.respond_to?(:to_hash)
- # session is ActionDispatch::Request::Session
- session = session.to_hash
- end
- session.each do |k,v|
+ session_hash.each do |k,v|
xml.li("#{k.inspect} : #{v.inspect}")
end
end

0 comments on commit 43c502f

Please sign in to comment.
Something went wrong with that request. Please try again.