xqsr3 0.38.2 → 0.39.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +15 -6
  3. data/examples/count_word_frequencies.md +12 -12
  4. data/examples/count_word_frequencies.rb +4 -4
  5. data/lib/xqsr3/array_utilities/join_with_or.rb +47 -47
  6. data/lib/xqsr3/array_utilities.rb +2 -2
  7. data/lib/xqsr3/command_line_utilities/map_option_string.rb +60 -60
  8. data/lib/xqsr3/command_line_utilities.rb +2 -2
  9. data/lib/xqsr3/containers/frequency_map.rb +399 -399
  10. data/lib/xqsr3/containers/multi_map.rb +448 -448
  11. data/lib/xqsr3/containers.rb +3 -3
  12. data/lib/xqsr3/conversion/bool_parser.rb +51 -51
  13. data/lib/xqsr3/conversion/integer_parser.rb +87 -87
  14. data/lib/xqsr3/conversion.rb +3 -3
  15. data/lib/xqsr3/diagnostics/exception_utilities.rb +145 -145
  16. data/lib/xqsr3/diagnostics/exceptions/with_cause.rb +90 -90
  17. data/lib/xqsr3/diagnostics/inspect_builder.rb +80 -80
  18. data/lib/xqsr3/diagnostics.rb +3 -3
  19. data/lib/xqsr3/doc_.rb +130 -130
  20. data/lib/xqsr3/extensions/array/join_with_or.rb +9 -9
  21. data/lib/xqsr3/extensions/enumerable/collect_with_index.rb +12 -12
  22. data/lib/xqsr3/extensions/enumerable/detect_map.rb +35 -35
  23. data/lib/xqsr3/extensions/enumerable/unique.rb +29 -28
  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 +28 -28
  33. data/lib/xqsr3/extensions/kernel/integer.rb +20 -20
  34. data/lib/xqsr3/extensions/kernel/raise_with_options.rb +8 -8
  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 -4
  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 -1
  41. data/lib/xqsr3/extensions/string/starts_with.rb +1 -1
  42. data/lib/xqsr3/extensions/string/to_bool.rb +8 -8
  43. data/lib/xqsr3/extensions/string/to_symbol.rb +1 -1
  44. data/lib/xqsr3/extensions/string/truncate.rb +1 -1
  45. data/lib/xqsr3/extensions/test/unit/assert_eql.rb +10 -7
  46. data/lib/xqsr3/extensions/test/unit/assert_false.rb +9 -6
  47. data/lib/xqsr3/extensions/test/unit/assert_not.rb +9 -6
  48. data/lib/xqsr3/extensions/test/unit/assert_not_eql.rb +10 -7
  49. data/lib/xqsr3/extensions/test/unit/assert_raise_with_message.rb +61 -61
  50. data/lib/xqsr3/extensions/test/unit/assert_subclass_of.rb +10 -7
  51. data/lib/xqsr3/extensions/test/unit/assert_superclass_of.rb +10 -7
  52. data/lib/xqsr3/extensions/test/unit/assert_true.rb +9 -6
  53. data/lib/xqsr3/extensions/test/unit/assert_type_has_instance_methods.rb +39 -36
  54. data/lib/xqsr3/extensions.rb +5 -5
  55. data/lib/xqsr3/hash_utilities/deep_transform.rb +65 -65
  56. data/lib/xqsr3/hash_utilities/key_matching.rb +77 -77
  57. data/lib/xqsr3/hash_utilities.rb +3 -3
  58. data/lib/xqsr3/internal_/test_unit_version_.rb +83 -83
  59. data/lib/xqsr3/io/writelines.rb +122 -120
  60. data/lib/xqsr3/quality/parameter_checking.rb +445 -445
  61. data/lib/xqsr3/quality.rb +2 -2
  62. data/lib/xqsr3/string_utilities/ends_with.rb +59 -59
  63. data/lib/xqsr3/string_utilities/nil_if_empty.rb +28 -28
  64. data/lib/xqsr3/string_utilities/nil_if_whitespace.rb +29 -29
  65. data/lib/xqsr3/string_utilities/quote_if.rb +50 -50
  66. data/lib/xqsr3/string_utilities/starts_with.rb +59 -59
  67. data/lib/xqsr3/string_utilities/to_symbol.rb +75 -75
  68. data/lib/xqsr3/string_utilities/truncate.rb +55 -55
  69. data/lib/xqsr3/string_utilities.rb +8 -8
  70. data/lib/xqsr3/version.rb +12 -12
  71. data/test/performance/frequency_map.rb +12 -12
  72. data/test/scratch/test_assert_raise_with_message.rb +11 -11
  73. data/test/unit/array_utilities/tc_join_with_or.rb +140 -140
  74. data/test/unit/command_line_utilities/tc_map_option_string.rb +18 -18
  75. data/test/unit/containers/tc_frequency_map.rb +591 -591
  76. data/test/unit/containers/tc_multi_map.rb +558 -558
  77. data/test/unit/conversion/tc_integer_parser.rb +72 -72
  78. data/test/unit/conversion/tc_to_bool.rb +25 -25
  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_slice.rb +13 -13
  87. data/test/unit/extensions/integer/tc_to_s_grp.rb +60 -0
  88. data/test/unit/extensions/integer/ts_all.rb +12 -0
  89. data/test/unit/extensions/io/tc_writelines.rb +149 -77
  90. data/test/unit/extensions/kernel/tc_integer.rb +75 -75
  91. data/test/unit/extensions/kernel/tc_raise_with_options.rb +155 -155
  92. data/test/unit/extensions/object/tc_inspect.rb +50 -50
  93. data/test/unit/extensions/string/tc_bool.tb +24 -24
  94. data/test/unit/extensions/string/tc_ends_with.rb +53 -53
  95. data/test/unit/extensions/string/tc_map_option_string.rb +15 -15
  96. data/test/unit/extensions/string/tc_nil_if_empty.rb +8 -8
  97. data/test/unit/extensions/string/tc_nil_if_whitespace.rb +8 -8
  98. data/test/unit/extensions/string/tc_quote_if.rb +18 -18
  99. data/test/unit/extensions/string/tc_starts_with.rb +53 -53
  100. data/test/unit/extensions/string/tc_to_symbol.rb +26 -26
  101. data/test/unit/extensions/string/tc_truncate.rb +18 -18
  102. data/test/unit/extensions/test/unit/tc_assert_raise_with_message.rb +16 -16
  103. data/test/unit/extensions/test/unit/tc_assert_subclass_of.rb +9 -9
  104. data/test/unit/extensions/test/unit/tc_assert_superclass_of.rb +9 -9
  105. data/test/unit/hash_utilities/tc_has_match.rb +70 -70
  106. data/test/unit/hash_utilities/tc_match.rb +83 -83
  107. data/test/unit/io/tc_writelines.rb +166 -106
  108. data/test/unit/quality/tc_parameter_checking.rb +389 -389
  109. data/test/unit/string_utilities/tc_truncate.rb +27 -27
  110. data/test/unit/tc_version.rb +15 -15
  111. metadata +6 -2
