xqsr3 0.38.1 → 0.38.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +5 -5
  2. data/examples/count_word_frequencies.md +1 -1
  3. data/examples/count_word_frequencies.rb +1 -1
  4. data/lib/xqsr3/array_utilities/join_with_or.rb +9 -10
  5. data/lib/xqsr3/command_line_utilities/map_option_string.rb +9 -10
  6. data/lib/xqsr3/containers/frequency_map.rb +8 -7
  7. data/lib/xqsr3/containers/multi_map.rb +8 -7
  8. data/lib/xqsr3/conversion/bool_parser.rb +8 -9
  9. data/lib/xqsr3/conversion/integer_parser.rb +8 -9
  10. data/lib/xqsr3/diagnostics/exception_utilities.rb +9 -8
  11. data/lib/xqsr3/diagnostics/exceptions/with_cause.rb +11 -7
  12. data/lib/xqsr3/diagnostics/inspect_builder.rb +8 -8
  13. data/lib/xqsr3/doc_.rb +8 -8
  14. data/lib/xqsr3/extensions/enumerable/collect_with_index.rb +8 -7
  15. data/lib/xqsr3/extensions/enumerable/detect_map.rb +8 -8
  16. data/lib/xqsr3/extensions/enumerable/unique.rb +3 -3
  17. data/lib/xqsr3/extensions/io/writelines.rb +8 -8
  18. data/lib/xqsr3/extensions/kernel/integer.rb +8 -8
  19. data/lib/xqsr3/extensions/kernel/raise_with_options.rb +9 -8
  20. data/lib/xqsr3/extensions/string/map_option_string.rb +0 -1
  21. data/lib/xqsr3/extensions/string/quote_if.rb +0 -1
  22. data/lib/xqsr3/extensions/string/to_bool.rb +0 -1
  23. data/lib/xqsr3/extensions/string/truncate.rb +0 -1
  24. data/lib/xqsr3/extensions/test/unit/assert_eql.rb +2 -2
  25. data/lib/xqsr3/extensions/test/unit/assert_false.rb +1 -2
  26. data/lib/xqsr3/extensions/test/unit/assert_not.rb +0 -1
  27. data/lib/xqsr3/extensions/test/unit/assert_not_eql.rb +2 -2
  28. data/lib/xqsr3/extensions/test/unit/assert_raise_with_message.rb +0 -1
  29. data/lib/xqsr3/extensions/test/unit/assert_subclass_of.rb +0 -1
  30. data/lib/xqsr3/extensions/test/unit/assert_superclass_of.rb +0 -1
  31. data/lib/xqsr3/extensions/test/unit/assert_true.rb +1 -2
  32. data/lib/xqsr3/extensions/test/unit/assert_type_has_instance_methods.rb +0 -2
  33. data/lib/xqsr3/hash_utilities/deep_transform.rb +11 -11
  34. data/lib/xqsr3/hash_utilities/key_matching.rb +8 -8
  35. data/lib/xqsr3/internal_/test_unit_version_.rb +45 -3
  36. data/lib/xqsr3/io/writelines.rb +8 -8
  37. data/lib/xqsr3/quality/parameter_checking.rb +105 -105
  38. data/lib/xqsr3/string_utilities/ends_with.rb +8 -8
  39. data/lib/xqsr3/string_utilities/nil_if_empty.rb +8 -9
  40. data/lib/xqsr3/string_utilities/nil_if_whitespace.rb +9 -9
  41. data/lib/xqsr3/string_utilities/quote_if.rb +8 -9
  42. data/lib/xqsr3/string_utilities/starts_with.rb +8 -8
  43. data/lib/xqsr3/string_utilities/to_symbol.rb +8 -8
  44. data/lib/xqsr3/string_utilities/truncate.rb +8 -9
  45. data/lib/xqsr3/version.rb +9 -10
  46. data/test/performance/frequency_map.rb +1 -15
  47. data/test/scratch/test_assert_raise_with_message.rb +1 -2
  48. data/test/unit/array_utilities/tc_join_with_or.rb +0 -2
  49. data/test/unit/containers/tc_frequency_map.rb +56 -3
  50. data/test/unit/containers/tc_multi_map.rb +56 -5
  51. data/test/unit/conversion/tc_integer_parser.rb +1 -1
  52. data/test/unit/conversion/tc_to_bool.rb +1 -1
  53. data/test/unit/extensions/hash/tc_hash.rb +1 -1
  54. data/test/unit/extensions/hash/tc_slice.rb +1 -1
  55. data/test/unit/extensions/object/tc_inspect.rb +1 -1
  56. data/test/unit/io/tc_writelines.rb +0 -2
  57. data/test/unit/quality/tc_parameter_checking.rb +1 -1
  58. data/test/unit/string_utilities/tc_truncate.rb +1 -1
  59. metadata +6 -7
