xqsr3 0.38.1.1 → 0.39.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +15 -6
  3. data/examples/count_word_frequencies.md +13 -13
  4. data/examples/count_word_frequencies.rb +5 -5
  5. data/lib/xqsr3/array_utilities/join_with_or.rb +53 -54
  6. data/lib/xqsr3/array_utilities.rb +2 -2
  7. data/lib/xqsr3/command_line_utilities/map_option_string.rb +66 -67
  8. data/lib/xqsr3/command_line_utilities.rb +2 -2
  9. data/lib/xqsr3/containers/frequency_map.rb +405 -404
  10. data/lib/xqsr3/containers/multi_map.rb +454 -453
  11. data/lib/xqsr3/containers.rb +3 -3
  12. data/lib/xqsr3/conversion/bool_parser.rb +56 -57
  13. data/lib/xqsr3/conversion/integer_parser.rb +92 -93
  14. data/lib/xqsr3/conversion.rb +3 -3
  15. data/lib/xqsr3/diagnostics/exception_utilities.rb +152 -151
  16. data/lib/xqsr3/diagnostics/exceptions/with_cause.rb +99 -95
  17. data/lib/xqsr3/diagnostics/inspect_builder.rb +86 -86
  18. data/lib/xqsr3/diagnostics.rb +3 -3
  19. data/lib/xqsr3/doc_.rb +136 -136
  20. data/lib/xqsr3/extensions/array/join_with_or.rb +9 -9
  21. data/lib/xqsr3/extensions/enumerable/collect_with_index.rb +18 -17
  22. data/lib/xqsr3/extensions/enumerable/detect_map.rb +41 -41
  23. data/lib/xqsr3/extensions/enumerable/unique.rb +32 -31
  24. data/lib/xqsr3/extensions/hash/deep_transform.rb +1 -1
  25. data/lib/xqsr3/extensions/hash/except.rb +16 -16
  26. data/lib/xqsr3/extensions/hash/has_match.rb +10 -10
  27. data/lib/xqsr3/extensions/hash/match.rb +10 -10
  28. data/lib/xqsr3/extensions/hash/slice.rb +11 -11
  29. data/lib/xqsr3/extensions/hash.rb +1 -1
  30. data/lib/xqsr3/extensions/integer/to_s_grp.rb +118 -0
  31. data/lib/xqsr3/extensions/integer.rb +3 -0
  32. data/lib/xqsr3/extensions/io/writelines.rb +34 -34
  33. data/lib/xqsr3/extensions/kernel/integer.rb +26 -26
  34. data/lib/xqsr3/extensions/kernel/raise_with_options.rb +15 -14
  35. data/lib/xqsr3/extensions/kernel.rb +1 -0
  36. data/lib/xqsr3/extensions/string/ends_with.rb +1 -1
  37. data/lib/xqsr3/extensions/string/map_option_string.rb +4 -5
  38. data/lib/xqsr3/extensions/string/nil_if_empty.rb +1 -1
  39. data/lib/xqsr3/extensions/string/nil_if_whitespace.rb +1 -1
  40. data/lib/xqsr3/extensions/string/quote_if.rb +1 -2
  41. data/lib/xqsr3/extensions/string/starts_with.rb +1 -1
  42. data/lib/xqsr3/extensions/string/to_bool.rb +8 -9
  43. data/lib/xqsr3/extensions/string/to_symbol.rb +1 -1
  44. data/lib/xqsr3/extensions/string/truncate.rb +1 -2
  45. data/lib/xqsr3/extensions/test/unit/assert_eql.rb +7 -7
  46. data/lib/xqsr3/extensions/test/unit/assert_false.rb +6 -7
  47. data/lib/xqsr3/extensions/test/unit/assert_not.rb +6 -7
  48. data/lib/xqsr3/extensions/test/unit/assert_not_eql.rb +7 -7
  49. data/lib/xqsr3/extensions/test/unit/assert_raise_with_message.rb +61 -62
  50. data/lib/xqsr3/extensions/test/unit/assert_subclass_of.rb +7 -8
  51. data/lib/xqsr3/extensions/test/unit/assert_superclass_of.rb +7 -8
  52. data/lib/xqsr3/extensions/test/unit/assert_true.rb +6 -7
  53. data/lib/xqsr3/extensions/test/unit/assert_type_has_instance_methods.rb +36 -38
  54. data/lib/xqsr3/extensions.rb +5 -5
  55. data/lib/xqsr3/hash_utilities/deep_transform.rb +71 -71
  56. data/lib/xqsr3/hash_utilities/key_matching.rb +82 -82
  57. data/lib/xqsr3/hash_utilities.rb +3 -3
  58. data/lib/xqsr3/internal_/test_unit_version_.rb +130 -88
  59. data/lib/xqsr3/io/writelines.rb +125 -125
  60. data/lib/xqsr3/quality/parameter_checking.rb +452 -453
  61. data/lib/xqsr3/quality.rb +2 -2
  62. data/lib/xqsr3/string_utilities/ends_with.rb +64 -64
  63. data/lib/xqsr3/string_utilities/nil_if_empty.rb +33 -34
  64. data/lib/xqsr3/string_utilities/nil_if_whitespace.rb +35 -35
  65. data/lib/xqsr3/string_utilities/quote_if.rb +55 -56
  66. data/lib/xqsr3/string_utilities/starts_with.rb +64 -64
  67. data/lib/xqsr3/string_utilities/to_symbol.rb +80 -80
  68. data/lib/xqsr3/string_utilities/truncate.rb +60 -61
  69. data/lib/xqsr3/string_utilities.rb +8 -8
  70. data/lib/xqsr3/version.rb +19 -20
  71. data/test/performance/frequency_map.rb +13 -27
  72. data/test/scratch/test_assert_raise_with_message.rb +12 -13
  73. data/test/unit/array_utilities/tc_join_with_or.rb +140 -142
  74. data/test/unit/command_line_utilities/tc_map_option_string.rb +18 -18
  75. data/test/unit/containers/tc_frequency_map.rb +607 -554
  76. data/test/unit/containers/tc_multi_map.rb +573 -522
  77. data/test/unit/conversion/tc_integer_parser.rb +73 -73
  78. data/test/unit/conversion/tc_to_bool.rb +26 -26
  79. data/test/unit/diagnostics/exceptions/tc_with_cause.rb +165 -165
  80. data/test/unit/diagnostics/tc_exception_utilities.rb +156 -156
  81. data/test/unit/extensions/enumerable/tc_collect_with_index.rb +14 -14
  82. data/test/unit/extensions/enumerable/tc_detect_map.rb +20 -20
  83. data/test/unit/extensions/enumerable/tc_unique.rb +34 -34
  84. data/test/unit/extensions/hash/tc_deep_transform.rb +22 -22
  85. data/test/unit/extensions/hash/tc_except.rb +28 -28
  86. data/test/unit/extensions/hash/tc_hash.rb +1 -1
  87. data/test/unit/extensions/hash/tc_slice.rb +14 -14
  88. data/test/unit/extensions/integer/tc_to_s_grp.rb +60 -0
  89. data/test/unit/extensions/integer/ts_all.rb +12 -0
  90. data/test/unit/extensions/io/tc_writelines.rb +77 -77
  91. data/test/unit/extensions/kernel/tc_integer.rb +75 -75
  92. data/test/unit/extensions/kernel/tc_raise_with_options.rb +155 -155
  93. data/test/unit/extensions/object/tc_inspect.rb +51 -51
  94. data/test/unit/extensions/string/tc_bool.tb +24 -24
  95. data/test/unit/extensions/string/tc_ends_with.rb +53 -53
  96. data/test/unit/extensions/string/tc_map_option_string.rb +15 -15
  97. data/test/unit/extensions/string/tc_nil_if_empty.rb +8 -8
  98. data/test/unit/extensions/string/tc_nil_if_whitespace.rb +8 -8
  99. data/test/unit/extensions/string/tc_quote_if.rb +18 -18
  100. data/test/unit/extensions/string/tc_starts_with.rb +53 -53
  101. data/test/unit/extensions/string/tc_to_symbol.rb +26 -26
  102. data/test/unit/extensions/string/tc_truncate.rb +18 -18
  103. data/test/unit/extensions/test/unit/tc_assert_raise_with_message.rb +16 -16
  104. data/test/unit/extensions/test/unit/tc_assert_subclass_of.rb +9 -9
  105. data/test/unit/extensions/test/unit/tc_assert_superclass_of.rb +9 -9
  106. data/test/unit/hash_utilities/tc_has_match.rb +70 -70
  107. data/test/unit/hash_utilities/tc_match.rb +83 -83
  108. data/test/unit/io/tc_writelines.rb +106 -108
  109. data/test/unit/quality/tc_parameter_checking.rb +390 -390
  110. data/test/unit/string_utilities/tc_truncate.rb +28 -28
  111. data/test/unit/tc_version.rb +15 -15
  112. metadata +6 -2
