rack_session_access 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1,4 +1,5 @@
1
1
  *.gem
2
2
  .bundle
3
3
  Gemfile.lock
4
+ Gemfile.rails4.lock
4
5
  pkg/*
data/Gemfile CHANGED
@@ -4,7 +4,8 @@ gemspec
4
4
 
5
5
  gem 'rspec', '2.12.0'
6
6
  gem 'capybara', '1.1.4'
7
+ gem 'selenium-webdriver', '2.31.0'
7
8
 
8
9
  gem 'rack'
9
10
  gem 'sinatra', '1.3.4'
10
- gem 'rails'
11
+ gem 'rails', '3.2.12'
data/Gemfile.rails4 ADDED
@@ -0,0 +1,11 @@
1
+ source "http://rubygems.org"
2
+
3
+ gemspec
4
+
5
+ gem 'rspec', '2.12.0'
6
+ gem 'capybara', '1.1.4'
7
+ gem 'selenium-webdriver', '2.31.0'
8
+
9
+ gem 'rack'
10
+ gem 'sinatra', '1.3.4'
11
+ gem 'rails', '4.0.0.beta1'
data/README.md CHANGED
@@ -111,6 +111,18 @@ Thus we use marshalized data it's possible to set any ruby object into applicati
111
111
 
112
112
  Enjoy!
113
113
 
114
+ ## Running rack_session_access tests
115
+
116
+ ### Against Rails3, Sinatra, rack applications
117
+
118
+ BUNDLE_GEMFILE=Gemfile bundle install
119
+ BUNDLE_GEMFILE=Gemfile bundle exec rspec -fs -c spec/
120
+
121
+ ### Against Rails4, Sinatra, rack applications
122
+
123
+ BUNDLE_GEMFILE=Gemfile.rails4 bundle install
124
+ BUNDLE_GEMFILE=Gemfile.rails4 bundle exec rspec -fs -c spec/
125
+
114
126
 
115
127
  ## References
116
128
 
@@ -3,6 +3,9 @@ require 'action_controller/railtie'
3
3
  module TestRailsApp
4
4
  class Application < Rails::Application
5
5
  config.secret_token = '572c86f5ede338bd8aba8dae0fd3a326aabababc98d1e6ce34b9f5'
6
+ if Rails::VERSION::MAJOR > 3
7
+ config.secret_key_base = '6dfb795086781f017c63cadcd2653fac40967ac60f621e6299a0d6d811417156d81efcdf1d234c'
8
+ end
6
9
 
7
10
  routes.draw do
8
11
  get '/login' => 'test_rails_app/sessions#new'
@@ -41,17 +41,20 @@ module RackSessionAccess
41
41
  # force load session because it can be lazy loaded
42
42
  request.env[@key].delete(:rack_session_access_force_load_session)
43
43
 
44
+ # session hash object
45
+ session_hash = request.env[@key].to_hash
46
+
44
47
  case File.extname(request.path)
45
48
  when ".raw"
46
49
  render do |xml|
47
50
  xml.h2 "Raw rack session data"
48
- xml.pre RackSessionAccess.encode(request.env[@key].to_hash)
51
+ xml.pre RackSessionAccess.encode(session_hash)
49
52
  end
50
53
  else
51
54
  render do |xml|
52
55
  xml.h2 "Rack session data"
53
56
  xml.ul do |xml|
54
- request.env[@key].each do |k,v|
57
+ session_hash.each do |k,v|
55
58
  xml.li("#{k.inspect} : #{v.inspect}")
56
59
  end
57
60
  end
@@ -1,3 +1,3 @@
1
1
  module RackSessionAccess
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack_session_access
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-18 00:00:00.000000000 Z
12
+ date: 2013-03-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rack
16
- requirement: &17313460 !ruby/object:Gem::Requirement
16
+ requirement: &11637460 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 1.0.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *17313460
24
+ version_requirements: *11637460
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: builder
27
- requirement: &17328860 !ruby/object:Gem::Requirement
27
+ requirement: &11636640 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: 2.0.0
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *17328860
35
+ version_requirements: *11636640
36
36
  description:
37
37
  email:
38
38
  - andriy.yanko@gmail.com
@@ -42,6 +42,7 @@ extra_rdoc_files: []
42
42
  files:
43
43
  - .gitignore
44
44
  - Gemfile
45
+ - Gemfile.rails4
45
46
  - README.md
46
47
  - Rakefile
47
48
  - apps/test_rack_app.rb