active_object 5.3.0 → 5.3.1
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/active_object.gemspec +0 -2
- data/lib/active_object/enumerable.rb +3 -0
- data/lib/active_object/hash.rb +2 -0
- data/lib/active_object/kernel.rb +2 -0
- data/lib/active_object/numeric.rb +4 -0
- data/lib/active_object/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8bd07d1a8b5d4164cf92df8c710eb1608d36c2151345cdbd38bc11e34bc115fd
|
4
|
+
data.tar.gz: 66c8ceceeb6f5eaa08e9d5a2195fe900a4f0872d9ea44b7e25f484816aa4d011
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52adca931f74dc3342f84c02ee56aaebedc0a6d047b1b9799a04adca4afaad370292fceb61b4461478522609c7c4928ac3ce26e568789abaea5472246771df55
|
7
|
+
data.tar.gz: d154cbd3b8e26c11f51cff3a3e7afa9f6b64331d0214b61053cd140d7da0c82b4311b2f881d7cb835b207405536d12a91798fe3dfdb629d0585fad700cff558c
|
data/active_object.gemspec
CHANGED
@@ -70,6 +70,7 @@ if ActiveObject.configuration.autoload_enumerable
|
|
70
70
|
|
71
71
|
CRITICAL_ZSCORE.keys.sort.each do |key|
|
72
72
|
break if key > collection_length
|
73
|
+
|
73
74
|
result = CRITICAL_ZSCORE[key]
|
74
75
|
end
|
75
76
|
|
@@ -95,6 +96,7 @@ if ActiveObject.configuration.autoload_enumerable
|
|
95
96
|
def drop_last(num)
|
96
97
|
collection_length = to_a.length
|
97
98
|
return self if num > collection_length
|
99
|
+
|
98
100
|
self[0...(collection_length - num)]
|
99
101
|
end
|
100
102
|
|
@@ -213,6 +215,7 @@ if ActiveObject.configuration.autoload_enumerable
|
|
213
215
|
top_two_first = frequency_top_two.first
|
214
216
|
|
215
217
|
return if frequency_top_two.length != 1 && top_two_first.last == frequency_top_two.last.last
|
218
|
+
|
216
219
|
top_two_first.first
|
217
220
|
end
|
218
221
|
# rubocop:enable Metrics/AbcSize
|
data/lib/active_object/hash.rb
CHANGED
@@ -69,6 +69,7 @@ module ActiveObject
|
|
69
69
|
|
70
70
|
def demote(key)
|
71
71
|
return self unless key?(key)
|
72
|
+
|
72
73
|
merge(key => delete(key))
|
73
74
|
end
|
74
75
|
|
@@ -147,6 +148,7 @@ module ActiveObject
|
|
147
148
|
|
148
149
|
def promote(key)
|
149
150
|
return self unless key?(key)
|
151
|
+
|
150
152
|
{ key => delete(key) }.merge(self)
|
151
153
|
end
|
152
154
|
|
data/lib/active_object/kernel.rb
CHANGED
@@ -3,11 +3,13 @@
|
|
3
3
|
if ActiveObject.configuration.autoload_kernel
|
4
4
|
module Kernel
|
5
5
|
|
6
|
+
# rubocop:disable Lint/RescueException, Security/Eval
|
6
7
|
def try_eval
|
7
8
|
eval(self)
|
8
9
|
rescue Exception
|
9
10
|
self
|
10
11
|
end
|
12
|
+
# rubocop:enable Lint/RescueException, Security/Eval
|
11
13
|
|
12
14
|
private
|
13
15
|
|
@@ -377,6 +377,7 @@ module ActiveObject
|
|
377
377
|
|
378
378
|
def percentage_of(number)
|
379
379
|
return 0 if zero? || number.zero?
|
380
|
+
|
380
381
|
(to_f / number.to_f) * 100.0
|
381
382
|
end
|
382
383
|
|
@@ -444,6 +445,7 @@ module ActiveObject
|
|
444
445
|
assert_inclusion_of_valid_keys!(LENGTH_KEYS.values.flatten, from, to)
|
445
446
|
metric_keys = LENGTH_KEYS.fetch(:metric)
|
446
447
|
return self if from == to
|
448
|
+
|
447
449
|
metrics_included_from = metric_keys.include?(from)
|
448
450
|
|
449
451
|
case to
|
@@ -470,6 +472,7 @@ module ActiveObject
|
|
470
472
|
assert_inclusion_of_valid_keys!(MASS_KEYS.values.flatten, from, to)
|
471
473
|
metric_keys = MASS_KEYS.fetch(:metric)
|
472
474
|
return self if from == to
|
475
|
+
|
473
476
|
metrics_included_from = metric_keys.include?(from)
|
474
477
|
|
475
478
|
case to
|
@@ -571,6 +574,7 @@ module ActiveObject
|
|
571
574
|
|
572
575
|
def assert_inclusion_of_valid_keys!(cns, from, to)
|
573
576
|
return if cns.include?(from) && cns.include?(to)
|
577
|
+
|
574
578
|
raise ArgumentError,
|
575
579
|
[
|
576
580
|
"Unknown key(s): from: #{from.inspect} and to: #{to.inspect}.",
|
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.3.
|
4
|
+
version: 5.3.1
|
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-09-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|