array-tweaks 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +5 -5
- data/README.md +1 -0
- data/array-tweaks.gemspec +12 -12
- data/lib/array-tweaks.rb +12 -0
- data/lib/array-tweaks/version.rb +1 -1
- data/test/test-array-tweaks.rb +5 -0
- metadata +13 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 67e70998dccd108a9fdee63c1281b5bb531afcc7dc3f069d9f736fc67f214ed7
|
4
|
+
data.tar.gz: c8eda580c8b7246b4f228db6c74ab5a626d3e7536836f8f12ea67bec386ea5da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1b3d5b61c85475c616dc774c9b2f840a7673e2222ebb44de1020350c52971f86fe6ed357393f0627df6a114adafc122e6c1edb1b8b2e1da97107c4b380e78d4
|
7
|
+
data.tar.gz: 72848c0ebf9c09f5262c258bd58b2dda1248662d8c9fc0e03539eb38a523fd04d25b338beebe908178ea123562c14df1a23e8fa1122d997c1cc55543353c9756
|
data/Gemfile.lock
CHANGED
@@ -6,9 +6,9 @@ PATH
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
power_assert (
|
10
|
-
rake (12.3.
|
11
|
-
test-unit (3.
|
9
|
+
power_assert (2.0.0)
|
10
|
+
rake (12.3.3)
|
11
|
+
test-unit (3.4.1)
|
12
12
|
power_assert
|
13
13
|
|
14
14
|
PLATFORMS
|
@@ -16,9 +16,9 @@ PLATFORMS
|
|
16
16
|
|
17
17
|
DEPENDENCIES
|
18
18
|
array-tweaks!
|
19
|
-
bundler (
|
19
|
+
bundler (>= 1.7.0, < 3.0.0)
|
20
20
|
rake (~> 12.3)
|
21
21
|
test-unit (~> 3.2)
|
22
22
|
|
23
23
|
BUNDLED WITH
|
24
|
-
1.
|
24
|
+
2.1.4
|
data/README.md
CHANGED
data/array-tweaks.gemspec
CHANGED
@@ -4,16 +4,16 @@
|
|
4
4
|
require File.expand_path("../lib/array-tweaks/version", __FILE__)
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
|
-
s.name
|
8
|
-
s.version
|
9
|
-
s.author
|
10
|
-
s.email
|
11
|
-
s.summary
|
12
|
-
s.description
|
13
|
-
s.homepage
|
14
|
-
s.license
|
15
|
-
s.files
|
16
|
-
s.test_files
|
17
|
-
s.require_paths
|
18
|
-
s.add_development_dependency "bundler", "
|
7
|
+
s.name = "array-tweaks"
|
8
|
+
s.version = ArrayTweaks::VERSION
|
9
|
+
s.author = "Yaroslav Konoplov"
|
10
|
+
s.email = "eahome00@gmail.com"
|
11
|
+
s.summary = "Utilities for Ruby's array."
|
12
|
+
s.description = "A gem extending Ruby's array with useful utilities."
|
13
|
+
s.homepage = "https://github.com/yivo/array-tweaks"
|
14
|
+
s.license = "MIT"
|
15
|
+
s.files = `git ls-files -z`.split("\x0")
|
16
|
+
s.test_files = `git ls-files -z -- {test,spec,features}/*`.split("\x0")
|
17
|
+
s.require_paths = ["lib"]
|
18
|
+
s.add_development_dependency "bundler", ">= 1.7.0", "< 3.0.0"
|
19
19
|
end
|
data/lib/array-tweaks.rb
CHANGED
@@ -29,3 +29,15 @@ module ArrayTweaks
|
|
29
29
|
end
|
30
30
|
|
31
31
|
Array.include ArrayTweaks::Extension
|
32
|
+
|
33
|
+
module ObjectTweaks
|
34
|
+
module Extension
|
35
|
+
def not_in?(another_object)
|
36
|
+
!another_object.include?(self)
|
37
|
+
rescue NoMethodError
|
38
|
+
raise ArgumentError, "The parameter passed to #not_in? must respond to #include?."
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
Object.include ObjectTweaks::Extension
|
data/lib/array-tweaks/version.rb
CHANGED
data/test/test-array-tweaks.rb
CHANGED
@@ -47,4 +47,9 @@ class ArrayTweaksTest < Test::Unit::TestCase
|
|
47
47
|
def test_map_key
|
48
48
|
assert_equal ["a", "b", nil, "c"], [{ k: "a" }, { k: "b" }, {}, { k: "c" }].map_key(:k)
|
49
49
|
end
|
50
|
+
|
51
|
+
def test_not_in
|
52
|
+
assert_true "d".not_in? ["a", "b", nil, "c"]
|
53
|
+
assert_false "b".not_in? ["a", "b", nil, "c"]
|
54
|
+
end
|
50
55
|
end
|
metadata
CHANGED
@@ -1,29 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: array-tweaks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yaroslav Konoplov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 1.7.0
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 3.0.0
|
20
23
|
type: :development
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- - "
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 1.7.0
|
30
|
+
- - "<"
|
25
31
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
32
|
+
version: 3.0.0
|
27
33
|
description: A gem extending Ruby's array with useful utilities.
|
28
34
|
email: eahome00@gmail.com
|
29
35
|
executables: []
|
@@ -61,8 +67,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
61
67
|
- !ruby/object:Gem::Version
|
62
68
|
version: '0'
|
63
69
|
requirements: []
|
64
|
-
|
65
|
-
rubygems_version: 2.7.6
|
70
|
+
rubygems_version: 3.1.6
|
66
71
|
signing_key:
|
67
72
|
specification_version: 4
|
68
73
|
summary: Utilities for Ruby's array.
|