rescue 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 85dc1db766cff113e0db6b59053b7b1c89b70e8d
4
+ data.tar.gz: 5a0361babe1ab2a79cc24edb2c4008d2cd97be64
5
+ SHA512:
6
+ metadata.gz: eb2b6e19706dc345a200324128eacfa4b035273348925fdda0cad0850191f8f173e469c6fef288db8babd3f79af1729890a973307664f008127d915a106d1467
7
+ data.tar.gz: 0adf0657ed90eeb69885e8bee72bb4c6708aa938a56f60d1da9725e55966775dec927ee1ac51a60b473d59f4d24553919776f3bd334c6144ad33345a4d53527b
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2016 Michael Wehrley
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
File without changes
data/lib/rescue.rb ADDED
@@ -0,0 +1,17 @@
1
+ require "activesupport"
2
+
3
+ # Rescues exception when a participant/user auth token is invalid
4
+ module Rescue
5
+ extend ActiveSupport::Concern
6
+
7
+ included do
8
+ rescue_from ActionController::InvalidAuthenticityToken,
9
+ with: :invalid_auth_token
10
+ end
11
+
12
+ private
13
+
14
+ def invalid_auth_token
15
+ redirect_to main_app.root_path
16
+ end
17
+ end
@@ -0,0 +1,4 @@
1
+ # nodoc
2
+ module Rescue
3
+ VERSION = "0.0.1"
4
+ end
metadata ADDED
@@ -0,0 +1,63 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rescue
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Michael Wehrley
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-02-12 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activesupport
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '4'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '4'
27
+ description: Rescues the exception ActionController::InvalidAuthenticityToken and
28
+ redirects.
29
+ email:
30
+ - michael.wehrley@northwestern.edu
31
+ executables: []
32
+ extensions: []
33
+ extra_rdoc_files: []
34
+ files:
35
+ - MIT-LICENSE
36
+ - README.md
37
+ - lib/rescue.rb
38
+ - lib/rescue/version.rb
39
+ homepage: https://github.com/michaelwehrley/rescue
40
+ licenses:
41
+ - MIT
42
+ metadata: {}
43
+ post_install_message:
44
+ rdoc_options: []
45
+ require_paths:
46
+ - lib
47
+ required_ruby_version: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - ">="
50
+ - !ruby/object:Gem::Version
51
+ version: '0'
52
+ required_rubygems_version: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: '0'
57
+ requirements: []
58
+ rubyforge_project:
59
+ rubygems_version: 2.4.6
60
+ signing_key:
61
+ specification_version: 4
62
+ summary: Rescues InvalidAuthenticityToken
63
+ test_files: []