active_object 5.11.0 → 5.12.0

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: 9c04c17218d37f7564db794979d7917e0a9c3fb0abab20977b5bc18e96aaa00e
4
- data.tar.gz: 633e2857d96094207163ab4deb75e94e86972ac0addf1ee5f00d8e7ff3e3546f
3
+ metadata.gz: 7cca57c6debc6ddba757fdd9ee484ad2d712ee112565f35e6a6ee8eac85f86fa
4
+ data.tar.gz: f8cef2544ef1de5a5b42a519766110c3bb0f52b2de25176dd8bbffe0ba0188a6
5
5
  SHA512:
6
- metadata.gz: 620b2f5cd8ee6a5129e0d9b45ba147501a33dd9b0b2a52bfac24fd8ba63347266a34cf39005595fe69c081ce4ffee2632f83367a2cc2b6bc5b200668212ba31b
7
- data.tar.gz: 2433dbd83801abbe506faf5666030fe166970eabbfb1c51654427a42b990ace8dbfe06247cdb035100703aee3c046fd0585c3fe229b3f4bd54f4d4dbe41bd082
6
+ metadata.gz: fe306fe0c7f05498d35fabf0ca63fe97ad42c6677c6ab4160e96fc87812258882d48fc108143fe60a8081659e780e4f81edfac3fe4edab7a7c52e86dfc72ffd2
7
+ data.tar.gz: d73c4d1148b1d3ef82662d7b42ed26310c511df020f9eb75f2d042a4a220813fc10e0923cd18f003195a3a1215cb5e13c47b219eeff6087928ebf165b4bf9681
data/.irbrc CHANGED
@@ -25,8 +25,8 @@ railsrc_path = File.expand_path('.irbrc_rails')
25
25
  if (ENV['RAILS_ENV'] || defined?(Rails)) && File.exist?(railsrc_path)
26
26
  begin
27
27
  load railsrc_path
28
- rescue Exception => err
29
- warn "Could not load: #{railsrc_path} because of #{err}"
28
+ rescue Exception => e
29
+ warn "Could not load: #{railsrc_path} because of #{e}"
30
30
  end
31
31
  end
32
32
 
data/README.md CHANGED
@@ -342,13 +342,13 @@ end
342
342
  [2,2,2,3,3,4,2,2,1].cluster { |x| x } #=> [[2, 2, 2], [3, 3], [4], [2, 2], [1]]
343
343
  ```
344
344
 
345
- **Difference:**
346
- `difference` returns the difference of a collection of numbers.
345
+ **Defference:**
346
+ `difference` returns the difference of a collection of numbers. (Renamed from: difference)
347
347
 
348
348
  ```ruby
349
- [].difference #=> 0
350
- [].difference(nil) #=> nil
351
- [1,2,3].difference #=> -4
349
+ [].defference #=> 0
350
+ [].defference(nil) #=> nil
351
+ [1,2,3].defference #=> -4
352
352
  ```
353
353
 
354
354
  **Divisible:**
@@ -697,7 +697,7 @@ h1.dig(:a, :b, :c) #=> :d
697
697
  `only_fill` and `only_fill!` returns only key/value pairs matching certain keys and any missing one.
698
698
 
699
699
  ```ruby
700
- {}.only(:foo) #=> { foo: nil }
700
+ {}.only_fill(:foo) #=> { foo: nil }
701
701
  { :foo => 1, baz: 2 }.only_fill(:foo, :bar, placeholder: 0) #=> { foo: 1, bar: 0 }
702
702
  ```
703
703
 
@@ -75,9 +75,9 @@ if ActiveObject.configuration.autoload_enumerable
75
75
  result || identity
76
76
  end
77
77
 
78
- def difference(identity = 0, &block)
78
+ def defference(identity = 0, &block)
79
79
  if block_given?
80
- map(&block).difference(identity)
80
+ map(&block).defference(identity)
81
81
  else
82
82
  inject { |key, val| key - val } || identity
83
83
  end
@@ -33,7 +33,7 @@ module ActiveObject
33
33
  acc.push(i)
34
34
 
35
35
  sq_num = (self / i)
36
- acc.push(sq_num) if (sq_num) != i
36
+ acc.push(sq_num) if sq_num != i
37
37
  end
38
38
  end
39
39
 
@@ -146,4 +146,18 @@ module ActiveObject
146
146
  end
147
147
  end
148
148
 
149
- Object.include(ActiveObject::Object) if ActiveObject.configuration.autoload_object
149
+ if ActiveObject.configuration.autoload_object
150
+ Object.include(ActiveObject::Object)
151
+
152
+ class FalseClass
153
+ def to_i
154
+ 0
155
+ end
156
+ end
157
+
158
+ class TrueClass
159
+ def to_i
160
+ 1
161
+ end
162
+ end
163
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveObject
4
- VERSION ||= '5.11.0'
4
+ VERSION ||= '5.12.0'
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.11.0
4
+ version: 5.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-04-19 00:00:00.000000000 Z
11
+ date: 2019-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler