delight 0.1.2 → 0.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4f8b296bea6885bf28e8099087e72cab52ef75a843e1c390a0d68b9b8e83798a
4
- data.tar.gz: b1eac6efa6ba0c1aae4a279185de6fea118b9c796306326171cd0e7bea477c19
3
+ metadata.gz: 8b71843e7ea31f5cd0ead34733ab94d3505e09db476072a9e40f189aa969df72
4
+ data.tar.gz: 259873047a56a06f96a907c394a1ce6280021ea886831e43283e3cc1886938fe
5
5
  SHA512:
6
- metadata.gz: a5ecfa1a5774c61d58e19bc0801be073a6899c916111bcdb754c53a5ba13d80dec48eba01bb6c68f0249215cc7d2e91a7e6a444e0546d121f8269e602b1d3dd1
7
- data.tar.gz: 3a7c646c237a93f747bcd7beff8e457245619f118bd51452bb5771d5e3ab8b151f837ee905c56cfc1a1e876d58a485cd2d46557d3bb5c22460864c6d61637291
6
+ metadata.gz: 3300b566241e7874db2f180fd6fb5f406cb0a48bbf81955b8fb2d561a5e83f56319144083d9e98cfd74642f4081b6586e92288ffc368a6840bef0e751b8b17e4
7
+ data.tar.gz: a44f89bbf3927b3bc4b79fe677912311d16f29d16a414eb5ab4132aa3c939864cc840aad2c820b8433d75f44b749b62b5b79962f25e6db0c14db8149a4d4a781
@@ -1,5 +1,5 @@
1
1
  module Delight
2
- module DelightEnumerator
2
+ module Enumerator
3
3
  module CollectionMatcher
4
4
  def collection_matcher(element, **kwargs)
5
5
  kwargs.all? do |key, value|
@@ -1,8 +1,6 @@
1
1
  module Delight
2
- module DelightEnumerator
2
+ module Enumerator
3
3
  module DetectBang
4
- include CollectionMatcher
5
-
6
4
  # This method finds required element or raises error if the element is
7
5
  # not found. This is similar to sole, but returns first element (so
8
6
  # duplicates are possible) but doesn't need to traverse whole Array.
@@ -1,8 +1,6 @@
1
1
  module Delight
2
- module DelightEnumerator
2
+ module Enumerator
3
3
  module DetectBy
4
- include CollectionMatcher
5
-
6
4
  def detect_by(**)
7
5
  detect do |element|
8
6
  collection_matcher(element, **)
@@ -1,8 +1,6 @@
1
1
  module Delight
2
- module DelightEnumerator
2
+ module Enumerator
3
3
  module DetectByKey
4
- include HashCollectionMatcher
5
-
6
4
  def detect_by_key(**)
7
5
  detect do |element|
8
6
  hash_collection_matcher(element, **)
@@ -1,5 +1,5 @@
1
1
  module Delight
2
- module DelightEnumerator
2
+ module Enumerator
3
3
  module Error
4
4
  class ElementNotFound < StandardError
5
5
  end
@@ -1,5 +1,5 @@
1
1
  module Delight
2
- module DelightEnumerator
2
+ module Enumerator
3
3
  module Error
4
4
  class SoleItemExpected < StandardError
5
5
  end
@@ -1,5 +1,5 @@
1
1
  module Delight
2
- module DelightEnumerator
2
+ module Enumerator
3
3
  module Error
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  module Delight
2
- module DelightEnumerator
2
+ module Enumerator
3
3
  module HashCollectionMatcher
4
4
  def hash_collection_matcher(element, **kwargs)
5
5
  kwargs.all? do |key, value|
@@ -1,8 +1,6 @@
1
1
  module Delight
2
- module DelightEnumerator
2
+ module Enumerator
3
3
  module SelectBy
4
- include CollectionMatcher
5
-
6
4
  def select_by(**)
7
5
  select do |element|
8
6
  collection_matcher(element, **)
@@ -1,8 +1,6 @@
1
1
  module Delight
