xqsr3 0.38.2 → 0.39.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +15 -6
- data/examples/count_word_frequencies.md +12 -12
- data/examples/count_word_frequencies.rb +4 -4
- data/lib/xqsr3/array_utilities/join_with_or.rb +47 -47
- data/lib/xqsr3/array_utilities.rb +2 -2
- data/lib/xqsr3/command_line_utilities/map_option_string.rb +60 -60
- data/lib/xqsr3/command_line_utilities.rb +2 -2
- data/lib/xqsr3/containers/frequency_map.rb +399 -399
- data/lib/xqsr3/containers/multi_map.rb +448 -448
- data/lib/xqsr3/containers.rb +3 -3
- data/lib/xqsr3/conversion/bool_parser.rb +51 -51
- data/lib/xqsr3/conversion/integer_parser.rb +87 -87
- data/lib/xqsr3/conversion.rb +3 -3
- data/lib/xqsr3/diagnostics/exception_utilities.rb +145 -145
- data/lib/xqsr3/diagnostics/exceptions/with_cause.rb +90 -90
- data/lib/xqsr3/diagnostics/inspect_builder.rb +80 -80
- data/lib/xqsr3/diagnostics.rb +3 -3
- data/lib/xqsr3/doc_.rb +130 -130
- data/lib/xqsr3/extensions/array/join_with_or.rb +9 -9
- data/lib/xqsr3/extensions/enumerable/collect_with_index.rb +12 -12
- data/lib/xqsr3/extensions/enumerable/detect_map.rb +35 -35
- data/lib/xqsr3/extensions/enumerable/unique.rb +29 -28
- data/lib/xqsr3/extensions/hash/deep_transform.rb +1 -1
- data/lib/xqsr3/extensions/hash/except.rb +16 -16
- data/lib/xqsr3/extensions/hash/has_match.rb +10 -10
- data/lib/xqsr3/extensions/hash/match.rb +10 -10
- data/lib/xqsr3/extensions/hash/slice.rb +11 -11
- data/lib/xqsr3/extensions/hash.rb +1 -1
- data/lib/xqsr3/extensions/integer/to_s_grp.rb +118 -0
- data/lib/xqsr3/extensions/integer.rb +3 -0
- data/lib/xqsr3/extensions/io/writelines.rb +28 -28
- data/lib/xqsr3/extensions/kernel/integer.rb +20 -20
- data/lib/xqsr3/extensions/kernel/raise_with_options.rb +8 -8
- data/lib/xqsr3/extensions/kernel.rb +1 -0
- data/lib/xqsr3/extensions/string/ends_with.rb +1 -1
- data/lib/xqsr3/extensions/string/map_option_string.rb +4 -4
- data/lib/xqsr3/extensions/string/nil_if_empty.rb +1 -1
- data/lib/xqsr3/extensions/string/nil_if_whitespace.rb +1 -1
- data/lib/xqsr3/extensions/string/quote_if.rb +1 -1
- data/lib/xqsr3/extensions/string/starts_with.rb +1 -1
- data/lib/xqsr3/extensions/string/to_bool.rb +8 -8
- data/lib/xqsr3/extensions/string/to_symbol.rb +1 -1
- data/lib/xqsr3/extensions/string/truncate.rb +1 -1
- data/lib/xqsr3/extensions/test/unit/assert_eql.rb +10 -7
- data/lib/xqsr3/extensions/test/unit/assert_false.rb +9 -6
- data/lib/xqsr3/extensions/test/unit/assert_not.rb +9 -6
- data/lib/xqsr3/extensions/test/unit/assert_not_eql.rb +10 -7
- data/lib/xqsr3/extensions/test/unit/assert_raise_with_message.rb +61 -61
- data/lib/xqsr3/extensions/test/unit/assert_subclass_of.rb +10 -7
- data/lib/xqsr3/extensions/test/unit/assert_superclass_of.rb +10 -7
- data/lib/xqsr3/extensions/test/unit/assert_true.rb +9 -6
- data/lib/xqsr3/extensions/test/unit/assert_type_has_instance_methods.rb +39 -36
- data/lib/xqsr3/extensions.rb +5 -5
- data/lib/xqsr3/hash_utilities/deep_transform.rb +65 -65
- data/lib/xqsr3/hash_utilities/key_matching.rb +77 -77
- data/lib/xqsr3/hash_utilities.rb +3 -3
- data/lib/xqsr3/internal_/test_unit_version_.rb +83 -83
- data/lib/xqsr3/io/writelines.rb +122 -120
- data/lib/xqsr3/quality/parameter_checking.rb +445 -445
- data/lib/xqsr3/quality.rb +2 -2
- data/lib/xqsr3/string_utilities/ends_with.rb +59 -59
- data/lib/xqsr3/string_utilities/nil_if_empty.rb +28 -28
- data/lib/xqsr3/string_utilities/nil_if_whitespace.rb +29 -29
- data/lib/xqsr3/string_utilities/quote_if.rb +50 -50
- data/lib/xqsr3/string_utilities/starts_with.rb +59 -59
- data/lib/xqsr3/string_utilities/to_symbol.rb +75 -75
- data/lib/xqsr3/string_utilities/truncate.rb +55 -55
- data/lib/xqsr3/string_utilities.rb +8 -8
- data/lib/xqsr3/version.rb +12 -12
- data/test/performance/frequency_map.rb +12 -12
- data/test/scratch/test_assert_raise_with_message.rb +11 -11
- data/test/unit/array_utilities/tc_join_with_or.rb +140 -140
- data/test/unit/command_line_utilities/tc_map_option_string.rb +18 -18
- data/test/unit/containers/tc_frequency_map.rb +591 -591
- data/test/unit/containers/tc_multi_map.rb +558 -558
- data/test/unit/conversion/tc_integer_parser.rb +72 -72
- data/test/unit/conversion/tc_to_bool.rb +25 -25
- data/test/unit/diagnostics/exceptions/tc_with_cause.rb +165 -165
- data/test/unit/diagnostics/tc_exception_utilities.rb +156 -156
- data/test/unit/extensions/enumerable/tc_collect_with_index.rb +14 -14
- data/test/unit/extensions/enumerable/tc_detect_map.rb +20 -20
- data/test/unit/extensions/enumerable/tc_unique.rb +34 -34
- data/test/unit/extensions/hash/tc_deep_transform.rb +22 -22
- data/test/unit/extensions/hash/tc_except.rb +28 -28
- data/test/unit/extensions/hash/tc_slice.rb +13 -13
- data/test/unit/extensions/integer/tc_to_s_grp.rb +60 -0
- data/test/unit/extensions/integer/ts_all.rb +12 -0
- data/test/unit/extensions/io/tc_writelines.rb +149 -77
- data/test/unit/extensions/kernel/tc_integer.rb +75 -75
- data/test/unit/extensions/kernel/tc_raise_with_options.rb +155 -155
- data/test/unit/extensions/object/tc_inspect.rb +50 -50
- data/test/unit/extensions/string/tc_bool.tb +24 -24
- data/test/unit/extensions/string/tc_ends_with.rb +53 -53
- data/test/unit/extensions/string/tc_map_option_string.rb +15 -15
- data/test/unit/extensions/string/tc_nil_if_empty.rb +8 -8
- data/test/unit/extensions/string/tc_nil_if_whitespace.rb +8 -8
- data/test/unit/extensions/string/tc_quote_if.rb +18 -18
- data/test/unit/extensions/string/tc_starts_with.rb +53 -53
- data/test/unit/extensions/string/tc_to_symbol.rb +26 -26
- data/test/unit/extensions/string/tc_truncate.rb +18 -18
- data/test/unit/extensions/test/unit/tc_assert_raise_with_message.rb +16 -16
- data/test/unit/extensions/test/unit/tc_assert_subclass_of.rb +9 -9
- data/test/unit/extensions/test/unit/tc_assert_superclass_of.rb +9 -9
- data/test/unit/hash_utilities/tc_has_match.rb +70 -70
- data/test/unit/hash_utilities/tc_match.rb +83 -83
- data/test/unit/io/tc_writelines.rb +166 -106
- data/test/unit/quality/tc_parameter_checking.rb +389 -389
- data/test/unit/string_utilities/tc_truncate.rb +27 -27
- data/test/unit/tc_version.rb +15 -15
- metadata +6 -2
@@ -9,41 +9,41 @@ require 'test/unit'
|
|
9
9
|
|
10
10
|
class Test_StringUtilities_Truncate < ::Test::Unit::TestCase
|
11
11
|
|
12
|
-
|
12
|
+
Truncator = ::Xqsr3::StringUtilities::Truncate
|
13
13
|
|
14
|
-
|
14
|
+
def test_truncate_of_empty_string
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
16
|
+
assert_equal '', Truncator.string_truncate('', 0)
|
17
|
+
assert_equal '', Truncator.string_truncate('', 1)
|
18
|
+
assert_equal '', Truncator.string_truncate('', 10)
|
19
|
+
end
|
20
20
|
|
21
|
-
|
21
|
+
def test_truncate_of_smallest_string
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
23
|
+
assert_equal '', Truncator.string_truncate('a', 0)
|
24
|
+
assert_equal 'a', Truncator.string_truncate('a', 1)
|
25
|
+
assert_equal 'a', Truncator.string_truncate('a', 10)
|
26
|
+
end
|
27
27
|
|
28
|
-
|
28
|
+
def test_truncate_of_smaller_string
|
29
29
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
30
|
+
assert_equal '', Truncator.string_truncate('abc', 0)
|
31
|
+
assert_equal '.', Truncator.string_truncate('abc', 1)
|
32
|
+
assert_equal '..', Truncator.string_truncate('abc', 2)
|
33
|
+
assert_equal 'abc', Truncator.string_truncate('abc', 3)
|
34
|
+
assert_equal 'abc', Truncator.string_truncate('abc', 4)
|
35
|
+
assert_equal 'abc', Truncator.string_truncate('abc', 10)
|
36
|
+
end
|
37
37
|
|
38
|
-
|
38
|
+
def test_truncate_of_small_string
|
39
39
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
40
|
+
assert_equal '', Truncator.string_truncate('abcdefghijklmnopqrstuvwxyz', 0)
|
41
|
+
assert_equal '.', Truncator.string_truncate('abcdefghijklmnopqrstuvwxyz', 1)
|
42
|
+
assert_equal '..', Truncator.string_truncate('abcdefghijklmnopqrstuvwxyz', 2)
|
43
|
+
assert_equal '...', Truncator.string_truncate('abcdefghijklmnopqrstuvwxyz', 3)
|
44
|
+
assert_equal 'a...', Truncator.string_truncate('abcdefghijklmnopqrstuvwxyz', 4)
|
45
|
+
assert_equal 'abcdefg...', Truncator.string_truncate('abcdefghijklmnopqrstuvwxyz', 10)
|
46
|
+
end
|
47
47
|
|
48
48
|
|
49
49
|
end
|
data/test/unit/tc_version.rb
CHANGED
@@ -8,29 +8,29 @@ require 'test/unit'
|
|
8
8
|
|
9
9
|
class Test_version < Test::Unit::TestCase
|
10
10
|
|
11
|
-
|
11
|
+
def test_has_VERSION
|
12
12
|
|
13
|
-
|
14
|
-
|
13
|
+
assert defined? Xqsr3::VERSION
|
14
|
+
end
|
15
15
|
|
16
|
-
|
16
|
+
def test_has_VERSION_MAJOR
|
17
17
|
|
18
|
-
|
19
|
-
|
18
|
+
assert defined? Xqsr3::VERSION_MAJOR
|
19
|
+
end
|
20
20
|
|
21
|
-
|
21
|
+
def test_has_VERSION_MINOR
|
22
22
|
|
23
|
-
|
24
|
-
|
23
|
+
assert defined? Xqsr3::VERSION_MINOR
|
24
|
+
end
|
25
25
|
|
26
|
-
|
26
|
+
def test_has_VERSION_REVISION
|
27
27
|
|
28
|
-
|
29
|
-
|
28
|
+
assert defined? Xqsr3::VERSION_REVISION
|
29
|
+
end
|
30
30
|
|
31
|
-
|
31
|
+
def test_VERSION_has_consistent_format
|
32
32
|
|
33
|
-
|
34
|
-
|
33
|
+
assert_equal Xqsr3::VERSION.split('.')[0..2].join('.'), "#{Xqsr3::VERSION_MAJOR}.#{Xqsr3::VERSION_MINOR}.#{Xqsr3::VERSION_REVISION}"
|
34
|
+
end
|
35
35
|
end
|
36
36
|
|
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.
|
4
|
+
version: 0.39.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: 2024-
|
11
|
+
date: 2024-04-12 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
|
@@ -52,6 +52,8 @@ files:
|
|
52
52
|
- lib/xqsr3/extensions/hash/has_match.rb
|
53
53
|
- lib/xqsr3/extensions/hash/match.rb
|
54
54
|
- lib/xqsr3/extensions/hash/slice.rb
|
55
|
+
- lib/xqsr3/extensions/integer.rb
|
56
|
+
- lib/xqsr3/extensions/integer/to_s_grp.rb
|
55
57
|
- lib/xqsr3/extensions/io.rb
|
56
58
|
- lib/xqsr3/extensions/io/writelines.rb
|
57
59
|
- lib/xqsr3/extensions/kernel.rb
|
@@ -118,6 +120,8 @@ files:
|
|
118
120
|
- test/unit/extensions/hash/tc_hash.rb
|
119
121
|
- test/unit/extensions/hash/tc_slice.rb
|
120
122
|
- test/unit/extensions/hash/ts_all.rb
|
123
|
+
- test/unit/extensions/integer/tc_to_s_grp.rb
|
124
|
+
- test/unit/extensions/integer/ts_all.rb
|
121
125
|
- test/unit/extensions/io/tc_writelines.rb
|
122
126
|
- test/unit/extensions/io/ts_all.rb
|
123
127
|
- test/unit/extensions/kernel/tc_integer.rb
|