@@ -1,17 +1,17 @@
1
1
 
2
2
  # ######################################################################## #
3
- # File: lib/xqsr3/string_utilities/starts_with.rb
3
+ # File: lib/xqsr3/string_utilities/starts_with.rb
4
4
  #
5
- # Purpose: Definition of the ::Xqsr3::StringUtilities::StartsWith
6
- # module
5
+ # Purpose: Definition of the Xqsr3::StringUtilities::StartsWith module
7
6
  #
8
- # Created: 13th April 2016
9
- # Updated: 15th April 2019
7
+ # Created: 13th April 2016
8
+ # Updated: 11th December 2023
10
9
  #
11
- # Home: http://github.com/synesissoftware/xqsr3
10
+ # Home: http://github.com/synesissoftware/xqsr3
12
11
  #
13
- # Author: Matthew Wilson
12
+ # Author: Matthew Wilson
14
13
  #
14
+ # Copyright (c) 2019-2023, Matthew Wilson and Synesis Information Systems
15
15
  # Copyright (c) 2016-2019, Matthew Wilson and Synesis Software
16
16
  # All rights reserved.
17
17
  #
@@ -26,7 +26,7 @@
26
26
  # notice, this list of conditions and the following disclaimer in the
27
27
  # documentation and/or other materials provided with the distribution.
28
28
  #
29
- # * 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
30
30
  # contributors may be used to endorse or promote products derived from
31
31
  # this software without specific prior written permission.
32
32
  #
@@ -1,17 +1,17 @@
1
1
 
2
2
  # ######################################################################## #
3
- # File: lib/xqsr3/string_utilities/to_symbol.rb
3
+ # File: lib/xqsr3/string_utilities/to_symbol.rb
4
4
  #
5
- # Purpose: Definition of the ::Xqsr3::StringUtilities::ToSymbol
6
- # module
5
+ # Purpose: Definition of the Xqsr3::StringUtilities::ToSymbol module
7
6
  #
8
- # Created: 14th April 2016
9
- # Updated: 15th April 2019
7
+ # Created: 14th April 2016
8
+ # Updated: 11th December 2023
10
9
  #
11
- # Home: http://github.com/synesissoftware/xqsr3
10
+ # Home: http://github.com/synesissoftware/xqsr3
12
11
  #
13
- # Author: Matthew Wilson
12
+ # Author: Matthew Wilson
14
13
  #
14
+ # Copyright (c) 2019-2023, Matthew Wilson and Synesis Information Systems
15
15
  # Copyright (c) 2016-2019, Matthew Wilson and Synesis Software
16
16
  # All rights reserved.
17
17
  #
@@ -26,7 +26,7 @@
26
26
  # notice, this list of conditions and the following disclaimer in the
27
27
  # documentation and/or other materials provided with the distribution.
28
28
  #
29
- # * 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
30
30
  # contributors may be used to endorse or promote products derived from
31
31
  # this software without specific prior written permission.
32
32
  #
@@ -1,17 +1,17 @@
1
1
 
2
2
  # ######################################################################## #
3
- # File: lib/xqsr3/string_utilities/truncate.rb
3
+ # File: lib/xqsr3/string_utilities/truncate.rb
4
4
  #
5
- # Purpose: Definition of the ::Xqsr3::StringUtilities::Truncate
6
- # module
5
+ # Purpose: Definition of the Xqsr3::StringUtilities::Truncate module
7
6
  #
8
- # Created: 12th April 2018
9
- # Updated: 15th April 2019
7
+ # Created: 12th April 2018
8
+ # Updated: 11th December 2023
10
9
  #
