array-tweaks 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 852d7207cfafe5e39ca5ef22a1692588fe41d1da
4
- data.tar.gz: 2d28e8c25866faf62d363e29874cdb724e5b02c8
2
+ SHA256:
3
+ metadata.gz: 8d6c730aa86b8450081ea2947346c24cf3ea826821d2493c4cc628b40b09d916
4
+ data.tar.gz: 0abfa9b5e444b6b1c4df6f662c932a510568b7e07a5f212aba012a1772dfb971
5
5
  SHA512:
6
- metadata.gz: 8f9229c0cceb09131623da94659324498e6794f92a2a3f9a052677d9c0ad71c132cfe44c5ca262d990709130f4493cc6b596c02591ade4db045b992a70f5455a
7
- data.tar.gz: 85d09f4a6ef899d0d7af1e3aa9102c11ea63669f4074d1a02441ddc89dba7a2e0e80d9c4e182fc8375821a1050a31c7d424ff4cbd695dbbdd5de9fbb5ea91649
6
+ metadata.gz: 7845d08a878ec957a74bb8c3a2d49addbaf4eafa9715b4f844f45eefeea59a411a7c6656fc62a6e47e69cdba54c6b7c5e8714787dd07f14990eaaef9cf3b4ea4
7
+ data.tar.gz: b028f3bcb9221fe98c52cea7ef34eeb3f87997ebea0cfa6a6a232b46031cb5766901796b4fd4147aa8d398044144a0095d4714456ab20ce213a2fdc087b91291
data/README.md CHANGED
@@ -7,6 +7,8 @@
7
7
  * `drop_last`
8
8
  * `drop_last!`
9
9
  * `each_with_index_and_size`
10
+ * `each_after`
11
+ * `map_key`
10
12
 
11
13
  ## Installing gem
12
14
  Add to your Gemfile:
@@ -15,6 +15,16 @@ module ArrayTweaks
15
15
  size = self.size
16
16
  each_with_index { |item, index| yield(item, index, size) }
17
17
  end
18
+
19
+ def each_after(n)
20
+ each_with_index do |item, i|
21
+ yield(item) if i >= n
22
+ end
23
+ end
24
+
25
+ def map_key(key)
26
+ map { |item| item[key] }
27
+ end
18
28
  end
19
29
  end
20
30
 
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module ArrayTweaks
5
- VERSION = '1.0.0'
5
+ VERSION = '1.0.1'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: array-tweaks
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yaroslav Konoplov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-28 00:00:00.000000000 Z
11
+ date: 2018-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -88,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
88
88
  version: '0'
89
89
  requirements: []
90
90
  rubyforge_project:
91
- rubygems_version: 2.6.8
91
+ rubygems_version: 2.7.6
92
92
  signing_key:
93
93
  specification_version: 4
94
94
  summary: Responsibly extends Ruby's Array with simple and predictable utilities.