@@ -1,16 +1,17 @@
1
1
 
2
2
  # ######################################################################## #
3
- # File: lib/xqsr3/diagnostics/inspect_builder.rb
3
+ # File: lib/xqsr3/diagnostics/inspect_builder.rb
4
4
  #
5
- # Purpose: ::Xqsr3::Diagnostics::InspectBuilder module
5
+ # Purpose: ::Xqsr3::Diagnostics::InspectBuilder module
6
6
  #
7
- # Created: 4th September 2018
8
- # Updated: 12th April 2019
7
+ # Created: 4th September 2018
8
+ # Updated: 29th March 2024
9
9
  #
10
- # Home: http://github.com/synesissoftware/xqsr3
10
+ # Home: http://github.com/synesissoftware/xqsr3
11
11
  #
12
- # Author: Matthew Wilson
12
+ # Author: Matthew Wilson
13
13
  #
14
+ # Copyright (c) 2019-2024, Matthew Wilson and Synesis Information Systems
14
15
  # Copyright (c) 2018-2019, Matthew Wilson and Synesis Software
15
16
  # All rights reserved.
16
17
  #
@@ -25,7 +26,7 @@
25
26
  # notice, this list of conditions and the following disclaimer in the
26
27
  # documentation and/or other materials provided with the distribution.
27
28
  #
28
- # * Neither the names of the copyright holder nor the names of its
29
+ # * Neither the names of the copyright holders nor the names of its
29
30
  # contributors may be used to endorse or promote products derived from
30
31
  # this software without specific prior written permission.
31
32
  #
@@ -54,117 +55,117 @@ module Diagnostics
54
55
 
55
56
  module InspectBuilder
56
57
 
57
- # @!visibility private
58
- module InspectBuilder_Utilities # :nodoc: all
58
+ # @!visibility private
59
+ module InspectBuilder_Utilities # :nodoc: all
59
60
 
60
- # @!visibility private
61
- NORMALISE_FUNCTION = lambda { |ar| ar.map { |v| v.to_s }.map { |v| '@' == v[0] ? v : "@#{v}" } }
62
- end # module InspectBuilder_Utilities
61
+ # @!visibility private
62
+ NORMALISE_FUNCTION = lambda { |ar| ar.map { |v| v.to_s }.map { |v| '@' == v[0] ? v : "@#{v}" } }
63
+ end # module InspectBuilder_Utilities
63
64
 
64
- # Generates an inspect string for the +include+-ing class
65
- #
66
- # === Signature
67
- #
68
- # * *Parameters:*
69
- # - +o+ The target of the +inspect+ message for which a message will be built
70
- #
71
- # * *Options:*
72
- # - +:no_class+ (boolean) Elides the class qualification
73
- # - +:no_object_id+ (boolean) Elides the object id
74
- # - +:show_fields+ (boolean) Shows (all) object fields
75
- # - +:hidden_fields+ ([ String ]) Names of fields to be omitted (when +:show_fields+ is specified). Overridden by +:shown_fields+
76
- # - +:shown_fields+ ([ String ]) Names of fields to be shown (when +:show_fields+ is specified). Overrides +:hidden_fields+
77
- # - +:truncate_width+ (Integer) Specifies a maximum width for the values of fields
78
- # - +:deep_inspect+ (boolean) Causes fields' values to be obtained via their own +inspect+ methods
79
- def self.make_inspect o, **options
65
+ # Generates an inspect string for the +include+-ing class
66
+ #
67
+ # === Signature
68
+ #
69
+ # * *Parameters:*
70
+ # - +o+ The target of the +inspect+ message for which a message will be built
71
+ #
72
+ # * *Options:*
73
+ # - +:no_class+ (boolean) Elides the class qualification
74
+ # - +:no_object_id+ (boolean) Elides the object id
75
+ # - +:show_fields+ (boolean) Shows (all) object fields
76
+ # - +:hidden_fields+ ([ String ]) Names of fields to be omitted (when +:show_fields+ is specified). Overridden by +:shown_fields+
77
+ # - +:shown_fields+ ([ String ]) Names of fields to be shown (when +:show_fields+ is specified). Overrides +:hidden_fields+
78
+ # - +:truncate_width+ (Integer) Specifies a maximum width for the values of fields
79
+ # - +:deep_inspect+ (boolean) Causes fields' values to be obtained via their own +inspect+ methods
80
+ def self.make_inspect o, **options
80
81
 