11
- # Home: http://github.com/synesissoftware/xqsr3
10
+ # Home: http://github.com/synesissoftware/xqsr3
12
11
  #
13
- # Author: Matthew Wilson
12
+ # Author: Matthew Wilson
14
13
  #
14
+ # Copyright (c) 2019-2023, Matthew Wilson and Synesis Information Systems
15
15
  # Copyright (c) 2018-2019, Matthew Wilson and Synesis Software
16
16
  # All rights reserved.
17
17
  #
@@ -26,7 +26,7 @@
26
26
  # notice, this list of conditions and the following disclaimer in the
27
27
  # documentation and/or other materials provided with the distribution.
28
28
  #
29
- # * 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
30
30
  # contributors may be used to endorse or promote products derived from
31
31
  # this software without specific prior written permission.
32
32
  #
@@ -134,4 +134,3 @@ end # module Xqsr3
134
134
 
135
135
  # ############################## end of file ############################# #
136
136
 
137
-
data/lib/xqsr3/version.rb CHANGED
@@ -1,17 +1,17 @@
1
1
 
2
2
  # ######################################################################## #
3
- # File: lib/xqsr3/version.rb
3
+ # File: lib/xqsr3/version.rb
4
4
  #
5
- # Purpose: Version for Xqsr3 library
5
+ # Purpose: Version for Xqsr3 library
6
6
  #
7
- # Created: 3rd April 2016
8
- # Updated: 26th July 2022
7
+ # Created: 3rd April 2016
8
+ # Updated: 1st January 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-2022, 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
  #
@@ -26,7 +26,7 @@
26
26
  # notice, this list of conditions and the following disclaimer in the
27
27
  # documentation and/or other materials provided with the distribution.
28
28
  #
29
- # * 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
30
30
  # contributors may be used to endorse or promote products derived from
31
31
  # this software without specific prior written permission.
32
32
  #
@@ -51,7 +51,7 @@
51
51
  module Xqsr3
52
52
 
53
53
  # Current version of the Xqsr3 library
54
- VERSION = '0.38.1'
54
+ VERSION = '0.38.2'
55
55
 
56
56
  private
57
57
  VERSION_PARTS_ = VERSION.split(/[.]/).collect { |n| n.to_i } # :nodoc:
@@ -67,4 +67,3 @@ end # module Xqsr3
67
67
 
68
68
  # ############################## end of file ############################# #
69
69
 
70
-
@@ -1,18 +1,4 @@
1
- #!/usr/bin/env ruby
2
-
3
- #############################################################################
4
- # File: test/performance/frequency_map.rb
5
- #
6
- # Purpose: COMPLETE_ME
7
- #
8
- # Created: 13th October 2018
9
- # Updated: 13th October 2018
10
- #
11
- # Author: Matthew Wilson
12
- #
13
- # Copyright: <<TBD>>
14
- #
15
- #############################################################################
1
+ #! /usr/bin/env ruby
16
2
 
17
3
  $:.unshift File.join(File.dirname($0), *(['..'] * 2), 'lib')
18
4
 
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env ruby
1
+ #! /usr/bin/env ruby
2
2
 
3
3
  $:.unshift File.join(File.dirname(__FILE__), '../../lib')
4
4
 
@@ -28,4 +28,3 @@ class Test_assert_raise_with_message < Test::Unit::TestCase
28
28
  end
29
29
  end
30
30
 
31
-
@@ -211,5 +211,3 @@ class Test_Xqsr3_ArrayUtilities_join_with_or_by_include < Test::Unit::TestCase
211
211
  end
212
212
  end
213
213
 
214
-
215
-
@@ -532,7 +532,34 @@ class Test_Xqsr3_Containers_FrequencyMap < Test::Unit::TestCase
532
532
  assert_equal 0, fm.count
533
533
  end
534
534
 