@@ -5,13 +5,13 @@
5
5
  # Purpose: ::Xqsr3::Diagnostics::InspectBuilder module
6
6
  #
7
7
  # Created: 4th September 2018
8
- # Updated: 11th December 2023
8
+ # Updated: 29th March 2024
9
9
  #
10
10
  # Home: http://github.com/synesissoftware/xqsr3
11
11
  #
12
12
  # Author: Matthew Wilson
13
13
  #
14
- # Copyright (c) 2019-2023, Matthew Wilson and Synesis Information Systems
14
+ # Copyright (c) 2019-2024, Matthew Wilson and Synesis Information Systems
15
15
  # Copyright (c) 2018-2019, Matthew Wilson and Synesis Software
16
16
  # All rights reserved.
17
17
  #
@@ -55,117 +55,117 @@ module Diagnostics
55
55
 
56
56
  module InspectBuilder
57
57
 
58
- # @!visibility private
59
- module InspectBuilder_Utilities # :nodoc: all
58
+ # @!visibility private
59
+ module InspectBuilder_Utilities # :nodoc: all
60
60
 
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
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
64
64
 
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
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
81
81
 
82
- r = ''
82
+ r = ''
83
83
 
84
- unless options[:no_class]
84
+ unless options[:no_class]
85
85
 
86
- r += o.class.to_s
87
- end
86
+ r += o.class.to_s
87
+ end
88
88
 
89
- unless options[:no_object_id]
89
+ unless options[:no_object_id]
90
90
 
91
- r += ':' unless r.empty?
92
- r += "0x#{o.object_id.to_s.rjust(16, '0')}"
93
- end
91
+ r += ':' unless r.empty?
92
+ r += "0x#{o.object_id.to_s.rjust(16, '0')}"
93
+ end
94
94
 
95
- if options[:show_fields]
95
+ if options[:show_fields]
96
96
 
97
- normalise = InspectBuilder_Utilities::NORMALISE_FUNCTION
97
+ normalise = InspectBuilder_Utilities::NORMALISE_FUNCTION
98
98
 
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)
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)
103
103
 
104
- unless show_fields.empty?
104
+ unless show_fields.empty?
105
105
 
106
- ivars = ivars & show_fields
107
- else
106
+ ivars = ivars & show_fields
107
+ else
108
108
 
109
- o.class.ancestors.each do |ancestor|
109
+ o.class.ancestors.each do |ancestor|
110
110
 
111
- ihf_constant = :INSPECT_HIDDEN_FIELDS
111
+ ihf_constant = :INSPECT_HIDDEN_FIELDS
112
112
 
113
- if ancestor.const_defined? ihf_constant
113
+ if ancestor.const_defined? ihf_constant
114
114
 
115
- ihfs = ancestor.const_get ihf_constant
115
+ ihfs = ancestor.const_get ihf_constant
116
116
 
117
- if ::Array === ihfs && ihfs.all? { |c| ::String === c }
117
+ if ::Array === ihfs && ihfs.all? { |c| ::String === c }
118
118
 