81
- r = ''
82
+ r = ''
82
83
 
83
- unless options[:no_class]
84
+ unless options[:no_class]
84
85
 
85
- r += o.class.to_s
86
- end
86
+ r += o.class.to_s
87
+ end
87
88
 
88
- unless options[:no_object_id]
89
+ unless options[:no_object_id]
89
90
 
90
- r += ':' unless r.empty?
91
- r += "0x#{o.object_id.to_s.rjust(16, '0')}"
92
- end
91
+ r += ':' unless r.empty?
92
+ r += "0x#{o.object_id.to_s.rjust(16, '0')}"
93
+ end
93
94
 
94
- if options[:show_fields]
95
+ if options[:show_fields]
95
96
 
96
- normalise = InspectBuilder_Utilities::NORMALISE_FUNCTION
97
+ normalise = InspectBuilder_Utilities::NORMALISE_FUNCTION
97
98
 
98
- hide_fields = normalise.call(options[:hidden_fields] || [])
99
- show_fields = normalise.call(options[:shown_fields] || [])
100
- trunc_w = options[:truncate_width]
101
- ivars = normalise.call(o.instance_variables)
99
+ hide_fields = normalise.call(options[:hidden_fields] || [])
100
+ show_fields = normalise.call(options[:shown_fields] || [])
101
+ trunc_w = options[:truncate_width]
102
+ ivars = normalise.call(o.instance_variables)
102
103
 
103
- unless show_fields.empty?
104
+ unless show_fields.empty?
104
105
 
105
- ivars = ivars & show_fields
106
- else
106
+ ivars = ivars & show_fields
107
+ else
107
108
 
108
- o.class.ancestors.each do |ancestor|
109
+ o.class.ancestors.each do |ancestor|
109
110
 
110
- ihf_constant = :INSPECT_HIDDEN_FIELDS
111
+ ihf_constant = :INSPECT_HIDDEN_FIELDS
111
112
 
112
- if ancestor.const_defined? ihf_constant
113
+ if ancestor.const_defined? ihf_constant
113
114
 
114
- ihfs = ancestor.const_get ihf_constant
115
+ ihfs = ancestor.const_get ihf_constant
115
116
 
116
- if ::Array === ihfs && ihfs.all? { |c| ::String === c }
117
+ if ::Array === ihfs && ihfs.all? { |c| ::String === c }
117
118
 
118
- hide_fields += normalise.call(ihfs)
119
- else
119
+ hide_fields += normalise.call(ihfs)
120
+ else
120
121
 
121
- warn "class/module #{ancestor}'s #{ihf_constant} should be an array of strings"
122
- end
123
- end
124
- end
122
+ warn "class/module #{ancestor}'s #{ihf_constant} should be an array of strings"
123
+ end
124
+ end
125
+ end
125
126
 
126
- ivars = ivars - hide_fields
127
- end
127
+ ivars = ivars - hide_fields
128
+ end
128
129
 
129
- els = ivars.sort.map do |iv_name|
130
+ els = ivars.sort.map do |iv_name|
130
131
 
131
- iv_value = o.instance_variable_get(iv_name)
132
- iv_class = iv_value.class
133
- iv_value = ::Xqsr3::StringUtilities::Truncate.string_truncate(iv_value.to_s, trunc_w) if trunc_w
134
- if options[:deep_inspect]
132
+ iv_value = o.instance_variable_get(iv_name)
133
+ iv_class = iv_value.class
134
+ iv_value = ::Xqsr3::StringUtilities::Truncate.string_truncate(iv_value.to_s, trunc_w) if trunc_w
135
+ if options[:deep_inspect]
135
136
 
