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 +1 -0
- data/Gemfile +2 -1
- data/Gemfile.rails4 +11 -0
- data/README.md +12 -0
- data/apps/test_rails_app.rb +3 -0
- data/lib/rack_session_access/middleware.rb +5 -2
- data/lib/rack_session_access/version.rb +1 -1
- metadata +7 -6
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/Gemfile.rails4
ADDED
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
|
|
data/apps/test_rails_app.rb
CHANGED
@@ -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(
|
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
|
-
|
57
|
+
session_hash.each do |k,v|
|
55
58
|
xml.li("#{k.inspect} : #{v.inspect}")
|
56
59
|
end
|
57
60
|
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.
|
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-
|
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: &
|
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: *
|
24
|
+
version_requirements: *11637460
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: builder
|
27
|
-
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: *
|
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
|