535
- def test_eql?
535
+ def test_op_equal
536
+ # `==` evaluates logical equality (except for `Object`)
537
+
538
+ fm1 = FrequencyMap.new
539
+ fm2 = FrequencyMap.new
540
+
541
+ assert fm1 == fm1
542
+ assert fm2 == fm2
543
+ assert fm1 == fm2
544
+
545
+ fm1 << :abc << :def
546
+
547
+ assert fm1 == fm1
548
+ assert fm2 == fm2
549
+ assert_not fm1 == fm2
550
+
551
+ fm2 << :def << :abc
552
+
553
+ assert fm1 == fm1
554
+ assert fm2 == fm2
555
+ assert fm1 == fm2
556
+
557
+ assert_equal 2, fm1.size
558
+ assert_equal 2, fm1.count
559
+ end
560
+
561
+ def test_eql
562
+ # `eql?` evaluates equality based on #hash
536
563
 
537
564
  fm1 = FrequencyMap.new
538
565
  fm2 = FrequencyMap.new
@@ -557,6 +584,32 @@ class Test_Xqsr3_Containers_FrequencyMap < Test::Unit::TestCase
557
584
  assert_equal 2, fm1.count
558
585
  end
559
586
 
587
+ def test_equal
588
+ # `eql?` evaluates identity
589
+
590
+ fm1 = FrequencyMap.new
591
+ fm2 = FrequencyMap.new
592
+
593
+ assert fm1.equal? fm1
594
+ assert fm2.equal? fm2
595
+ assert_not fm1.equal? fm2
596
+
597
+ fm1 << :abc << :def
598
+
599
+ assert fm1.equal? fm1
600
+ assert fm2.equal? fm2
601
+ assert_not fm1.equal? fm2
602
+
603
+ fm2 << :def << :abc
604
+
605
+ assert fm1.equal? fm1
606
+ assert fm2.equal? fm2
607
+ assert_not fm1.equal? fm2
608
+
609
+ assert_equal 2, fm1.size
610
+ assert_equal 2, fm1.count
611
+ end
612
+
560
613
  def test_fetch
561
614
 
562
615
  fm = FrequencyMap.new
@@ -596,7 +649,7 @@ class Test_Xqsr3_Containers_FrequencyMap < Test::Unit::TestCase
596
649
  assert_equal [:def, 2, :abc, 1], fm.flatten
597
650
  end
598
651
 
599
- def test_has_key?
652
+ def test_has_key
600
653
 
601
654
  fm = FrequencyMap.new
602
655
 
@@ -617,7 +670,7 @@ class Test_Xqsr3_Containers_FrequencyMap < Test::Unit::TestCase
617
670
  assert fm.has_key? 'abc'
618
671
  end
619
672
 
620
- def test_has_value?
673
+ def test_has_value
621
674
 
622
675
  fm = FrequencyMap.new
623
676
 
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env ruby
1
+ #! /usr/bin/env ruby
2
2
 
3
3
  $:.unshift File.join(File.dirname(__FILE__), '../../../lib')
4
4
 
@@ -410,7 +410,33 @@ class Test_Xqsr3_Containers_MultiMap < Test::Unit::TestCase
410
410
  assert_not mm.empty?
411
411
  end
412
412
 
413
- def test_eql?
413
+ def test_op_equal
414
+ # `==` evaluates logical equality (except for `Object`)
415
+
416
+ mm1 = MultiMap.new
417
+ mm2 = MultiMap.new
418
+
419
+ assert mm1 == mm1
420
+ assert mm2 == mm2
421
+ assert mm1 == mm2
422
+
423
+ mm1.push :abc
424
+ mm1.push :def
425
+
426
+ assert mm1 == mm1
427
+ assert mm2 == mm2
428
+ assert_not mm1 == mm2
429
+
430
+ mm2.push :def
431
+ mm2.push :abc
432
+
433
+ assert mm1 == mm1
434
+ assert mm2 == mm2
435
+ assert mm1 == mm2
436
+ end
437
+
438
+ def test_eql
439
+ # `eql?` evaluates equality based on #hash
414
440
 
415
441
  mm1 = MultiMap.new
416
442
  mm2 = MultiMap.new
@@ -434,6 +460,31 @@ class Test_Xqsr3_Containers_MultiMap < Test::Unit::TestCase
434
460
  assert mm1.eql? mm2
435
461
  end
436
462
 