136
- iv_value = iv_value.inspect
137
- else
137
+ iv_value = iv_value.inspect
138
+ else
138
139
 
139
- case iv_value
140
- when ::Array
140
+ case iv_value
141
+ when ::Array
141
142
 
142
143
 
143
- when ::String
144
+ when ::String
144
145
 
145
- iv_value = "'#{iv_value}'"
146
- end
147
- end
146
+ iv_value = "'#{iv_value}'"
147
+ end
148
+ end
148
149
 
149
- "#{iv_name}(#{iv_class})=#{iv_value}"
150
- end.join('; ')
150
+ "#{iv_name}(#{iv_class})=#{iv_value}"
151
+ end.join('; ')
151
152
 
152
- r += ': ' unless r.empty?
153
- r += els
154
- end
153
+ r += ': ' unless r.empty?
154
+ r += els
155
+ end
155
156
 
156
- r = '#<' + r + '>'
157
+ r = '#<' + r + '>'
157
158
 
158
- r
159
- end
159
+ r
160
+ end
160
161
 
161
- # Creates an inspect string from self
162
- #
163
- # see InspectBuilder::make_inspect
164
- def make_inspect **options
162
+ # Creates an inspect string from self
163
+ #
164
+ # see InspectBuilder::make_inspect
165
+ def make_inspect **options
165
166
 
166
- ::Xqsr3::Diagnostics::InspectBuilder.make_inspect self, **options
167
- end
167
+ ::Xqsr3::Diagnostics::InspectBuilder.make_inspect self, **options
168
+ end
168
169
 
169
170
  end # module InspectBuilder
170
171
 
@@ -173,4 +174,3 @@ end # module Xqsr3
173
174
 
174
175
  # ############################## end of file ############################# #
175
176
 
176
-
@@ -1,11 +1,11 @@
1
1
 
2
2
  %w{
3
3
 
4
- exception_utilities
5
- inspect_builder
4
+ exception_utilities
5
+ inspect_builder
6
6
  }.each do |name|
7
7
 
8
- require File.join(File.dirname(__FILE__), 'diagnostics', name)
8
+ require File.join(File.dirname(__FILE__), 'diagnostics', name)
9
9
  end
10
10
 
11
11
 
data/lib/xqsr3/doc_.rb CHANGED
@@ -1,16 +1,17 @@
1
1
 
2
2
  # ######################################################################## #
3
- # File: lib/xqsr3/doc_.rb
3
+ # File: lib/xqsr3/doc_.rb
4
4
  #
5
- # Purpose: Documentation of the ::Xqsr3 modules
5
+ # Purpose: Documentation of the ::Xqsr3 modules
6
6
  #
7
- # Created: 10th June 2016
8
- # Updated: 12th April 2019
7
+ # Created: 10th June 2016
8
+ # Updated: 29th March 2024
9
9
  #
10
- # Home: http://github.com/synesissoftware/xqsr3
10
+ # Home: http://github.com/synesissoftware/xqsr3
11
11
  #
12
- # Author: Matthew Wilson
12
+ # Author: Matthew Wilson
13
13
  #
14
+ # Copyright (c) 2019-2024, Matthew Wilson and Synesis Information Systems
14
15
  # Copyright (c) 2016-2019, Matthew Wilson and Synesis Software
15
16
  # All rights reserved.
16
17
  #
@@ -25,7 +26,7 @@
25
26
  # notice, this list of conditions and the following disclaimer in the
26
27
  # documentation and/or other materials provided with the distribution.
27
28
  #
28
- # * Neither the names of the copyright holder nor the names of its
29
+ # * Neither the names of the copyright holders nor the names of its
29
30
  # contributors may be used to endorse or promote products derived from
30
31
  # this software without specific prior written permission.
31
32
  #
@@ -58,119 +59,119 @@
58
59
  # * ::Xqsr3::StringUtilities
59
60
  module Xqsr3
60
61
 
