xqsr3 0.12.1 → 0.12.2
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 +4 -4
- data/lib/xqsr3/diagnostics/exception_utilities.rb +5 -5
- data/lib/xqsr3/extensions/kernel/raise_with_options.rb +3 -3
- data/lib/xqsr3/hash_utilities/deep_transform.rb +11 -11
- data/lib/xqsr3/quality/parameter_checking.rb +0 -2
- data/lib/xqsr3/version.rb +2 -2
- data/test/unit/command_line_utilities/ts_all.rb +0 -1
- data/test/unit/containers/ts_all.rb +0 -1
- data/test/unit/conversion/ts_all.rb +0 -1
- data/test/unit/diagnostics/ts_all.rb +0 -1
- data/test/unit/extensions/enumerable/ts_all.rb +0 -1
- data/test/unit/extensions/hash/ts_all.rb +0 -1
- data/test/unit/extensions/io/ts_all.rb +0 -1
- data/test/unit/extensions/kernel/ts_all.rb +0 -1
- data/test/unit/extensions/string/tc_ends_with.rb +7 -7
- data/test/unit/extensions/string/tc_starts_with.rb +7 -7
- data/test/unit/extensions/string/ts_all.rb +0 -1
- data/test/unit/extensions/ts_all.rb +0 -1
- data/test/unit/io/ts_all.rb +0 -1
- data/test/unit/quality/tc_parameter_checking.rb +4 -4
- data/test/unit/quality/ts_all.rb +0 -1
- data/test/unit/ts_all.rb +0 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 44bdb62fca711d8ee10e0da50888cae988043f26
|
4
|
+
data.tar.gz: 22b017fcf0f07ef6395c123d4ed81650d27d3967
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49916563cc5b10a5103716b0555d8d2dcea1b38481d8d6b7bdf951834505a10a79aac39f8e5c6bbba513966da207f2a2f57e90aef7fa28e1563a39d6a68ab453
|
7
|
+
data.tar.gz: 3e03a355c86b3227d7a9c5f4966c99f55c3ab5953569becc6f2d1696ff08ee1de5ab7a9fbc9c76dd598159846b48aa3e113fe211a529f1c8142980686897be77
|
@@ -5,13 +5,13 @@
|
|
5
5
|
# Purpose: Definition of the ExceptionUtilities module
|
6
6
|
#
|
7
7
|
# Created: 12th February 2015
|
8
|
-
# Updated:
|
8
|
+
# Updated: 22nd June 2017
|
9
9
|
#
|
10
10
|
# Home: http://github.com/synesissoftware/xqsr3
|
11
11
|
#
|
12
12
|
# Author: Matthew Wilson
|
13
13
|
#
|
14
|
-
# Copyright (c) 2015-
|
14
|
+
# Copyright (c) 2015-2017, Matthew Wilson and Synesis Software
|
15
15
|
# All rights reserved.
|
16
16
|
#
|
17
17
|
# Redistribution and use in source and binary forms, with or without
|
@@ -165,7 +165,7 @@ module ExceptionUtilities
|
|
165
165
|
|
166
166
|
xargs << args.shift unless args.empty?
|
167
167
|
|
168
|
-
x = exception_class_or_instance_or_message_string.new
|
168
|
+
x = exception_class_or_instance_or_message_string.new(*xargs, **options)
|
169
169
|
|
170
170
|
rargs = []
|
171
171
|
rargs << x
|
@@ -175,7 +175,7 @@ module ExceptionUtilities
|
|
175
175
|
|
176
176
|
begin
|
177
177
|
|
178
|
-
Kernel.raise
|
178
|
+
Kernel.raise(*rargs)
|
179
179
|
rescue => x
|
180
180
|
|
181
181
|
bt = x.backtrace
|
@@ -199,7 +199,7 @@ module ExceptionUtilities
|
|
199
199
|
|
200
200
|
begin
|
201
201
|
|
202
|
-
Kernel.raise
|
202
|
+
Kernel.raise(*args)
|
203
203
|
rescue => x
|
204
204
|
|
205
205
|
bt = x.backtrace
|
@@ -5,13 +5,13 @@
|
|
5
5
|
# Purpose: Adds a raise_with_options() method to the Kernel module
|
6
6
|
#
|
7
7
|
# Created: 12th February 2015
|
8
|
-
# Updated:
|
8
|
+
# Updated: 22nd June 2017
|
9
9
|
#
|
10
10
|
# Home: http://github.com/synesissoftware/xqsr3
|
11
11
|
#
|
12
12
|
# Author: Matthew Wilson
|
13
13
|
#
|
14
|
-
# Copyright (c) 2015-
|
14
|
+
# Copyright (c) 2015-2017, Matthew Wilson and Synesis Software
|
15
15
|
# All rights reserved.
|
16
16
|
#
|
17
17
|
# Redistribution and use in source and binary forms, with or without
|
@@ -60,7 +60,7 @@ module Kernel
|
|
60
60
|
|
61
61
|
options ||= {}
|
62
62
|
|
63
|
-
::Xqsr3::Diagnostics::ExceptionUtilities.raise_with_options
|
63
|
+
::Xqsr3::Diagnostics::ExceptionUtilities.raise_with_options(*args, **(options.merge({ :called_indirectly_06d353cb_5a6c_47ca_8dbe_ff76359c7e96 => 1})))
|
64
64
|
end
|
65
65
|
end # module Kernel
|
66
66
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
# module
|
7
7
|
#
|
8
8
|
# Created: 3rd June 2017
|
9
|
-
# Updated:
|
9
|
+
# Updated: 22nd June 2017
|
10
10
|
#
|
11
11
|
# Home: http://github.com/synesissoftware/xqsr3
|
12
12
|
#
|
@@ -67,8 +67,8 @@ module DeepTransform
|
|
67
67
|
h =
|
68
68
|
Hash[h.map do |k, v|
|
69
69
|
|
70
|
-
k = k.deep_transform
|
71
|
-
v = v.deep_transform
|
70
|
+
k = k.deep_transform(&block) if ::Hash === k
|
71
|
+
v = v.deep_transform(&block) if ::Hash === v
|
72
72
|
|
73
73
|
[yield(k), v]
|
74
74
|
end]
|
@@ -77,8 +77,8 @@ module DeepTransform
|
|
77
77
|
h =
|
78
78
|
Hash[h.map do |k, v|
|
79
79
|
|
80
|
-
k = k.deep_transform
|
81
|
-
v = v.deep_transform
|
80
|
+
k = k.deep_transform(&block) if ::Hash === k
|
81
|
+
v = v.deep_transform(&block) if ::Hash === v
|
82
82
|
|
83
83
|
yield(k, v)
|
84
84
|
end]
|
@@ -101,8 +101,8 @@ module DeepTransform
|
|
101
101
|
|
102
102
|
v = self.delete k
|
103
103
|
|
104
|
-
k = k.deep_transform
|
105
|
-
v = v.deep_transform
|
104
|
+
k = k.deep_transform(&block) if ::Hash === k
|
105
|
+
v = v.deep_transform(&block) if ::Hash === v
|
106
106
|
|
107
107
|
self[yield(k)] = v
|
108
108
|
end
|
@@ -112,8 +112,8 @@ module DeepTransform
|
|
112
112
|
|
113
113
|
v = self.delete k
|
114
114
|
|
115
|
-
k = k.deep_transform
|
116
|
-
v = v.deep_transform
|
115
|
+
k = k.deep_transform(&block) if ::Hash === k
|
116
|
+
v = v.deep_transform(&block) if ::Hash === v
|
117
117
|
|
118
118
|
k, v = yield(k, v)
|
119
119
|
end
|
@@ -130,7 +130,7 @@ module DeepTransform
|
|
130
130
|
# block) or keys and values (2-parameter block) are transformed.
|
131
131
|
def deep_transform &block
|
132
132
|
|
133
|
-
DeepTransform.do_deep_transform_on_hashlike_
|
133
|
+
DeepTransform.do_deep_transform_on_hashlike_(self, &block)
|
134
134
|
end
|
135
135
|
|
136
136
|
# Executes the given mandatory 1- or 2-parameter block on the receiving
|
@@ -142,7 +142,7 @@ module DeepTransform
|
|
142
142
|
# transformation can result in a partially transformed instance
|
143
143
|
def deep_transform! &block
|
144
144
|
|
145
|
-
do_deep_transform_on_self_
|
145
|
+
do_deep_transform_on_self_(&block)
|
146
146
|
end
|
147
147
|
|
148
148
|
end # module DeepTransform
|
@@ -141,7 +141,6 @@ module ParameterChecking
|
|
141
141
|
|
142
142
|
types = options[:types] || []
|
143
143
|
types = [value.class] if types.empty?
|
144
|
-
type_found = false
|
145
144
|
|
146
145
|
warn "#{self}::check_parameter: options[:types] of type #{types.class} - should be #{::Array}" unless types.is_a?(Array)
|
147
146
|
warn "#{self}::check_parameter: options[:types] should contain only classes or arrays of classes" if types.is_a?(::Array) && !types.all? { |c| ::Class === c || (::Array === c || c.all? { |c2| ::Class === c2 }) }
|
@@ -168,7 +167,6 @@ module ParameterChecking
|
|
168
167
|
unless message
|
169
168
|
|
170
169
|
s_name = name.is_a?(String) ? "'#{name}' " : ''
|
171
|
-
s_be = 'be' #::Array === value ? 'contain' : 'be'
|
172
170
|
|
173
171
|
types_0 = types.select { |t| ::Class === t }.uniq
|
174
172
|
types_ar = types.select { |t| ::Array === t }.flatten.uniq
|
data/lib/xqsr3/version.rb
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
# Purpose: Version for Xqsr3 library
|
6
6
|
#
|
7
7
|
# Created: 3rd April 2016
|
8
|
-
# Updated:
|
8
|
+
# Updated: 22nd June 2017
|
9
9
|
#
|
10
10
|
# Home: http://github.com/synesissoftware/xqsr3
|
11
11
|
#
|
@@ -50,7 +50,7 @@
|
|
50
50
|
module Xqsr3
|
51
51
|
|
52
52
|
# Current version of the Xqsr3 library
|
53
|
-
VERSION = '0.12.
|
53
|
+
VERSION = '0.12.2'
|
54
54
|
|
55
55
|
private
|
56
56
|
VERSION_PARTS_ = VERSION.split(/[.]/).collect { |n| n.to_i } # :nodoc:
|
@@ -57,13 +57,13 @@ class Test_String_ends_with < Test::Unit::TestCase
|
|
57
57
|
|
58
58
|
prefixes = %w{ a c def }
|
59
59
|
|
60
|
-
assert_not ''.ends_with?
|
61
|
-
assert_nil ''.ends_with?
|
62
|
-
assert ''.ends_with?
|
63
|
-
assert 'abc'.ends_with?
|
64
|
-
assert_not 'd'.ends_with?
|
65
|
-
assert_nil 'd'.ends_with?
|
66
|
-
assert 'abcdef'.ends_with?
|
60
|
+
assert_not ''.ends_with?(*prefixes)
|
61
|
+
assert_nil ''.ends_with?(*prefixes)
|
62
|
+
assert ''.ends_with?(*prefixes), ''
|
63
|
+
assert 'abc'.ends_with?(*prefixes)
|
64
|
+
assert_not 'd'.ends_with?(*prefixes)
|
65
|
+
assert_nil 'd'.ends_with?(*prefixes)
|
66
|
+
assert 'abcdef'.ends_with?(*prefixes)
|
67
67
|
end
|
68
68
|
end
|
69
69
|
|
@@ -57,13 +57,13 @@ class Test_String_starts_with < Test::Unit::TestCase
|
|
57
57
|
|
58
58
|
prefixes = %w{ a c def }
|
59
59
|
|
60
|
-
assert_not ''.starts_with?
|
61
|
-
assert_nil ''.starts_with?
|
62
|
-
assert ''.starts_with?
|
63
|
-
assert 'abc'.starts_with?
|
64
|
-
assert_not 'd'.starts_with?
|
65
|
-
assert_nil 'd'.starts_with?
|
66
|
-
assert 'defghi'.starts_with?
|
60
|
+
assert_not ''.starts_with?(*prefixes)
|
61
|
+
assert_nil ''.starts_with?(*prefixes)
|
62
|
+
assert ''.starts_with?(*prefixes), ''
|
63
|
+
assert 'abc'.starts_with?(*prefixes)
|
64
|
+
assert_not 'd'.starts_with?(*prefixes)
|
65
|
+
assert_nil 'd'.starts_with?(*prefixes)
|
66
|
+
assert 'defghi'.starts_with?(*prefixes)
|
67
67
|
end
|
68
68
|
end
|
69
69
|
|
data/test/unit/io/ts_all.rb
CHANGED
@@ -156,7 +156,7 @@ end
|
|
156
156
|
assert(false, 'should not get here')
|
157
157
|
rescue TypeError => ax
|
158
158
|
|
159
|
-
assert_match
|
159
|
+
assert_match(/^parameter 'a' \(String\) must be an instance of Hash$/, ax.message)
|
160
160
|
rescue => x
|
161
161
|
|
162
162
|
assert(false, "wrong exception type #{x.class} (with message '#{x.message}')")
|
@@ -169,7 +169,7 @@ end
|
|
169
169
|
assert(false, 'should not get here')
|
170
170
|
rescue ArgumentError => ax
|
171
171
|
|
172
|
-
assert_match
|
172
|
+
assert_match(/^parameter 'a' value '' not found equal\/within any of required values or ranges$/, ax.message)
|
173
173
|
rescue => x
|
174
174
|
|
175
175
|
assert(false, "wrong exception type #{x.class} (with message '#{x.message}')")
|
@@ -203,7 +203,7 @@ end
|
|
203
203
|
assert(false, 'should not get here')
|
204
204
|
rescue TypeError => ax
|
205
205
|
|
206
|
-
assert_match
|
206
|
+
assert_match(/^parameter 'a' \(Array\) must be an instance of Symbol or Hash, or an array containing instance\(s\) of Regexp or Symbol$/, ax.message)
|
207
207
|
rescue => x
|
208
208
|
|
209
209
|
assert(false, "wrong exception type #{x.class}) (with message '#{x.message}'")
|
@@ -216,7 +216,7 @@ end
|
|
216
216
|
assert(false, 'should not get here')
|
217
217
|
rescue TypeError => ax
|
218
218
|
|
219
|
-
assert_match
|
219
|
+
assert_match(/^parameter 'a' \(Array\) must be an array containing instance\(s\) of Regexp or Symbol$/, ax.message)
|
220
220
|
rescue => x
|
221
221
|
|
222
222
|
assert(false, "wrong exception type #{x.class}) (with message '#{x.message}'")
|
data/test/unit/quality/ts_all.rb
CHANGED
data/test/unit/ts_all.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xqsr3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.12.
|
4
|
+
version: 0.12.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Wilson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |
|
14
14
|
eXtensions by fine Quantum for Standard Ruby and 3rd-party libraries is a
|