openstax_rescue_from 1.6.0 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  module OpenStax
2
2
  module RescueFrom
3
- VERSION = "1.6.0"
3
+ VERSION = "1.7.0"
4
4
  end
5
5
  end
@@ -27,6 +27,15 @@ module OpenStax
27
27
  end
28
28
  end
29
29
 
30
+ # For rescuing from specific blocks of code: OpenStax::RescueFrom.this{...}
31
+ def this
32
+ begin
33
+ yield
34
+ rescue Exception => e
35
+ perform_rescue(e)
36
+ end
37
+ end
38
+
30
39
  def translate_status_codes(map = {})
31
40
  map.each do |k, v|
32
41
  friendly_status_messages[k] = v
@@ -19,7 +19,14 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_dependency "rails", '>= 3.1', '< 5.0'
22
- spec.add_dependency "exception_notification", '>= 4.1', '< 5.0'
22
+
23
+
24
+ if RUBY_VERSION < '2.0'
25
+ spec.add_dependency 'mime-types', '<= 2.6.2'
26
+ spec.add_dependency 'exception_notification', '<= 4.1.1'
27
+ else
28
+ spec.add_dependency "exception_notification", '>= 4.1', '< 5.0'
29
+ end
23
30
 
24
31
  spec.add_development_dependency "sqlite3", '~> 1.3.10'
25
32
  spec.add_development_dependency "bundler", "~> 1.10"
metadata CHANGED
@@ -1,7 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openstax_rescue_from
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.7.0
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - JP Slavinsky
@@ -9,11 +10,12 @@ authors:
9
10
  autorequire:
10
11
  bindir: exe
11
12
  cert_chain: []
12
- date: 2015-11-04 00:00:00.000000000 Z
13
+ date: 2016-12-16 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: rails
16
17
  requirement: !ruby/object:Gem::Requirement
18
+ none: false
17
19
  requirements:
18
20
  - - ! '>='
19
21
  - !ruby/object:Gem::Version
@@ -24,6 +26,7 @@ dependencies:
24
26
  type: :runtime
25
27
  prerelease: false
26
28
  version_requirements: !ruby/object:Gem::Requirement
29
+ none: false
27
30
  requirements:
28
31
  - - ! '>='
29
32
  - !ruby/object:Gem::Version
@@ -32,28 +35,41 @@ dependencies:
32
35
  - !ruby/object:Gem::Version
33
36
  version: '5.0'
34
37
  - !ruby/object:Gem::Dependency
35
- name: exception_notification
38
+ name: mime-types
36
39
  requirement: !ruby/object:Gem::Requirement
40
+ none: false
37
41
  requirements:
38
- - - ! '>='
42
+ - - <=
39
43
  - !ruby/object:Gem::Version
40
- version: '4.1'
41
- - - <
42
- - !ruby/object:Gem::Version
43
- version: '5.0'
44
+ version: 2.6.2
44
45
  type: :runtime
45
46
  prerelease: false
46
47
  version_requirements: !ruby/object:Gem::Requirement
48
+ none: false
47
49
  requirements:
48
- - - ! '>='
50
+ - - <=
49
51
  - !ruby/object:Gem::Version
50
- version: '4.1'
51
- - - <
52
+ version: 2.6.2
53
+ - !ruby/object:Gem::Dependency
54
+ name: exception_notification
55
+ requirement: !ruby/object:Gem::Requirement
56
+ none: false
57
+ requirements:
58
+ - - <=
52
59
  - !ruby/object:Gem::Version
53
- version: '5.0'
60
+ version: 4.1.1
61
+ type: :runtime
62
+ prerelease: false
63
+ version_requirements: !ruby/object:Gem::Requirement
64
+ none: false
65
+ requirements:
66
+ - - <=
67
+ - !ruby/object:Gem::Version
68
+ version: 4.1.1
54
69
  - !ruby/object:Gem::Dependency
55
70
  name: sqlite3
56
71
  requirement: !ruby/object:Gem::Requirement
72
+ none: false
57
73
  requirements:
58
74
  - - ~>
59
75
  - !ruby/object:Gem::Version
@@ -61,6 +77,7 @@ dependencies:
61
77
  type: :development
62
78
  prerelease: false
63
79
  version_requirements: !ruby/object:Gem::Requirement
80
+ none: false
64
81
  requirements:
65
82
  - - ~>
66
83
  - !ruby/object:Gem::Version
@@ -68,6 +85,7 @@ dependencies:
68
85
  - !ruby/object:Gem::Dependency
69
86
  name: bundler
70
87
  requirement: !ruby/object:Gem::Requirement
88
+ none: false
71
89
  requirements:
72
90
  - - ~>
73
91
  - !ruby/object:Gem::Version
@@ -75,6 +93,7 @@ dependencies:
75
93
  type: :development
76
94
  prerelease: false
77
95
  version_requirements: !ruby/object:Gem::Requirement
96
+ none: false
78
97
  requirements:
79
98
  - - ~>
80
99
  - !ruby/object:Gem::Version
@@ -82,6 +101,7 @@ dependencies:
82
101
  - !ruby/object:Gem::Dependency
83
102
  name: rake
84
103
  requirement: !ruby/object:Gem::Requirement
104
+ none: false
85
105
  requirements:
86
106
  - - ~>
87
107
  - !ruby/object:Gem::Version
@@ -89,6 +109,7 @@ dependencies:
89
109
  type: :development
90
110
  prerelease: false
91
111
  version_requirements: !ruby/object:Gem::Requirement
112
+ none: false
92
113
  requirements:
93
114
  - - ~>
94
115
  - !ruby/object:Gem::Version
