action_interceptor 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/config/initializers/action_interceptor.rb +32 -0
- data/lib/action_interceptor/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d95ea3cccfec859ff09714908a18ef5eb904cc4
|
4
|
+
data.tar.gz: a4f7eeb9e36816a430ba2dff877dace1cbac493f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 113a616a949887660f1c51c6bfce54eff54e498f86fb3d9c0fe8c252793ab4b1e35f84f89b2d25d952b9484c7dd51b4f8d22fb0a58aadff2b3be89655d45ebf4
|
7
|
+
data.tar.gz: 87192d1ba1d37ba5a075cb510762ade41039fc27e2e2edadcd64a3f8ae4685e947f0584ac1e8b0e2e14718ed1e69776fee592c9a3d2b5c8454dfd81e52aa152c
|
data/README.md
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
[![Build Status](https://travis-ci.org/openstax/action_interceptor.svg?branch=master)](https://travis-ci.org/openstax/action_interceptor)
|
4
4
|
|
5
|
+
[![Code Climate](https://codeclimate.com/github/openstax/action_interceptor.png)](https://codeclimate.com/github/openstax/action_interceptor)
|
6
|
+
|
5
7
|
Action Interceptor is a Rails engine that makes it easy to have controllers intercept
|
6
8
|
actions from other controllers, have users perform a task and then return them to where
|
7
9
|
they were when the interception happened.
|
@@ -0,0 +1,32 @@
|
|
1
|
+
ActionInterceptor.configure do
|
2
|
+
# intercepted_url_key(key)
|
3
|
+
# Type: Method
|
4
|
+
# Arguments: key (Symbol)
|
5
|
+
# The parameter/session variable that will hold the intercepted URL.
|
6
|
+
# Default: :r
|
7
|
+
intercepted_url_key :r
|
8
|
+
|
9
|
+
# override_url_options(bool)
|
10
|
+
# Type: Method
|
11
|
+
# Arguments: bool (Boolean)
|
12
|
+
# If true, the url_options method will be overriden for any controller that
|
13
|
+
# `acts_as_interceptor`. This option causes all links and redirects from any
|
14
|
+
# such controller to include a parameter containing the intercepted_url_key
|
15
|
+
# and the intercepted url. Set to false to disable for all controllers.
|
16
|
+
# If set to false, you must use the interceptor_url_options method to obtain
|
17
|
+
# the hash and pass it to any links or redirects that need to use it.
|
18
|
+
# Default: true
|
19
|
+
override_url_options true
|
20
|
+
|
21
|
+
# interceptor(interceptor_name, &block)
|
22
|
+
# Type: Method
|
23
|
+
# Arguments: interceptor name (Symbol or String),
|
24
|
+
# &block (Proc)
|
25
|
+
# Defines an interceptor.
|
26
|
+
# Default: none
|
27
|
+
# Example: interceptor :my_name do
|
28
|
+
# redirect_to my_action_users_url if some_condition
|
29
|
+
# end
|
30
|
+
#
|
31
|
+
# (Conditionally redirects to :my_action in UsersController)
|
32
|
+
end
|
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: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dante Soares
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -64,6 +64,7 @@ files:
|
|
64
64
|
- MIT-LICENSE
|
65
65
|
- README.md
|
66
66
|
- Rakefile
|
67
|
+
- config/initializers/action_interceptor.rb
|
67
68
|
- lib/action_interceptor.rb
|
68
69
|
- lib/action_interceptor/controller.rb
|
69
70
|
- lib/action_interceptor/encryptor.rb
|