roda 3.37.0 → 3.38.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: de8c769572875e477058b48557b22861b9de731fa3b00b20a3022a67c929609d
4
- data.tar.gz: 5cacc0d7b988bd3dc5bafbc30fcac145f6f67ddcc0e7809e1fc9cd60d8a16273
3
+ metadata.gz: 5b28900f838d40c98d868225a5d2f0e1fcfd24ccf0bdbf770f0ccb79ac2ba2fe
4
+ data.tar.gz: 8f2c37b04485af74a1e8c2c68f5eeb31b0531d82b4f55c6df4145cfe344cf86f
5
5
  SHA512:
6
- metadata.gz: 1bf7df28d82f31820cd19c29b5a3f0f3afbbae2c41cf05974b16698c7ffb1725e924491874ddbb3f355a88990d4aab6d5b5b38f2d9c7612a548bfe0e3701ac2e
7
- data.tar.gz: 32fca636d6324d29958cbcdf5c949c413eaeda7b74a701032d5766a60ec6b3f2db7ec262268dac697c3b3f5f9b183e127ddf265c7ba5015578969bc7f8be02a2
6
+ metadata.gz: e2cb67bbc5509acba608530dc8641059cb4aa450f8cf0bdca82f57dabba48c751a50e770f902b0ed64da63d2988c89884e074991a49956d03188ea8efaab7793
7
+ data.tar.gz: 66a2ad67a5f4abd5e275f77eddde74f4dd6430c222cf208d9aafc01577fbfae548367f8b71864834cb4067ae530ece68df66165c4352bfc151b35bee8c5e2041
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ = 3.38.0 (2020-11-16)
2
+
3
+ * Make error_email and error_mail plugins rescue invalid parameter errors when preparing the email body (jeremyevans)
4
+
1
5
  = 3.37.0 (2020-10-16)
2
6
 
3
7
  * Add custom_matchers plugin, for supporting arbitrary objects as matchers (jeremyevans)
@@ -0,0 +1,5 @@
1
+ = Improvements
2
+
3
+ * The error_email and error_mail plugins now rescue invalid parameter
4
+ errors when preparing the email body, because you generally don't
5
+ want your error handler to raise an exception.
@@ -54,6 +54,13 @@ class Roda
54
54
  :body=>lambda do |s, e|
55
55
  format = lambda{|h| h.map{|k, v| "#{k.inspect} => #{v.inspect}"}.sort.join("\n")}
56
56
 
57
+ begin
58
+ params = s.request.params
59
+ params = (format[params] unless params.empty?)
60
+ rescue
61
+ params = 'Invalid Parameters!'
62
+ end
63
+
57
64
  message = String.new
58
65
  message << <<END
59
66
  Path: #{s.request.path}
@@ -73,12 +80,12 @@ ENV:
73
80
  #{format[s.env]}
74
81
  END
75
82
 
76
- unless s.request.params.empty?
83
+ if params
77
84
  message << <<END
78
85
 
79
86
  Params:
80
87
 
81
- #{format[s.request.params]}
88
+ #{params}
82
89
  END
83
90
  end
84
91
 
@@ -71,6 +71,13 @@ class Roda
71
71
 
72
72
  format = lambda{|h| h.map{|k, v| "#{k.inspect} => #{v.inspect}"}.sort.join("\n")}
73
73
 
74
+ begin
75
+ params = request.params
76
+ params = (format[params] unless params.empty?)
77
+ rescue
78
+ params = 'Invalid Parameters!'
79
+ end
80
+
74
81
  message = String.new
75
82
  message << <<END
76
83
  Path: #{request.path}
@@ -91,12 +98,12 @@ ENV:
91
98
  #{format[env]}
92
99
  END
93
100
 
94
- unless request.params.empty?
101
+ if params
95
102
  message << <<END
96
103
 
97
104
  Params:
98
105
 
99
- #{format[request.params]}
106
+ #{params}
100
107
  END
101
108
  end
102
109
 
@@ -4,7 +4,7 @@ class Roda
4
4
  RodaMajorVersion = 3
5
5
 
6
6
  # The minor version of Roda, updated for new feature releases of Roda.
7
- RodaMinorVersion = 37
7
+ RodaMinorVersion = 38
8
8
 
9
9
  # The patch version of Roda, updated only for bug fixes from the last
10
10
  # feature release.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roda
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.37.0
4
+ version: 3.38.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Evans
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-16 00:00:00.000000000 Z
11
+ date: 2020-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -213,6 +213,7 @@ extra_rdoc_files:
213
213
  - doc/release_notes/3.35.0.txt
214
214
  - doc/release_notes/3.36.0.txt
215
215
  - doc/release_notes/3.37.0.txt
216
+ - doc/release_notes/3.38.0.txt
216
217
  files:
217
218
  - CHANGELOG
218
219
  - MIT-LICENSE
@@ -251,6 +252,7 @@ files:
251
252
  - doc/release_notes/3.35.0.txt
252
253
  - doc/release_notes/3.36.0.txt
253
254
  - doc/release_notes/3.37.0.txt
255
+ - doc/release_notes/3.38.0.txt
254
256
  - doc/release_notes/3.4.0.txt
255
257
  - doc/release_notes/3.5.0.txt
256
258
  - doc/release_notes/3.6.0.txt