flail 1.0.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e80d764470796f5a604df17b26081862e5e0e58d
4
- data.tar.gz: 1a800d88ddac0234cf55302f6d3437c75362d2c8
3
+ metadata.gz: 56551f92d97b5f0da8dc80a864ae45cd49b95329
4
+ data.tar.gz: 36237862e72029db6b1f26af0627ba8a7a1302be
5
5
  SHA512:
6
- metadata.gz: 497c61ffc1c0028742fdecdb0108822ace598ca5198f1ac3f0df73760c225ec5768af016204dbf737c7ddc98b59a0b815dfcfe85d76f1d0b7939d2093ccfc0f6
7
- data.tar.gz: ac92c5f0da30d230dcccd6698250b21d315425e97b3a8c26d7f935e71b0f7d50651dea3208df9845279c8b0c22cca3103a78186106b7d9b7d742cf60ddb7f1ef
6
+ metadata.gz: e7753b92a6939534016a2ad8bff352a1dd26333b2d1bfe4502412fbba2c0aeb30696b0e9e241d6b679d32814a9603c4e1f8155ffc4d3257fe1c3d7fac2042019
7
+ data.tar.gz: bf808cf12e17fdaf83120d92897aa74336b2460b46365b5dd2b39818d8c528443f811a293b2e9f078f27fa90851e81fd381f82792d5a7c7451a9ed15937795c8
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.1.0
1
+ 2.3.1
data/README.md CHANGED
@@ -2,7 +2,7 @@ Flail is an exception catcher for Rack applications.
2
2
 
3
3
  ##### Supports
4
4
 
5
- * Rails 3.x
5
+ * Rails 3.x, 4.x, 5.x
6
6
  * (See earlier 0.x.x releases for Rails 2.3.x support)
7
7
 
8
8
 
@@ -2,13 +2,16 @@ class Flail
2
2
  module Rails
3
3
  module ActionDispatch
4
4
  def self.included(base)
5
- base.send(:alias_method_chain, :render_exception, :flail)
5
+ base.class_eval do
6
+ prepend InstanceMethods
7
+ end
6
8
  end
7
9
 
8
- def render_exception_with_flail(env, exception)
9
- Flail::Exception.new(env, exception).handle!
10
-
11
- render_exception_without_flail(env, exception)
10
+ module InstanceMethods
11
+ def render_exception(env, exception)
12
+ Flail::Exception.new(env, exception).handle!
13
+ super
14
+ end
12
15
  end
13
16
  end
14
17
  end
@@ -1,25 +1,44 @@
1
1
  class Flail
2
2
  module Rails
3
3
  module ControllerMethods
4
-
4
+
5
5
  def self.included(base)
6
- base.send(:before_filter, :inject_flail_data_into_environment)
6
+ base.class_eval do
7
+ if respond_to?(:before_action)
8
+ before_action :inject_flail_data_into_environment
9
+ else
10
+ before_filter :inject_flail_data_into_environment
11
+ end
12
+ end
7
13
  end
8
14
 
9
15
  # This method is inserted into the host application's controllers as a before_filter
10
- # and is used to pass the parameters, session data, user data, and URL data from the app's
11
- # controller to the flail gem via the env variable (data is always passed, even if no
12
- # exception is thrown). This hook only works when a host app's controller is called.
13
- # Routing error exceptions are thrown before the controller is called so those errors are
16
+ # and is used to pass the parameters, session data, user data, and URL data from the app's
17
+ # controller to the flail gem via the env variable (data is always passed, even if no
18
+ # exception is thrown). This hook only works when a host app's controller is called.
19
+ # Routing error exceptions are thrown before the controller is called so those errors are
14
20
  # handled elsewhere and contain less information (mainly the user data is missing).
15
21
  def inject_flail_data_into_environment
16
22
  request.env['flail.request'] ||= request
17
23
  request.env['flail.request.data'] ||= flail_request_data
18
24
  end
19
25
 
26
+ def flail_params
27
+ result = nil
28
+ result ||= request.env['action_dispatch.parameters']
29
+ result ||= flail_rack_params
30
+ result ||= {}
31
+ result
32
+ end
33
+
34
+ def flail_rack_params
35
+ req = Rack::Request.new(request.env)
36
+ req.params if request.env['rack.input']
37
+ end
38
+
20
39
  def flail_request_data
21
40
  {
22
- :parameters => params.to_hash,
41
+ :parameters => flail_params.to_hash,
23
42
  :session_data => flail_session_data,
24
43
  :target_url => request.url,
25
44
  :referer_url => request.referer,
data/lib/flail/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Flail
2
- VERSION = "1.0.1"
2
+ VERSION = "1.1.0"
3
3
  end
metadata CHANGED
@@ -1,139 +1,139 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flail
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John 'asceth' Long
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-12 00:00:00.000000000 Z
11
+ date: 2016-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: actionpack
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: 2.3.8
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: 2.3.8
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: activerecord
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: 2.3.8
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: 2.3.8
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: activesupport
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: 2.3.8
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: 2.3.8
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: fakeweb
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ~>
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: 1.3.0
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ~>
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: 1.3.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rake
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rspec
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - '>='
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - '>='
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rr
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - '>='
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - '>='
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: sham_rack
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ~>
129
+ - - "~>"
130
130
  - !ruby/object:Gem::Version
131
131
  version: 1.3.0
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - ~>
136
+ - - "~>"
137
137
  - !ruby/object:Gem::Version
138
138
  version: 1.3.0
139
139
  description: Handle Rails exceptions with the fail flail.
@@ -143,10 +143,10 @@ executables: []
143
143
  extensions: []
144
144
  extra_rdoc_files: []
145
145
  files:
146
- - .gemtest
147
- - .gitignore
148
- - .rspec
149
- - .ruby-version
146
+ - ".gemtest"
147
+ - ".gitignore"
148
+ - ".rspec"
149
+ - ".ruby-version"
150
150
  - Gemfile
151
151
  - Gemfile.lock
152
152
  - LICENSE
@@ -178,17 +178,17 @@ require_paths:
178
178
  - lib
179
179
  required_ruby_version: !ruby/object:Gem::Requirement
180
180
  requirements:
181
- - - '>='
181
+ - - ">="
182
182
  - !ruby/object:Gem::Version
183
183
  version: '0'
184
184
  required_rubygems_version: !ruby/object:Gem::Requirement
185
185
  requirements:
186
- - - '>='
186
+ - - ">="
187
187
  - !ruby/object:Gem::Version
188
188
  version: '0'
189
189
  requirements: []
190
190
  rubyforge_project: flail
191
- rubygems_version: 2.0.3
191
+ rubygems_version: 2.5.1
192
192
  signing_key:
193
193
  specification_version: 4
194
194
  summary: Rails exception handler