active_object 5.2.1 → 5.2.2
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 +4 -4
- data/.reek.yml +40 -0
- data/README.md +8 -0
- data/lib/active_object/array.rb +4 -4
- data/lib/active_object/hash.rb +4 -0
- data/lib/active_object/version.rb +1 -1
- metadata +4 -4
- data/.reek +0 -41
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 47e320f8bd28e0d57b362e2186d88c590ba8ee29746824ff1bb745858cd73b11
|
4
|
+
data.tar.gz: 5f6177a7c52e81328df11923320120a1a8e050daf4b81eae66545513ae2b3322
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49e372ffe9ccebf61a56e3f586f9652e9a596493146f982a71dd5e03b9fc8c3cfdc4297ee2acf780ba3f1ea15f9ad1841d5212a176cb9639d7ee35d4624966e1
|
7
|
+
data.tar.gz: e971ee72aee357559b4fd911fd9dc1b86fad0b333f520cd9ca9aad02149c7ef0cee1c3ae2edc52d5f12f4caccef5c974066af157bcba981756098c7671f1c304
|
data/.reek.yml
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
---
|
2
|
+
detectors:
|
3
|
+
Attribute:
|
4
|
+
enabled: false
|
5
|
+
BooleanParameter:
|
6
|
+
enabled: false
|
7
|
+
ControlParameter:
|
8
|
+
enabled: false
|
9
|
+
DuplicateMethodCall:
|
10
|
+
enabled: false
|
11
|
+
FeatureEnvy:
|
12
|
+
enabled: false
|
13
|
+
IrresponsibleModule:
|
14
|
+
enabled: false
|
15
|
+
LongParameterList:
|
16
|
+
enabled: false
|
17
|
+
ManualDispatch:
|
18
|
+
enabled: false
|
19
|
+
NestedIterators:
|
20
|
+
max_allowed_nesting: 2
|
21
|
+
NilCheck:
|
22
|
+
enabled: false
|
23
|
+
RepeatedConditional:
|
24
|
+
enabled: false
|
25
|
+
TooManyConstants:
|
26
|
+
enabled: false
|
27
|
+
TooManyInstanceVariables:
|
28
|
+
exclude:
|
29
|
+
- 'ActiveObject::Configuration'
|
30
|
+
TooManyStatements:
|
31
|
+
max_statements: 10
|
32
|
+
exclude:
|
33
|
+
- 'ActiveObject::Array#in_groups'
|
34
|
+
- 'ActiveObject::Configuration#initialize'
|
35
|
+
UncommunicativeVariableName:
|
36
|
+
accept:
|
37
|
+
- '/^.$/'
|
38
|
+
- '/[0-9]$/'
|
39
|
+
UtilityFunction:
|
40
|
+
enabled: false
|
data/README.md
CHANGED
@@ -661,6 +661,14 @@ h1.dig(:a, :b, :c) #=> :d
|
|
661
661
|
{ :foo => 'foo', :baz => 'baz', :bar => 'bar' }.only(:baz, :bar) #=> { :baz => 'baz', :bar => 'bar' }
|
662
662
|
```
|
663
663
|
|
664
|
+
**Pair?:**
|
665
|
+
`pair?` checks if the hash has a key with a matching value.
|
666
|
+
|
667
|
+
```ruby
|
668
|
+
{ a: 0 }.pair?(:a, 0) #=> true
|
669
|
+
{ a: 0 }.pair?(:a, 2) #=> false
|
670
|
+
```
|
671
|
+
|
664
672
|
**Promote:**
|
665
673
|
`promote` and `promote!` moves a key value pair to the head of the hash.
|
666
674
|
|
data/lib/active_object/array.rb
CHANGED
@@ -144,8 +144,8 @@ module ActiveObject
|
|
144
144
|
replace(nillify)
|
145
145
|
end
|
146
146
|
|
147
|
-
def position(
|
148
|
-
idx = index(
|
147
|
+
def position(value)
|
148
|
+
idx = index(value)
|
149
149
|
(idx + 1) unless idx.nil?
|
150
150
|
end
|
151
151
|
|
@@ -178,8 +178,8 @@ module ActiveObject
|
|
178
178
|
reject { |val| args.include?(val) }
|
179
179
|
end
|
180
180
|
|
181
|
-
def rposition(
|
182
|
-
idx = rindex(
|
181
|
+
def rposition(value)
|
182
|
+
idx = rindex(value)
|
183
183
|
(idx + 1) unless idx.nil?
|
184
184
|
end
|
185
185
|
|
data/lib/active_object/hash.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_object
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.2.
|
4
|
+
version: 5.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juan Gomez
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-07-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -118,7 +118,7 @@ files:
|
|
118
118
|
- ".DS_Store"
|
119
119
|
- ".fasterer.yml"
|
120
120
|
- ".gitignore"
|
121
|
-
- ".reek"
|
121
|
+
- ".reek.yml"
|
122
122
|
- ".rspec"
|
123
123
|
- ".rubocop.yml"
|
124
124
|
- ".travis.yml"
|
@@ -169,7 +169,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
169
169
|
version: '0'
|
170
170
|
requirements: []
|
171
171
|
rubyforge_project:
|
172
|
-
rubygems_version: 2.7.
|
172
|
+
rubygems_version: 2.7.7
|
173
173
|
signing_key:
|
174
174
|
specification_version: 4
|
175
175
|
summary: Gem for commonly used ruby object helpers.
|
data/.reek
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
---
|
2
|
-
Attribute:
|
3
|
-
enabled: false
|
4
|
-
BooleanParameter:
|
5
|
-
enabled: false
|
6
|
-
ControlParameter:
|
7
|
-
enabled: false
|
8
|
-
DuplicateMethodCall:
|
9
|
-
enabled: false
|
10
|
-
FeatureEnvy:
|
11
|
-
enabled: false
|
12
|
-
IrresponsibleModule:
|
13
|
-
enabled: false
|
14
|
-
LongParameterList:
|
15
|
-
enabled: false
|
16
|
-
ManualDispatch:
|
17
|
-
enabled: false
|
18
|
-
NestedIterators:
|
19
|
-
max_allowed_nesting: 2
|
20
|
-
NilCheck:
|
21
|
-
enabled: false
|
22
|
-
PrimaDonnaMethod:
|
23
|
-
enabled: false
|
24
|
-
RepeatedConditional:
|
25
|
-
enabled: false
|
26
|
-
TooManyConstants:
|
27
|
-
enabled: false
|
28
|
-
TooManyInstanceVariables:
|
29
|
-
exclude:
|
30
|
-
- 'ActiveObject::Configuration'
|
31
|
-
TooManyStatements:
|
32
|
-
max_statements: 10
|
33
|
-
exclude:
|
34
|
-
- 'ActiveObject::Array#in_groups'
|
35
|
-
- 'ActiveObject::Configuration#initialize'
|
36
|
-
UncommunicativeVariableName:
|
37
|
-
accept:
|
38
|
-
- !ruby/regexp /^.$/
|
39
|
-
- !ruby/regexp /[0-9]$/
|
40
|
-
UtilityFunction:
|
41
|
-
enabled: false
|