2
- module DelightEnumerator
2
+ module Enumerator
3
3
  module SelectByKey
4
- include HashCollectionMatcher
5
-
6
4
  def select_by_key(**)
7
5
  select do |element|
8
6
  hash_collection_matcher(element, **)
@@ -1,8 +1,6 @@
1
1
  module Delight
2
- module DelightEnumerator
2
+ module Enumerator
3
3
  module SoleBy
4
- include CollectionMatcher
5
-
6
4
  def sole_by(**)
7
5
  sole_by_implementation(:collection_matcher, **)
8
6
  end
@@ -1,9 +1,6 @@
1
1
  module Delight
2
- module DelightEnumerator
2
+ module Enumerator
3
3
  module SoleByKey
4
- include SoleBy
5
- include HashCollectionMatcher
6
-
7
4
  def sole_by_key(**)
8
5
  sole_by_implementation(:hash_collection_matcher, **)
9
6
  end
@@ -1,8 +1,6 @@
1
1
  module Delight
2
- module DelightEnumerator
2
+ module Enumerator
3
3
  module TrySoleBy
4
- include CollectionMatcher
5
-
6
4
  def try_sole_by(**)
7
5
  try_sole_by_implementation(:collection_matcher, **)
8
6
  end
@@ -1,5 +1,5 @@
1
1
  module Delight
2
- module DelightEnumerator
2
+ module Enumerator
3
3
  refine Enumerable do
4
4
  import_methods CollectionMatcher
5
5
  import_methods HashCollectionMatcher
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Delight
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: delight
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mariusz Droździel
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-05-13 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: zeitwerk
@@ -34,20 +34,20 @@ files:
34
34
  - README.md
35
35
  - Rakefile
36
36
  - lib/delight.rb
37
- - lib/delight/delight_enumerator.rb
38
- - lib/delight/delight_enumerator/collection_matcher.rb
39
- - lib/delight/delight_enumerator/detect_bang.rb
40
- - lib/delight/delight_enumerator/detect_by.rb
41
- - lib/delight/delight_enumerator/detect_by_key.rb
42
- - lib/delight/delight_enumerator/error.rb
43
- - lib/delight/delight_enumerator/error/element_not_found.rb
44
- - lib/delight/delight_enumerator/error/sole_item_expected.rb
45
- - lib/delight/delight_enumerator/hash_collection_matcher.rb
46
- - lib/delight/delight_enumerator/select_by.rb
47
- - lib/delight/delight_enumerator/select_by_key.rb
48
- - lib/delight/delight_enumerator/sole_by.rb
49
- - lib/delight/delight_enumerator/sole_by_key.rb
50
- - lib/delight/delight_enumerator/try_sole_by.rb
37
+ - lib/delight/enumerator.rb
38
+ - lib/delight/enumerator/collection_matcher.rb
39
+ - lib/delight/enumerator/detect_bang.rb
40
+ - lib/delight/enumerator/detect_by.rb
41
+ - lib/delight/enumerator/detect_by_key.rb
42
+ - lib/delight/enumerator/error.rb
43
+ - lib/delight/enumerator/error/element_not_found.rb
44
+ - lib/delight/enumerator/error/sole_item_expected.rb
45
+ - lib/delight/enumerator/hash_collection_matcher.rb
46
+ - lib/delight/enumerator/select_by.rb
47
+ - lib/delight/enumerator/select_by_key.rb
48
+ - lib/delight/enumerator/sole_by.rb
49
+ - lib/delight/enumerator/sole_by_key.rb
50
+ - lib/delight/enumerator/try_sole_by.rb
51
51
  - lib/delight/version.rb
52
52
  - sig/delight.rbs
53
53
  homepage: https://github.com/marzdrel/delight
@@ -70,7 +70,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
70
70
  - !ruby/object:Gem::Version
71
71
  version: '0'
72
72
  requirements: []
73
- rubygems_version: 3.6.2
73
+ rubygems_version: 3.6.7
74
74
  specification_version: 4
75
75
  summary: Delightful extensions to Ruby's standard library.
76
76
  test_files: []