@@ -96,6 +117,7 @@ dependencies:
96
117
  - !ruby/object:Gem::Dependency
97
118
  name: rspec-rails
98
119
  requirement: !ruby/object:Gem::Requirement
120
+ none: false
99
121
  requirements:
100
122
  - - ~>
101
123
  - !ruby/object:Gem::Version
@@ -103,6 +125,7 @@ dependencies:
103
125
  type: :development
104
126
  prerelease: false
105
127
  version_requirements: !ruby/object:Gem::Requirement
128
+ none: false
106
129
  requirements:
107
130
  - - ~>
108
131
  - !ruby/object:Gem::Version
@@ -110,6 +133,7 @@ dependencies:
110
133
  - !ruby/object:Gem::Dependency
111
134
  name: pry-nav
112
135
  requirement: !ruby/object:Gem::Requirement
136
+ none: false
113
137
  requirements:
114
138
  - - ~>
115
139
  - !ruby/object:Gem::Version
@@ -117,6 +141,7 @@ dependencies:
117
141
  type: :development
118
142
  prerelease: false
119
143
  version_requirements: !ruby/object:Gem::Requirement
144
+ none: false
120
145
  requirements:
121
146
  - - ~>
122
147
  - !ruby/object:Gem::Version
@@ -124,6 +149,7 @@ dependencies:
124
149
  - !ruby/object:Gem::Dependency
125
150
  name: pry-rails
126
151
  requirement: !ruby/object:Gem::Requirement
152
+ none: false
127
153
  requirements:
128
154
  - - ~>
129
155
  - !ruby/object:Gem::Version
@@ -131,6 +157,7 @@ dependencies:
131
157
  type: :development
132
158
  prerelease: false
133
159
  version_requirements: !ruby/object:Gem::Requirement
160
+ none: false
134
161
  requirements:
135
162
  - - ~>
136
163
  - !ruby/object:Gem::Version
@@ -138,6 +165,7 @@ dependencies:
138
165
  - !ruby/object:Gem::Dependency
139
166
  name: database_cleaner
140
167
  requirement: !ruby/object:Gem::Requirement
168
+ none: false
141
169
  requirements:
142
170
  - - ~>
143
171
  - !ruby/object:Gem::Version
@@ -145,6 +173,7 @@ dependencies:
145
173
  type: :development
146
174
  prerelease: false
147
175
  version_requirements: !ruby/object:Gem::Requirement
176
+ none: false
148
177
  requirements:
149
178
  - - ~>
150
179
  - !ruby/object:Gem::Version
@@ -160,7 +189,6 @@ files:
160
189
  - .gitignore
161
190
  - .rspec
162
191
  - .ruby-gemset
163
- - .ruby-version
164
192
  - .travis.yml
165
193
  - Gemfile
166
194
  - LICENSE.txt
@@ -189,25 +217,32 @@ files:
189
217
  homepage: https://github.com/openstax/rescue_from
190
218
  licenses:
191
219
  - MIT
192
- metadata: {}
193
220
  post_install_message:
194
221
  rdoc_options: []
195
222
  require_paths:
196
223
  - lib
197
224
  required_ruby_version: !ruby/object:Gem::Requirement
225
+ none: false
198
226
  requirements:
199
227
  - - ! '>='
200
228
  - !ruby/object:Gem::Version
201
229
  version: '0'
230
+ segments:
231
+ - 0
232
+ hash: -2133311575629086348
202
233
  required_rubygems_version: !ruby/object:Gem::Requirement
234
+ none: false
203
235
  requirements:
204
236
  - - ! '>='
205
237
  - !ruby/object:Gem::Version
206
238
  version: '0'
239
+ segments:
240
+ - 0
241
+ hash: -2133311575629086348
207
242
  requirements: []
208
243
  rubyforge_project:
209
- rubygems_version: 2.4.6
244
+ rubygems_version: 1.8.23.2
210
245
  signing_key:
211
- specification_version: 4
246
+ specification_version: 3
212
247
  summary: Common exception `rescue_from` handling for OpenStax sites.
213
248
  test_files: []
checksums.yaml DELETED
@@ -1,15 +0,0 @@
1
- ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MGVlN2JjZTk3NGUxZDVmOTQwMDRiMDY3Y2IyMzhlZGRlYWVhYTE1OQ==
5
- data.tar.gz: !binary |-
6
- NTc5MDA1MWMyMGJlYzdlMzliODczMzNjYjUyNzg2ZmFmZjc4MjhkYg==
7
- SHA512:
8
- metadata.gz: !binary |-
9
- ZTc1M2UxMzQxMDAxNTc3YmMyZTU2MzY5Yzg0YTU3NTAwZWFmYWQxMTcwMTA0
10
- YWQ3NTVjZDVjMjE0Y2Q5YTM5MTEyMmM2ZjlmOTI0YzM3ODg4ZDAxYTA4MmY2
11
- ZTcxZWIzNjUxZGQ0YzI3YjVhZDQyZDE4OWFkNjBlMzI4ZjE0Yzg=
12
- data.tar.gz: !binary |-
13
- NDY0MDFlMTBhYmYyN2NjNGM2ZWRmMTU2YTM0MDU3YTJjYWI2OGRmYzE4N2U3
14
- OGIwNjU2MzMwZDA0NDUwZmEyMTA3OWM3Mjg3YmJlZDVhY2JhYWY3N2JhMTA4
15
- ZGQ2ODU4NWMyODNkMDkxYTFiM2IwYmViZWI4Mjc5ZDE4MDRlMTE=
data/.ruby-version DELETED
@@ -1 +0,0 @@
1
- 1.9.3