61
- # Array utilities
62
- #
63
- # === Subordinate modules of interest
64
- # * ::Xqsr3::ArrayUtilities::JoinWithOr
65
- module ArrayUtilities
66
- end # module ArrayUtilities
67
-
68
- # Command-line Utilities
69
- #
70
- # === Subordinate modules of interest
71
- # * ::Xqsr3::CommandLineUtilities::MapOptionString
72
- module CommandLineUtilities
73
- end # module CommandLineUtilities
74
-
75
- # Containers
76
- #
77
- module Containers
78
- end # module Containers
79
-
80
- # Conversion
81
- #
82
- module Conversion
83
- end # module Conversion
84
-
85
- # Diagnostic facilities
86
- #
87
- # === Subordinate modules of interest
88
- # * ::Xqsr3::Diagnostics::ExceptionUtilities
89
- # * ::Xqsr3::Diagnostics::InspectBuilder
90
- # * ::Xqsr3::Diagnostics::Exceptions::WithCause
91
- #
92
- module Diagnostics
93
-
94
- # Exception-related utilities
95
- #
96
- # === Components of interest
97
- # * ::Xqsr3::Diagnostics::ExceptionUtilities::raise_with_options
98
- #
99
- module ExceptionUtilities
100
- end # module ExceptionUtilities
101
-
102
- # Inspect builder
103
- #
104
- module InspectBuilder
105
- end # module InspectBuilder
106
-
107
- # Exception-related utilities
108
- #
109
- # === Components of interest
110
- # * ::Xqsr3::Diagnostics::Exceptions::WithCause
111
- #
112
- module Exceptions
113
- end # module Exceptions
114
- end # module Diagnostics
115
-
116
- # Hash utilities
117
- #
118
- # === Subordinate modules of interest
119
- # * ::Xqsr3::HashUtilities::DeepTransform
120
- # * ::Xqsr3::HashUtilities::KeyMatching
121
- module HashUtilities
122
-
123
- # Exception-related utilities
124
- #
125
- # === Components of interest
126
- # * ::Xqsr3::Diagnostics::HashUtilities::deep_transform
127
- # * ::Xqsr3::Diagnostics::HashUtilities::deep_transform!
128
- #
129
- module DeepTransform
130
- end # module DeepTransform
131
- end # module HashUtilities
132
-
133
- # IO
134
- #
135
- class IO
136
- end # class IO
137
-
138
- # Quality
139
- #
140
- # === Subordinate modules of interest
141
- # * ::Xqsr3::Quality::ParameterChecking
142
- module Quality
143
- end # module Quality
144
-
145
- # String utilities
146
- #
147
- # === Subordinate modules of interest
148
- # * ::Xqsr3::StringUtilities::EndsWith
149
- # * ::Xqsr3::StringUtilities::NilIfEmpty
150
- # * ::Xqsr3::StringUtilities::NilIfWhitespace
151
- # * ::Xqsr3::StringUtilities::QuoteIf
152
- # * ::Xqsr3::StringUtilities::StartsWith
153
- # * ::Xqsr3::StringUtilities::ToSymbol
154
- # * ::Xqsr3::StringUtilities::Truncate
155
- module StringUtilities
62
+ # Array utilities
63
+ #
64
+ # === Subordinate modules of interest
65
+ # * ::Xqsr3::ArrayUtilities::JoinWithOr
66
+ module ArrayUtilities
67
+ end # module ArrayUtilities
68
+
69
+ # Command-line Utilities
70
+ #
71
+ # === Subordinate modules of interest
72
+ # * ::Xqsr3::CommandLineUtilities::MapOptionString
73
+ module CommandLineUtilities
74
+ end # module CommandLineUtilities
75
+
76
+ # Containers
77
+ #
78
+ module Containers
79
+ end # module Containers
80
+
81
+ # Conversion
82
+ #
83
+ module Conversion
84
+ end # module Conversion
85
+
86
+ # Diagnostic facilities
87
+ #
88
+ # === Subordinate modules of interest
89
+ # * ::Xqsr3::Diagnostics::ExceptionUtilities
90
+ # * ::Xqsr3::Diagnostics::InspectBuilder
91
+ # * ::Xqsr3::Diagnostics::Exceptions::WithCause
92
+ #
93
+ module Diagnostics
94
+
95
+ # Exception-related utilities
96
+ #
97
+ # === Components of interest
98
+ # * ::Xqsr3::Diagnostics::ExceptionUtilities::raise_with_options
99
+ #
100
+ module ExceptionUtilities
101
+ end # module ExceptionUtilities
102
+
103
+ # Inspect builder
104
+ #
105
+ module InspectBuilder
106
+ end # module InspectBuilder
107
+
108
+ # Exception-related utilities
109
+ #
110
+ # === Components of interest
111
+ # * ::Xqsr3::Diagnostics::Exceptions::WithCause
112
+ #
113
+ module Exceptions
114
+ end # module Exceptions
115
+ end # module Diagnostics
116
+
117
+ # Hash utilities
118
+ #
119
+ # === Subordinate modules of interest
120
+ # * ::Xqsr3::HashUtilities::DeepTransform
121
+ # * ::Xqsr3::HashUtilities::KeyMatching
122
+ module HashUtilities
123
+
124
+ # Exception-related utilities
125
+ #
126
+ # === Components of interest
127
+ # * ::Xqsr3::Diagnostics::HashUtilities::deep_transform
128
+ # * ::Xqsr3::Diagnostics::HashUtilities::deep_transform!
129
+ #
130
+ module DeepTransform
131
+ end # module DeepTransform
132
+ end # module HashUtilities
133
+
134
+ # IO
135
+ #
136
+ class IO
137
+ end # class IO
138
+
139
+ # Quality
140
+ #
141
+ # === Subordinate modules of interest
142
+ # * ::Xqsr3::Quality::ParameterChecking
143
+ module Quality
144
+ end # module Quality
145
+
146
+ # String utilities
147
+ #
148
+ # === Subordinate modules of interest
149
+ # * ::Xqsr3::StringUtilities::EndsWith
150
+ # * ::Xqsr3::StringUtilities::NilIfEmpty
151
+ # * ::Xqsr3::StringUtilities::NilIfWhitespace
152
+ # * ::Xqsr3::StringUtilities::QuoteIf
153
+ # * ::Xqsr3::StringUtilities::StartsWith
154
+ # * ::Xqsr3::StringUtilities::ToSymbol
155
+ # * ::Xqsr3::StringUtilities::Truncate
156
+ module StringUtilities
156
157
 
