array_collection 0.2.8 → 0.3.0

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: 99c99035901ba4bb263bd3ed0127a9359fd4480d539c64b41376d458e9dd7331
4
- data.tar.gz: 2b1ebc21ac78ebd94d53f75dcb9ce79b884cb5cac89d9b4bdb9645a3c5989b02
3
+ metadata.gz: e1b8d9912e71cb9bf842e79331cb5019bc5df52a6f520434cc693d9a23fe3309
4
+ data.tar.gz: 1a34a7d6fc2cae2fac86f4951f9c7f11df31e7c97982af29231ff541b413a2dd
5
5
  SHA512:
6
- metadata.gz: 1a9712fb542f0f87bb99fed58eca9091ad4e91195ba9b4f59ec55dbd6d2c799e71464d8b48d35c5fe9dec88a0eeff9efec843d6f333279d5e8f534619978e959
7
- data.tar.gz: 8f0ca49396f74b030ebf7ba9261d93d077e07f7d456eb6a0876ec653feed78a8939e0dacd1104b832921eef758228b8d86c1315764a8ff57ebc04669ca727c54
6
+ metadata.gz: 651ee3fe050356295b805b8aaeb2264b83fc169ec8cac23ae7a65db8a84f35263885bf869fe87a2b8825d0e8216501dbe5c2484c844528215028ac3573ca914a
7
+ data.tar.gz: 7bde4d6ea23ad092d88d6617c5552c2a98c2bddfc1daf67d6c3f89ffe1fe8c0751b3cc78eac0b5e200225bdc90c2e17ddadf249b47fec1b478619e153611bb47
data/.rubocop.yml CHANGED
@@ -1,6 +1,7 @@
1
1
  require:
2
2
  - rubocop-rspec
3
3
  - rubocop-rake
4
+ - rubocop-performance
4
5
 
5
6
  AllCops:
6
7
  TargetRubyVersion: 3.0
