action_interceptor 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +1 -1
- data/lib/action_interceptor/version.rb +1 -1
- data/spec/dummy/config/application.rb +3 -0
- data/spec/lib/action_interceptor/action_controller/base_spec.rb +11 -11
- data/spec/lib/action_interceptor/configuration_spec.rb +1 -1
- data/spec/lib/action_interceptor/strategies/session_spec.rb +9 -9
- data/spec/lib/action_interceptor/strategies_spec.rb +1 -1
- data/spec/lib/action_interceptor_spec.rb +1 -1
- metadata +29 -38
- data/spec/dummy/log/development.log +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 9b9a4a120280d718fded0e231e7b005857afd53be2246049a8fe10769cbf83eb
|
4
|
+
data.tar.gz: 848a57c6e1e849c2049bdf34ee8b53b3fea2a65dc36ec188bd348c7bfe7734a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0406084478cad890133287e35f66df22e59b4ebd6d28ed20590344199766fb64e02aafac21c04c675330039a11ccd2828ce71a051e2017859be85c277c4cf9bb'
|
7
|
+
data.tar.gz: fdd35052b3e79184c2151ed9be89654d3aa5506bee0e4b8f55e3f82e01ec39a9845969a515446912ee8b16907cae916d91bb0df8da47678b8ec04dfff61052d5
|
data/README.md
CHANGED
@@ -37,7 +37,7 @@ to your application's root url.
|
|
37
37
|
|
38
38
|
## Usage
|
39
39
|
|
40
|
-
Before your
|
40
|
+
Before your before_action or controller redirects the user to the
|
41
41
|
login/registration/terms of use page, call `store_url`
|
42
42
|
to store the current url.
|
43
43
|
|
@@ -7,6 +7,9 @@ require "action_interceptor"
|
|
7
7
|
|
8
8
|
module Dummy
|
9
9
|
class Application < Rails::Application
|
10
|
+
# Initialize configuration defaults for originally generated Rails version.
|
11
|
+
config.load_defaults 5.2
|
12
|
+
|
10
13
|
# Settings in config/environments/* take precedence over those specified here.
|
11
14
|
# Application configuration should go into files in config/initializers
|
12
15
|
# -- all .rb files in that directory are automatically loaded.
|
@@ -2,18 +2,18 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
module ActionInterceptor
|
4
4
|
module ActionController
|
5
|
-
describe Base do
|
5
|
+
RSpec.describe Base, type: :lib do
|
6
6
|
|
7
|
-
let!(:request)
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
7
|
+
let!(:request) do
|
8
|
+
::ActionController::TestRequest.new(
|
9
|
+
{ 'REQUEST_METHOD' => 'GET', 'HTTP_REFERER' => 'http://refer.er' },
|
10
|
+
{},
|
11
|
+
::ActionController::Base
|
12
|
+
).tap { |request| request.host = 'test.me' }
|
13
|
+
end
|
14
|
+
let!(:controller) do
|
15
|
+
::ActionController::Base.new.tap { |controller| controller.request = request }
|
16
|
+
end
|
17
17
|
|
18
18
|
it 'modifies ActionController::Base' do
|
19
19
|
expect(controller.respond_to?(:current_page?, true)).to eq true
|
@@ -2,16 +2,16 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
module ActionInterceptor
|
4
4
|
module Strategies
|
5
|
-
describe Session do
|
5
|
+
RSpec.describe Session, type: :lib do
|
6
6
|
|
7
|
-
let!(:request)
|
8
|
-
::ActionController::TestRequest.new(
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
7
|
+
let!(:request) do
|
8
|
+
::ActionController::TestRequest.new({}, {}, ::ActionController::Base).tap do |request|
|
9
|
+
request.host = 'test.me'
|
10
|
+
end
|
11
|
+
end
|
12
|
+
let!(:controller) do
|
13
|
+
::ActionController::Base.new.tap { |controller| controller.request = request }
|
14
|
+
end
|
15
15
|
let!(:strategy) { Session.new(controller) }
|
16
16
|
let!(:key) { :key }
|
17
17
|
let!(:string) { 'string' }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: action_interceptor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dante Soares
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-05-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -17,9 +17,6 @@ dependencies:
|
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '3.1'
|
20
|
-
- - "<"
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: '5.0'
|
23
20
|
type: :runtime
|
24
21
|
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -27,9 +24,6 @@ dependencies:
|
|
27
24
|
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '3.1'
|
30
|
-
- - "<"
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: '5.0'
|
33
27
|
- !ruby/object:Gem::Dependency
|
34
28
|
name: sqlite3
|
35
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -109,7 +103,6 @@ files:
|
|
109
103
|
- spec/dummy/config/routes.rb
|
110
104
|
- spec/dummy/db/test.sqlite3
|
111
105
|
- spec/dummy/lib/strategies/dummy.rb
|
112
|
-
- spec/dummy/log/development.log
|
113
106
|
- spec/dummy/log/test.log
|
114
107
|
- spec/dummy/public/404.html
|
115
108
|
- spec/dummy/public/422.html
|
@@ -140,52 +133,50 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
140
133
|
- !ruby/object:Gem::Version
|
141
134
|
version: '0'
|
142
135
|
requirements: []
|
143
|
-
|
144
|
-
rubygems_version: 2.4.5.1
|
136
|
+
rubygems_version: 3.0.1
|
145
137
|
signing_key:
|
146
138
|
specification_version: 4
|
147
139
|
summary: Handles storage of return url's across multiple requests
|
148
140
|
test_files:
|
141
|
+
- spec/spec_helper.rb
|
149
142
|
- spec/dummy/app/assets/javascripts/application.js
|
150
143
|
- spec/dummy/app/assets/stylesheets/application.css
|
151
|
-
- spec/dummy/app/controllers/application_controller.rb
|
152
|
-
- spec/dummy/app/controllers/home_controller.rb
|
153
144
|
- spec/dummy/app/controllers/registrations_controller.rb
|
145
|
+
- spec/dummy/app/controllers/home_controller.rb
|
146
|
+
- spec/dummy/app/controllers/application_controller.rb
|
154
147
|
- spec/dummy/app/helpers/application_helper.rb
|
155
|
-
- spec/dummy/
|
148
|
+
- spec/dummy/db/test.sqlite3
|
149
|
+
- spec/dummy/log/test.log
|
150
|
+
- spec/dummy/README.md
|
151
|
+
- spec/dummy/public/favicon.ico
|
152
|
+
- spec/dummy/public/422.html
|
153
|
+
- spec/dummy/public/404.html
|
154
|
+
- spec/dummy/public/500.html
|
155
|
+
- spec/dummy/config.ru
|
156
|
+
- spec/dummy/lib/strategies/dummy.rb
|
156
157
|
- spec/dummy/bin/rails
|
157
158
|
- spec/dummy/bin/rake
|
159
|
+
- spec/dummy/bin/bundle
|
158
160
|
- spec/dummy/config/application.rb
|
159
|
-
- spec/dummy/config/boot.rb
|
160
|
-
- spec/dummy/config/database.yml
|
161
|
-
- spec/dummy/config/environment.rb
|
162
|
-
- spec/dummy/config/environments/development.rb
|
163
|
-
- spec/dummy/config/environments/production.rb
|
164
|
-
- spec/dummy/config/environments/test.rb
|
165
|
-
- spec/dummy/config/initializers/action_interceptor.rb
|
166
|
-
- spec/dummy/config/initializers/backtrace_silencers.rb
|
167
161
|
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
168
|
-
- spec/dummy/config/initializers/inflections.rb
|
169
|
-
- spec/dummy/config/initializers/mime_types.rb
|
170
162
|
- spec/dummy/config/initializers/secret_token.rb
|
171
|
-
- spec/dummy/config/initializers/
|
163
|
+
- spec/dummy/config/initializers/inflections.rb
|
164
|
+
- spec/dummy/config/initializers/action_interceptor.rb
|
165
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
172
166
|
- spec/dummy/config/initializers/wrap_parameters.rb
|
167
|
+
- spec/dummy/config/initializers/session_store.rb
|
168
|
+
- spec/dummy/config/initializers/mime_types.rb
|
173
169
|
- spec/dummy/config/locales/en.yml
|
174
170
|
- spec/dummy/config/routes.rb
|
175
|
-
- spec/dummy/config.
|
176
|
-
- spec/dummy/
|
177
|
-
- spec/dummy/
|
178
|
-
- spec/dummy/
|
179
|
-
- spec/dummy/
|
180
|
-
- spec/dummy/
|
181
|
-
- spec/dummy/public/422.html
|
182
|
-
- spec/dummy/public/500.html
|
183
|
-
- spec/dummy/public/favicon.ico
|
171
|
+
- spec/dummy/config/database.yml
|
172
|
+
- spec/dummy/config/environment.rb
|
173
|
+
- spec/dummy/config/boot.rb
|
174
|
+
- spec/dummy/config/environments/production.rb
|
175
|
+
- spec/dummy/config/environments/test.rb
|
176
|
+
- spec/dummy/config/environments/development.rb
|
184
177
|
- spec/dummy/Rakefile
|
185
|
-
- spec/dummy/README.md
|
186
|
-
- spec/lib/action_interceptor/action_controller/base_spec.rb
|
187
178
|
- spec/lib/action_interceptor/configuration_spec.rb
|
188
|
-
- spec/lib/action_interceptor/strategies/session_spec.rb
|
189
179
|
- spec/lib/action_interceptor/strategies_spec.rb
|
180
|
+
- spec/lib/action_interceptor/action_controller/base_spec.rb
|
181
|
+
- spec/lib/action_interceptor/strategies/session_spec.rb
|
190
182
|
- spec/lib/action_interceptor_spec.rb
|
191
|
-
- spec/spec_helper.rb
|
File without changes
|