157
158
  =begin
158
- module EndsWith
159
- end # module EndsWith
160
- module NilIfEmpty
161
- end # module NilIfEmpty
162
- module NilIfWhitespace
163
- end # module NilIfWhitespace
164
- module QuoteIf
165
- end # module QuoteIf
166
- module StartsWith
167
- end # module StartsWith
168
- module ToSymbol
169
- end # module ToSymbol
170
- module Truncate
171
- end # module Truncate
159
+ module EndsWith
160
+ end # module EndsWith
161
+ module NilIfEmpty
162
+ end # module NilIfEmpty
163
+ module NilIfWhitespace
164
+ end # module NilIfWhitespace
165
+ module QuoteIf
166
+ end # module QuoteIf
167
+ module StartsWith
168
+ end # module StartsWith
169
+ module ToSymbol
170
+ end # module ToSymbol
171
+ module Truncate
172
+ end # module Truncate
172
173
  =end
173
- end # module StringUtilities
174
+ end # module StringUtilities
174
175
  end # module Xqsr3
175
176
 
176
177
  # Standard class, extended with methods:
@@ -219,27 +220,26 @@ class String; end
219
220
  # Standard module
220
221
  module Test
221
222
 
222
- # Standard module
223
- module Unit
224
-
225
- # Standard module
226
- #
227
- # === Components of interest
228
- # * ::Test::Unit::Assertions#assert_eql
229
- # * ::Test::Unit::Assertions#assert_false
230
- # * ::Test::Unit::Assertions#assert_not
231
- # * ::Test::Unit::Assertions#assert_not_eql
232
- # * ::Test::Unit::Assertions#assert_raise_with_message
233
- # * ::Test::Unit::Assertions#assert_subclass_of
234
- # * ::Test::Unit::Assertions#assert_superclass_of
235
- # * ::Test::Unit::Assertions#assert_true
236
- # * ::Test::Unit::Assertions#assert_type_has_instance_methods
237
- module Assertions
238
- end # module Assertions
239
- end # module Unit
223
+ # Standard module
224
+ module Unit
225
+
226
+ # Standard module
227
+ #
228
+ # === Components of interest
229
+ # * ::Test::Unit::Assertions#assert_eql
230
+ # * ::Test::Unit::Assertions#assert_false
231
+ # * ::Test::Unit::Assertions#assert_not
232
+ # * ::Test::Unit::Assertions#assert_not_eql
233
+ # * ::Test::Unit::Assertions#assert_raise_with_message
234
+ # * ::Test::Unit::Assertions#assert_subclass_of
235
+ # * ::Test::Unit::Assertions#assert_superclass_of
236
+ # * ::Test::Unit::Assertions#assert_true
237
+ # * ::Test::Unit::Assertions#assert_type_has_instance_methods
238
+ module Assertions
239
+ end # module Assertions
240
+ end # module Unit
240
241
  end # module Test