463
+ def test_equal
464
+ # `eql?` evaluates identity
465
+
466
+ mm1 = MultiMap.new
467
+ mm2 = MultiMap.new
468
+
469
+ assert mm1.equal? mm1
470
+ assert mm2.equal? mm2
471
+ assert_not mm1.equal? mm2
472
+
473
+ mm1.push :abc
474
+ mm1.push :def
475
+
476
+ assert mm1.equal? mm1
477
+ assert mm2.equal? mm2
478
+ assert_not mm1.equal? mm2
479
+
480
+ mm2.push :def
481
+ mm2.push :abc
482
+
483
+ assert mm1.equal? mm1
484
+ assert mm2.equal? mm2
485
+ assert_not mm1.equal? mm2
486
+ end
487
+
437
488
  def test_fetch
438
489
 
439
490
  mm = MultiMap.new
@@ -475,7 +526,7 @@ class Test_Xqsr3_Containers_MultiMap < Test::Unit::TestCase
475
526
  assert_equal [ :abc, 1, :abc, 2, :abc, 3, :abc, 4, :abc, 5, :def, [] ], mm.flatten
476
527
  end
477
528
 
478
- def test_has_key?
529
+ def test_has_key
479
530
 
480
531
  mm = MultiMap.new
481
532
 
@@ -490,7 +541,7 @@ class Test_Xqsr3_Containers_MultiMap < Test::Unit::TestCase
490
541
  assert_not mm.has_key? :abc
491
542
  end
492
543
 
493
- def test_has_value?
544
+ def test_has_value
494
545
 
495
546
  mm = MultiMap.new
496
547
 
@@ -507,7 +558,7 @@ class Test_Xqsr3_Containers_MultiMap < Test::Unit::TestCase
507
558
  assert_not mm.has_value? :abc
508
559
  end
509
560
 
510
- def test_has_values?
561
+ def test_has_values
511
562
 
512
563
  mm = MultiMap.new
513
564
 
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env ruby
1
+ #! /usr/bin/env ruby
2
2
 
3
3
  $:.unshift File.join(File.dirname(__FILE__), '../../../lib')
4
4
 
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env ruby
1
+ #! /usr/bin/env ruby
2
2
 
3
3
  $:.unshift File.join(File.dirname(__FILE__), '../../../lib')
4
4
 
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env ruby
1
+ #! /usr/bin/env ruby
2
2
 
3
3
  $:.unshift File.join(File.dirname(__FILE__), '../../../../lib')
4
4
 
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env ruby
1
+ #! /usr/bin/env ruby
2
2
 
3
3
  $:.unshift File.join(File.dirname(__FILE__), '../../../../lib')
4
4
 
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env ruby
1
+ #! /usr/bin/env ruby
2
2
 
3
3
  $:.unshift File.join(File.dirname(__FILE__), '../../../../lib')
4
4
 
@@ -196,5 +196,3 @@ class Test_Xqsr3_IO_writelines < Test::Unit::TestCase
196
196
  end
197
197
  end
198
198
 
199
- # ############################## end of file ############################# #
200
-
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env ruby
1
+ #! /usr/bin/env ruby
2
2
 
3
3
  $:.unshift File.join(File.dirname(__FILE__), '../../../..', 'lib')
4
4
 
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env ruby
1
+ #! /usr/bin/env ruby
2
2
 
3
3
  $:.unshift File.join(File.dirname(__FILE__), *(['..'] * 3), 'lib')
4
4
 
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.38.1
4
+ version: 0.38.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Wilson
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-26 00:00:00.000000000 Z
11
+ date: 2024-01-01 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
@@ -156,7 +156,7 @@ homepage: http://github.com/synesissoftware/xqsr3
156
156
  licenses:
157
157
  - BSD-3-Clause
158
158
  metadata: {}
159
- post_install_message:
159
+ post_install_message:
160
160
  rdoc_options: []
161
161
  require_paths:
162
162
  - lib
@@ -174,9 +174,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
174
174
  - !ruby/object:Gem::Version
175
175
  version: '0'
176
176
  requirements: []
177
- rubyforge_project:
178
- rubygems_version: 2.6.14.3
179
- signing_key:
177
+ rubygems_version: 3.1.6
178
+ signing_key:
180
179
  specification_version: 4
181
180
  summary: xqsr3
182
181
  test_files: []