active_object 5.3.0 → 5.3.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
2
  SHA256:
3
- metadata.gz: 44ff216e50cc449e4cf35d3ad5e130fec7c4bdc3d02a5c8cd56ce27822c9228b
4
- data.tar.gz: ade4feb9fc5ba7a2b715eb465f44afcd9254776c1ded80b6006c04f3a5abe159
3
+ metadata.gz: 8bd07d1a8b5d4164cf92df8c710eb1608d36c2151345cdbd38bc11e34bc115fd
4
+ data.tar.gz: 66c8ceceeb6f5eaa08e9d5a2195fe900a4f0872d9ea44b7e25f484816aa4d011
5
5
  SHA512:
6
- metadata.gz: 2be6b84fed86f382ba52fba5633f74faa1dadf27a8ebc8f8dde94a763082d9bcf952651bf87fbd0e32a76c09a11fbc8a09f17cbe5ec93ee82900e30b5df8ebbd
7
- data.tar.gz: ce743d560dec0bac3726af7b958e743503d58ce5fcd877ea75ff62c58945ddde13684e8bd13bfb9a1d491456bf476526b369ec7770d4beaf2db1897009574eb9
6
+ metadata.gz: 52adca931f74dc3342f84c02ee56aaebedc0a6d047b1b9799a04adca4afaad370292fceb61b4461478522609c7c4928ac3ce26e568789abaea5472246771df55
7
+ data.tar.gz: d154cbd3b8e26c11f51cff3a3e7afa9f6b64331d0214b61053cd140d7da0c82b4311b2f881d7cb835b207405536d12a91798fe3dfdb629d0585fad700cff558c
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # coding: utf-8
4
-
5
3
  lib = File.expand_path('../lib', __FILE__)
6
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
7
5
  require 'active_object/version'
@@ -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
@@ -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
 
@@ -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}.",
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveObject
4
- VERSION ||= '5.3.0'
4
+ VERSION ||= '5.3.1'
5
5
  end
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.0
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-08-10 00:00:00.000000000 Z
11
+ date: 2018-09-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler