oslg 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/lib/oslg/oslog.rb +21 -21
- data/lib/oslg/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06f0805c49f693fad81b68a22ea45477b786e96e0b2894fc32359eb7821eab81
|
4
|
+
data.tar.gz: e07cf0a2d48399d7768e4fa0ba87897950f130a593721e5699f7e704735bc06d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f103e01be3e08c21952659297316eaac6faccc8e925805d3f32e3a2f6be4c53d40cf804b6f09c0b6866d8e67756b9f162ca99d398299b00bcd62d2b5a5df5c2b
|
7
|
+
data.tar.gz: 74e202302c1bd8eaf0d2ac78519b3bb189d8b274b9c2cce55fa668ca2f43a40ec3741c08e97a08ad025698bf1a250c3173f238946de75efa6aee8fcb680dcaaa
|
data/README.md
CHANGED
@@ -166,7 +166,7 @@ return M.hashkey("faces", faces, :area, "sum") unless faces.key?(:area)
|
|
166
166
|
If the _Hash_ `faces` does not hold `:area` as one of its keys, then __hashkey__ would generate the following DEBUG log message (before returning _nil_):
|
167
167
|
|
168
168
|
```
|
169
|
-
"'
|
169
|
+
"Missing 'area' key in 'faces' Hash (sum)"
|
170
170
|
```
|
171
171
|
|
172
172
|
Similar to __mismatch__, the method __hashkey__ requires 4x arguments (a _Hash_ ID, a valid Ruby _Hash_, the missing _key_, and the calling method ID). There are also 2x optional _terminal_ arguments, e.g. `M::ERROR, false)`.
|
@@ -198,8 +198,8 @@ M.zero("area", "sum", M::FATAL, false) if area.abs < TOL
|
|
198
198
|
... generating the following FATAL log message (before returning _false_):
|
199
199
|
|
200
200
|
```
|
201
|
-
"'area'
|
202
|
-
"'area'
|
201
|
+
"Zero 'area' (sum)"
|
202
|
+
"Zero 'area' (sum)"
|
203
203
|
```
|
204
204
|
|
205
205
|
And again, the first 2x arguments are required; the last 2x are optional.
|
@@ -214,7 +214,7 @@ M.negative("area", "sum", M::FATAL, false) if area < 0
|
|
214
214
|
... generating this FATAL log message (before returning _false_):
|
215
215
|
|
216
216
|
```
|
217
|
-
"'area'
|
217
|
+
"Negative 'area' (sum)"
|
218
218
|
```
|
219
219
|
|
220
220
|
You guessed it: the first 2x arguments are required; the last 2x as optionals.
|
data/lib/oslg/oslog.rb
CHANGED
@@ -169,14 +169,14 @@ module OSlg
|
|
169
169
|
##
|
170
170
|
# Log template 'invalid object' message and return user-set object.
|
171
171
|
#
|
172
|
-
# @param id [String]
|
172
|
+
# @param id [String] invalid object identifier
|
173
173
|
# @param mth [String] calling method identifier
|
174
174
|
# @param ord [String] calling method argument order number of obj (optional)
|
175
175
|
# @param lvl [Integer] DEBUG, INFO, WARN, ERROR or FATAL (optional)
|
176
176
|
# @param res [Object] what to return (optional)
|
177
177
|
#
|
178
|
-
# @return [Object]
|
179
|
-
# @return [Nil] nil if return object
|
178
|
+
# @return [Object] return object if specified by user
|
179
|
+
# @return [Nil] nil if return object missing or invalid
|
180
180
|
def invalid(id = "", mth = "", ord = 0, lvl = DEBUG, res = nil)
|
181
181
|
return nil unless defined?(res)
|
182
182
|
return res unless defined?(id ) && id
|
@@ -200,15 +200,15 @@ module OSlg
|
|
200
200
|
##
|
201
201
|
# Log template 'instance/class mismatch' message and return user-set object.
|
202
202
|
#
|
203
|
-
# @param id [String]
|
203
|
+
# @param id [String] mismatched object identifier
|
204
204
|
# @param obj [Object] object to validate
|
205
205
|
# @param cl [Class] target class
|
206
206
|
# @param mth [String] calling method identifier
|
207
207
|
# @param lvl [Integer] DEBUG, INFO, WARN, ERROR or FATAL (optional)
|
208
208
|
# @param res [Object] what to return (optional)
|
209
209
|
#
|
210
|
-
# @return [Object]
|
211
|
-
# @return [Nil] nil if return object
|
210
|
+
# @return [Object] return object if specified by user
|
211
|
+
# @return [Nil] nil if return object missing or invalid
|
212
212
|
def mismatch(id = "", obj = nil, cl = nil, mth = "", lvl = DEBUG, res = nil)
|
213
213
|
return nil unless defined?(res)
|
214
214
|
return res unless defined?(id ) && id
|
@@ -233,15 +233,15 @@ module OSlg
|
|
233
233
|
##
|
234
234
|
# Log template 'missing hash key' message and return user-set object.
|
235
235
|
#
|
236
|
-
# @param id [String]
|
236
|
+
# @param id [String] Hash identifier
|
237
237
|
# @param hsh [Hash] hash to validate
|
238
|
-
# @param key [Object]
|
238
|
+
# @param key [Object] missing key
|
239
239
|
# @param mth [String] calling method identifier
|
240
240
|
# @param lvl [Integer] DEBUG, INFO, WARN, ERROR or FATAL (optional)
|
241
241
|
# @param res [Object] what to return (optional)
|
242
242
|
#
|
243
|
-
# @return [Object]
|
244
|
-
# @return [Nil] nil if
|
243
|
+
# @return [Object] return object if specified by user
|
244
|
+
# @return [Nil] nil if return object missing or invalid
|
245
245
|
def hashkey(id = "", hsh = {}, key = "", mth = "", lvl = DEBUG, res = nil)
|
246
246
|
return nil unless defined?(res)
|
247
247
|
return res unless defined?(id ) && id
|
@@ -257,7 +257,7 @@ module OSlg
|
|
257
257
|
return res if id.empty?
|
258
258
|
return mismatch(id, hsh, Hash, mth, lvl, res) unless hsh.is_a?(Hash)
|
259
259
|
return res if hsh.key?(key)
|
260
|
-
msg = "'#{
|
260
|
+
msg = "Missing '#{key}' key in '#{id}' Hash (#{mth})"
|
261
261
|
lvl = lvl.to_i unless lvl.is_a?(Integer)
|
262
262
|
log(lvl, msg) if lvl >= DEBUG && lvl <= FATAL
|
263
263
|
res
|
@@ -271,8 +271,8 @@ module OSlg
|
|
271
271
|
# @param lvl [Integer] DEBUG, INFO, WARN, ERROR or FATAL (optional)
|
272
272
|
# @param res [Object] what to return (optional)
|
273
273
|
#
|
274
|
-
# @return [Object]
|
275
|
-
# @return [Nil] nil if return object
|
274
|
+
# @return [Object] return object if specified by user
|
275
|
+
# @return [Nil] nil if return object missing or invalid
|
276
276
|
def empty(id = "", mth = "", lvl = DEBUG, res = nil)
|
277
277
|
return nil unless defined?(res)
|
278
278
|
return res unless defined?(id ) && id
|
@@ -293,13 +293,13 @@ module OSlg
|
|
293
293
|
##
|
294
294
|
# Log template 'near zero' message and return user-set object.
|
295
295
|
#
|
296
|
-
# @param id [String]
|
296
|
+
# @param id [String] zero object identifier
|
297
297
|
# @param mth [String] calling method identifier
|
298
298
|
# @param lvl [Integer] DEBUG, INFO, WARN, ERROR or FATAL (optional)
|
299
299
|
# @param res [Object] what to return (optional)
|
300
300
|
#
|
301
|
-
# @return [Object]
|
302
|
-
# @return [Nil] nil if return object
|
301
|
+
# @return [Object] return object if specified by user
|
302
|
+
# @return [Nil] nil if return object missing or invalid
|
303
303
|
def zero(id = "", mth = "", lvl = DEBUG, res = nil)
|
304
304
|
return nil unless defined?(res)
|
305
305
|
return res unless defined?(id ) && id
|
@@ -311,7 +311,7 @@ module OSlg
|
|
311
311
|
id = id.to_s.strip
|
312
312
|
id = id[0...60] + " ..." if id.length > 60
|
313
313
|
return res if id.empty?
|
314
|
-
msg = "'#{id}'
|
314
|
+
msg = "Zero '#{id}' (#{mth})"
|
315
315
|
lvl = lvl.to_i unless lvl.is_a?(Integer)
|
316
316
|
log(lvl, msg) if lvl >= DEBUG && lvl <= FATAL
|
317
317
|
res
|
@@ -320,13 +320,13 @@ module OSlg
|
|
320
320
|
##
|
321
321
|
# Log template 'negative' message and return user-set object.
|
322
322
|
#
|
323
|
-
# @param id [String]
|
323
|
+
# @param id [String] negative object identifier
|
324
324
|
# @param mth [String] calling method identifier
|
325
325
|
# @param lvl [Integer] DEBUG, INFO, WARN, ERROR or FATAL (optional)
|
326
326
|
# @param res [Object] what to return (optional)
|
327
327
|
#
|
328
|
-
# @return [Object]
|
329
|
-
# @return [Nil] nil if return object
|
328
|
+
# @return [Object] return object if specified by user
|
329
|
+
# @return [Nil] nil if return object missing or invalid
|
330
330
|
def negative(id = "", mth = "", lvl = DEBUG, res = nil)
|
331
331
|
return nil unless defined?(res)
|
332
332
|
return res unless defined?(id ) && id
|
@@ -338,7 +338,7 @@ module OSlg
|
|
338
338
|
id = id.to_s.strip
|
339
339
|
id = id[0...60] + " ..." if id.length > 60
|
340
340
|
return res if id.empty?
|
341
|
-
msg = "'#{id}'
|
341
|
+
msg = "Negative '#{id}' (#{mth})"
|
342
342
|
lvl = lvl.to_i unless lvl.is_a?(Integer)
|
343
343
|
log(lvl, msg) if lvl >= DEBUG && lvl <= FATAL
|
344
344
|
res
|
data/lib/oslg/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oslg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Denis Bourgeois
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-07-
|
11
|
+
date: 2022-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -76,7 +76,7 @@ licenses:
|
|
76
76
|
- BSD-3-Clause
|
77
77
|
metadata:
|
78
78
|
homepage_uri: https://github.com/rd2/oslg
|
79
|
-
source_code_uri: https://github.com/rd2/oslg/tree/v0.2.
|
79
|
+
source_code_uri: https://github.com/rd2/oslg/tree/v0.2.4
|
80
80
|
bug_tracker_uri: https://github.com/rd2/oslg/issues
|
81
81
|
post_install_message:
|
82
82
|
rdoc_options: []
|