119
- hide_fields += normalise.call(ihfs)
120
- else
119
+ hide_fields += normalise.call(ihfs)
120
+ else
121
121
 
122
- warn "class/module #{ancestor}'s #{ihf_constant} should be an array of strings"
123
- end
124
- end
125
- end
122
+ warn "class/module #{ancestor}'s #{ihf_constant} should be an array of strings"
123
+ end
124
+ end
125
+ end
126
126
 
127
- ivars = ivars - hide_fields
128
- end
127
+ ivars = ivars - hide_fields
128
+ end
129
129
 
130
- els = ivars.sort.map do |iv_name|
130
+ els = ivars.sort.map do |iv_name|
131
131
 
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]
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]
136
136
 
137
- iv_value = iv_value.inspect
138
- else
137
+ iv_value = iv_value.inspect
138
+ else
139
139
 
140
- case iv_value
141
- when ::Array
140
+ case iv_value
141
+ when ::Array
142
142
 
143
143
 
144
- when ::String
144
+ when ::String
145
145
 
146
- iv_value = "'#{iv_value}'"
147
- end
148
- end
146
+ iv_value = "'#{iv_value}'"
147
+ end
148
+ end
149
149
 
150
- "#{iv_name}(#{iv_class})=#{iv_value}"
151
- end.join('; ')
150
+ "#{iv_name}(#{iv_class})=#{iv_value}"
151
+ end.join('; ')
152
152
 
153
- r += ': ' unless r.empty?
154
- r += els
155
- end
153
+ r += ': ' unless r.empty?
154
+ r += els
155
+ end
156
156
 
157
- r = '#<' + r + '>'
157
+ r = '#<' + r + '>'
158
158
 
159
- r
160
- end
159
+ r
160
+ end
161
161
 
162
- # Creates an inspect string from self
163
- #
164
- # see InspectBuilder::make_inspect
165
- def make_inspect **options
162
+ # Creates an inspect string from self
163
+ #
164
+ # see InspectBuilder::make_inspect
165
+ def make_inspect **options
166
166
 
167
- ::Xqsr3::Diagnostics::InspectBuilder.make_inspect self, **options
168
- end
167
+ ::Xqsr3::Diagnostics::InspectBuilder.make_inspect self, **options
168
+ end
169
169
 
170
170
  end # module InspectBuilder
171
171
 
@@ -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
@@ -5,13 +5,13 @@
5
5
  # Purpose: Documentation of the ::Xqsr3 modules
6
6
  #
7
7
  # Created: 10th June 2016
8
- # Updated: 11th December 2023
8
+ # Updated: 29th March 2024
9
9
  #
10
10
  # Home: http://github.com/synesissoftware/xqsr3
11
11
  #
12
12
  # Author: Matthew Wilson
13
13
  #
14
- # Copyright (c) 2019-2023, Matthew Wilson and Synesis Information Systems
14
+ # Copyright (c) 2019-2024, Matthew Wilson and Synesis Information Systems
15
15
  # Copyright (c) 2016-2019, Matthew Wilson and Synesis Software
16
16
  # All rights reserved.
17
17
  #
@@ -59,119 +59,119 @@
59
59
  # * ::Xqsr3::StringUtilities
60
60
  module Xqsr3
61
61
 
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
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
157
157
 
158
158
  =begin
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
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
173
173
  =end
174
- end # module StringUtilities
174
+ end # module StringUtilities
175
175
  end # module Xqsr3
176
176
 
177
177
  # Standard class, extended with methods:
@@ -220,24 +220,24 @@ class String; end
220
220
  # Standard module
221
221
  module Test
222
222
 
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
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
241
241
  end # module Test
242
242
 
243
243
 
@@ -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
 
@@ -5,13 +5,13 @@
5
5
  # Purpose: Adds a collect_with_index() method to the Enumerable module
6
6
  #
7
7
  # Created: 24th October 2010
8
- # Updated: 11th December 2023
8
+ # Updated: 29th March 2024
9
9
  #
10
10
  # Home: http://github.com/synesissoftware/xqsr3
11
11
  #
12
12
  # Author: Matthew Wilson
13
13
  #
14
- # Copyright (c) 2019-2023, Matthew Wilson and Synesis Information Systems
14
+ # Copyright (c) 2019-2024, Matthew Wilson and Synesis Information Systems
15
15
  # Copyright (c) 2010-2019, Matthew Wilson and Synesis Software
16
16
  # All rights reserved.
17
17
  #
@@ -53,20 +53,20 @@
53
53
 
54
54
  module Enumerable
55
55
 
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)
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)
60
60
 
61
- a = []
61
+ a = []
62
62
 
63
- self.each_with_index do |element, index|
63
+ self.each_with_index do |element, index|
64
64
 
65
- a.push yield(element, base + index)
66
- end
65
+ a.push yield(element, base + index)
66
+ end
67
67
 
68
- a
69
- end
68
+ a
69
+ end
70
70
  end # module Enumerable
71
71
 
72
72
  # ############################## end of file ############################# #