data/CHANGELOG.md CHANGED
@@ -2,52 +2,38 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
- ## [0.2.8](https://github.com/WailanTirajoh/ruby_collection/compare/v0.2.14...v0.2.8) (2024-03-26)
6
-
7
-
8
- ### Bug Fixes
9
-
10
- * **changelog:** bump changlog ([b50d44a](https://github.com/WailanTirajoh/ruby_collection/commit/b50d44ad655287ecbe0b934341d0a031f12e7cac))
11
-
12
-
13
-
14
- ## [0.2.14](https://github.com/WailanTirajoh/ruby_collection/compare/v0.2.13...v0.2.14) (2024-03-26)
15
-
5
+ # [0.3.0](https://github.com/WailanTirajoh/ruby_collection/compare/v0.2.8...v0.3.0) (2024-03-29)
16
6
 
17
7
 
18
- ## [0.2.13](https://github.com/WailanTirajoh/ruby_collection/compare/v0.2.12...v0.2.13) (2024-03-26)
19
-
20
-
21
-
22
- ## [0.2.12](https://github.com/WailanTirajoh/ruby_collection/compare/v0.2.11...v0.2.12) (2024-03-26)
23
-
24
-
25
-
26
- ## [0.2.11](https://github.com/WailanTirajoh/ruby_collection/compare/v0.2.10...v0.2.11) (2024-03-26)
8
+ ### Features
27
9
 
10
+ * **collect:** count ([7620a62](https://github.com/WailanTirajoh/ruby_collection/commit/7620a62bb6260e36210290a73f4083db533107b3))
11
+ * **collect:** uniq ([59a5c53](https://github.com/WailanTirajoh/ruby_collection/commit/59a5c53f2de89ea1d3099c726e7abaffffcf78bc))
12
+ * **collect:** uniq with block ([5fab50e](https://github.com/WailanTirajoh/ruby_collection/commit/5fab50e82775f67397cc0257aa1333c88483c30f))
13
+ * **rubocop-performance:** init & fix rubocop perf ([fa91115](https://github.com/WailanTirajoh/ruby_collection/commit/fa91115f40a5179957f5361d34a9d378c6bd7a0a))
28
14
 
29
15
 
30
- ## [0.2.10](https://github.com/WailanTirajoh/ruby_collection/compare/v0.2.9...v0.2.10) (2024-03-26)
31
16
 
17
+ ## [0.2.8](https://github.com/WailanTirajoh/ruby_collection/compare/v0.2.14...v0.2.8) (2024-03-26)
32
18
 
33
19
  ### Bug Fixes
34
20
 
35
- * **gem:** remove required mfa ([7b4b9c4](https://github.com/WailanTirajoh/ruby_collection/commit/7b4b9c432002ff4381da0004d3ad4d6912b8b2d8))
36
- * **gem:** remove required mfa ([d342636](https://github.com/WailanTirajoh/ruby_collection/commit/d3426369e6f1dff96abc568689fc9ec4381967f1))
37
- * **lint:** Lintfix ([be99af7](https://github.com/WailanTirajoh/ruby_collection/commit/be99af72b9f3a2cfadad224aff191aafb48a6d45))
21
+ - **changelog:** bump changlog ([b50d44a](https://github.com/WailanTirajoh/ruby_collection/commit/b50d44ad655287ecbe0b934341d0a031f12e7cac))
22
+ - **gem:** remove required mfa ([7b4b9c4](https://github.com/WailanTirajoh/ruby_collection/commit/7b4b9c432002ff4381da0004d3ad4d6912b8b2d8))
23
+ - **gem:** remove required mfa ([d342636](https://github.com/WailanTirajoh/ruby_collection/commit/d3426369e6f1dff96abc568689fc9ec4381967f1))
24
+ - **lint:** Lintfix ([be99af7](https://github.com/WailanTirajoh/ruby_collection/commit/be99af72b9f3a2cfadad224aff191aafb48a6d45))
38
25
 
39
26
  ### Features
40
27
 
41
- * **collect:** add left_join, right_join, full_join ([bca2af5](https://github.com/WailanTirajoh/ruby_collection/commit/bca2af5ec5e9b078fb7c75155ae0e1f79e8e1732))
42
- * **collection:** add sort, append, prepend, map and test chainable collection ([8084fc9](https://github.com/WailanTirajoh/ruby_collection/commit/8084fc966b2a3540c3e5f8935b56d795d8bf8b69))
43
- * **collection:** first initial collection & array fn ([2009281](https://github.com/WailanTirajoh/ruby_collection/commit/2009281a2d53d8ffa4a0090fd4e363329ac0f4ed))
44
- * **collection:** first initial collection & array fn ([04efd77](https://github.com/WailanTirajoh/ruby_collection/commit/04efd77f32bae72e1ad53391744bbfde12123754))
45
- * **data:** data accessor based on dot notation ([92efb9e](https://github.com/WailanTirajoh/ruby_collection/commit/92efb9e48f6dbeeb72c3f2bc1090bd4cd9f903c2))
46
- * **diff:** add diff & refactor array spec ([d0e3a66](https://github.com/WailanTirajoh/ruby_collection/commit/d0e3a66c8bd2d6d4f7ba706537b01e18929a3d51))
47
- * **helper:** add collect helper ([13c4efb](https://github.com/WailanTirajoh/ruby_collection/commit/13c4efbbc481960227f361208818471a197df752))
48
- * **join:** inner join ([d1f011b](https://github.com/WailanTirajoh/ruby_collection/commit/d1f011b76560ad26fdecdef1c01cdc7291cbac6e))
49
- * **utils:** add when, only, except ([77da9e8](https://github.com/WailanTirajoh/ruby_collection/commit/77da9e848ae60b771f24cf623b73df85f80b1eea))
50
-
28
+ - **collect:** add left_join, right_join, full_join ([bca2af5](https://github.com/WailanTirajoh/ruby_collection/commit/bca2af5ec5e9b078fb7c75155ae0e1f79e8e1732))
29
+ - **collection:** add sort, append, prepend, map and test chainable collection ([8084fc9](https://github.com/WailanTirajoh/ruby_collection/commit/8084fc966b2a3540c3e5f8935b56d795d8bf8b69))
30
+ - **collection:** first initial collection & array fn ([2009281](https://github.com/WailanTirajoh/ruby_collection/commit/2009281a2d53d8ffa4a0090fd4e363329ac0f4ed))
31
+ - **collection:** first initial collection & array fn ([04efd77](https://github.com/WailanTirajoh/ruby_collection/commit/04efd77f32bae72e1ad53391744bbfde12123754))
32
+ - **data:** data accessor based on dot notation ([92efb9e](https://github.com/WailanTirajoh/ruby_collection/commit/92efb9e48f6dbeeb72c3f2bc1090bd4cd9f903c2))
33
+ - **diff:** add diff & refactor array spec ([d0e3a66](https://github.com/WailanTirajoh/ruby_collection/commit/d0e3a66c8bd2d6d4f7ba706537b01e18929a3d51))
34
+ - **helper:** add collect helper ([13c4efb](https://github.com/WailanTirajoh/ruby_collection/commit/13c4efbbc481960227f361208818471a197df752))
35
+ - **join:** inner join ([d1f011b](https://github.com/WailanTirajoh/ruby_collection/commit/d1f011b76560ad26fdecdef1c01cdc7291cbac6e))
36
+ - **utils:** add when, only, except ([77da9e8](https://github.com/WailanTirajoh/ruby_collection/commit/77da9e848ae60b771f24cf623b73df85f80b1eea))
51
37
 
52
38
  ## [0.1.0] - 2024-03-15
53
39
 
@@ -16,6 +16,14 @@ module ArrayCollection
16
16
  @items
17
17
  end
18
18
 
19
+ def count(&block)
20
+ @items.count(&block)
21
+ end
22
+
23
+ def uniq
24
+ self.class.new(@items.uniq)
25
+ end
26
+
19
27
  def filter(&block)
20
28
  self.class.new(ArrayCollection::CollectionArray.filter(@items, &block))
21
29
  end
@@ -112,7 +120,7 @@ module ArrayCollection
112
120
  end
113
121
 
114
122
  def check_hash_item
115
- raise ArgumentError, "Input must be an array of hashes" unless @items.all? { |item| item.is_a?(Hash) }
123
+ raise ArgumentError, "Input must be an array of hashes" unless @items.all?(Hash)
116
124
  end
117
125
 
118
126
  # Hooks
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ArrayCollection
4
- VERSION = "0.2.8"
4
+ VERSION = "0.3.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: array_collection
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wailan Tirajoh
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-03-26 00:00:00.000000000 Z
11
+ date: 2024-03-29 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Write a longer description or delete this line.
14
14
  email: