active_object 5.5.2 → 5.5.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6e68b06677e6f56a8dc0b2880b43a90af33e99d3edb112f15b73399a31997f77
4
- data.tar.gz: a526d022fa347e6c95db3305aa7880a8925cb64b471c62be2f9d03b16c8c3cab
3
+ metadata.gz: 0defeadff70dccd4e5e304698bf45fdccb89a690c7f41c5a001d3a6caa6dedaa
4
+ data.tar.gz: fda47f4a96d84a512f90b17e011d7dfee6b8ebb0d2d73270a8f4917810e80ac2
5
5
  SHA512:
6
- metadata.gz: 5cf53342de20a6a01610770290edff9d5523807b1a0558b41aafad3acf628ca4b6be6051a9fb311a325a2ea331e77f127abe0f0b207a744013c8ed0a1c3f0760
7
- data.tar.gz: f7968d7254c38b78217fcb1674931c834643c8c2c50d7d0ed0fb3ba679fab3fa0703a950be3b20138cb49c6422f1b62973175bfac2610b5509f36b30b4deb916
6
+ metadata.gz: 5c844d2991441b2b210fe6fc01cd4b9a71c866ae34fe646a51402e81871f003d057760d1c8d21ad5fb1393d3b36dcf0439a7b1a7ed572dc1ccee7cb796ce5521
7
+ data.tar.gz: b052305a82d693c9b69143c79e79d2dfce0dbe1a2118c9fa14cfca25bc1d17aa2843eed5dfcc551140fc39de4c4f48a4cf582a1388a1518edd27cf88c8948afe
data/.gitignore CHANGED
@@ -7,3 +7,7 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ /.irbrc_history
11
+
12
+ # rspec failure tracking
13
+ .rspec_status
data/.irbrc ADDED
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Awesome print
4
+ begin
5
+ require 'awesome_print'
6
+
7
+ AwesomePrint.irb!
8
+ rescue LoadError => err
9
+ warn "Couldn't load awesome_print: #{err}"
10
+ end
11
+
12
+ # IRB
13
+ require 'irb/completion'
14
+
15
+ ARGV.concat %w[--readline --prompt-mode simple]
16
+
17
+ IRB.conf[:PROMPT_MODE] = :SIMPLE
18
+ IRB.conf[:EVAL_HISTORY] = 1000
19
+ IRB.conf[:SAVE_HISTORY] = 1000
20
+ IRB.conf[:HISTORY_FILE] = File.expand_path('.irbrc_history')
21
+
22
+ # Rails
23
+ railsrc_path = File.expand_path('.irbrc_rails')
24
+
25
+ if (ENV['RAILS_ENV'] || defined?(Rails)) && File.exist?(railsrc_path)
26
+ begin
27
+ load railsrc_path
28
+ rescue Exception => err
29
+ warn "Could not load: #{railsrc_path} because of #{err}"
30
+ end
31
+ end
32
+
33
+ # Object
34
+ class Object
35
+
36
+ def interesting_methods
37
+ case self.class
38
+ when Class then public_methods.sort - Object.public_methods
39
+ when Module then public_methods.sort - Module.public_methods
40
+ else public_methods.sort - Object.new.public_methods
41
+ end
42
+ end
43
+
44
+ end
data/.rubocop.yml CHANGED
@@ -12,6 +12,8 @@ Layout/EmptyLinesAroundModuleBody:
12
12
  Enabled: false
13
13
  LineLength:
14
14
  Max: 100
15
+ Lint/RescueException:
16
+ Enabled: false
15
17
  Metrics/ModuleLength:
16
18
  Enabled: false
17
19
  Style/Alias:
data/README.md CHANGED
@@ -953,6 +953,8 @@ h.slice!(:a, :b) #=> { c: 3, d: 4 }
953
953
 
954
954
  ```ruby
955
955
  4.divide(2) #=> 2
956
+ 0.divide(2) #=> 0
957
+ 4.divide(0) #=> 0
956
958
  ```
957
959
 
958
960
  **Exabytes in Bytes:**
@@ -151,6 +151,8 @@ module ActiveObject
151
151
  end
152
152
 
153
153
  def divide(num)
154
+ return 0 if num.zero?
155
+
154
156
  self / num
155
157
  end
156
158
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveObject
4
- VERSION ||= '5.5.2'
4
+ VERSION ||= '5.5.3'
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.5.2
4
+ version: 5.5.3
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-09-26 00:00:00.000000000 Z
11
+ date: 2018-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -118,6 +118,7 @@ files:
118
118
  - ".DS_Store"
119
119
  - ".fasterer.yml"
120
120
  - ".gitignore"
121
+ - ".irbrc"
121
122
  - ".reek.yml"
122
123
  - ".rspec"
123
124
  - ".rubocop.yml"