241
242
 
242
243
 
243
244
  # ############################## end of file ############################# #
244
245
 
245
-
@@ -3,16 +3,16 @@ require 'xqsr3/array_utilities/join_with_or'
3
3
 
4
4
  class Array
5
5
 
6
- # Extended method implemented by JoinWithOr
7
- #
8
- # === Signature
9
- #
10
- # * *Parameters:*
11
- # - +options+ (Hash) See Xqsr3::ArrayUtilities
12
- def join_with_or **options
6
+ # Extended method implemented by JoinWithOr
7
+ #
8
+ # === Signature
9
+ #
10
+ # * *Parameters:*
11
+ # - +options+ (Hash) See Xqsr3::ArrayUtilities
12
+ def join_with_or **options
13
13
 
14
- return ::Xqsr3::ArrayUtilities::JoinWithOr.join_with_or self, **options
15
- end
14
+ return ::Xqsr3::ArrayUtilities::JoinWithOr.join_with_or self, **options
15
+ end
16
16
  end
17
17
 
18
18
 
@@ -1,16 +1,17 @@
1
1
 
2
2
  # ######################################################################## #
3
- # File: lib/xqsr3/extensions/enumerable/collect_with_index.rb
3
+ # File: lib/xqsr3/extensions/enumerable/collect_with_index.rb
4
4
  #
5
- # Purpose: Adds a collect_with_index() method to the Enumerable module
5
+ # Purpose: Adds a collect_with_index() method to the Enumerable module
6
6
  #
7
- # Created: 24th October 2010
8
- # Updated: 12th April 2019
7
+ # Created: 24th October 2010
8
+ # Updated: 29th March 2024
9
9
  #
10
- # Home: http://github.com/synesissoftware/xqsr3
10
+ # Home: http://github.com/synesissoftware/xqsr3
11
11
  #
12
- # Author: Matthew Wilson
12
+ # Author: Matthew Wilson
13
13
  #
14
+ # Copyright (c) 2019-2024, Matthew Wilson and Synesis Information Systems
14
15
  # Copyright (c) 2010-2019, Matthew Wilson and Synesis Software
15
16
  # All rights reserved.
16
17
  #
@@ -25,7 +26,7 @@
25
26
  # notice, this list of conditions and the following disclaimer in the
26
27
  # documentation and/or other materials provided with the distribution.
27
28
  #
28
- # * Neither the names of the copyright holder nor the names of its
29
+ # * Neither the names of the copyright holders nor the names of its
29
30
  # contributors may be used to endorse or promote products derived from
30
31
  # this software without specific prior written permission.
31
32
  #
@@ -52,20 +53,20 @@
52
53
 
53
54
  module Enumerable
54
55
 
55
- # Two-parameter variant of +Enumerable+#+collect+, where the second
56
- # parameter is a +base+-based index, which increments by 1 for each
57
- # enumerated element.
58
- def collect_with_index(base = 0)
56
+ # Two-parameter variant of +Enumerable+#+collect+, where the second
57
+ # parameter is a +base+-based index, which increments by 1 for each
58
+ # enumerated element.
59
+ def collect_with_index(base = 0)
59
60
 
60
- a = []
61
+ a = []
61
62
 
62
- self.each_with_index do |element, index|
63
+ self.each_with_index do |element, index|
63
64
 
64
- a.push yield(element, base + index)
65
- end
65
+ a.push yield(element, base + index)
66
+ end
66
67
 
67
- a
68
- end
68
+ a
69
+ end
69
70
  end # module Enumerable
70
71
 
71
72
  # ############################## end of file ############################# #