darthjee-core_ext 1.7.2 → 1.7.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/darthjee/core_ext/array.rb +4 -0
- data/lib/darthjee/core_ext/version.rb +1 -1
- data/spec/integration/yard/array_spec.rb +4 -0
- data/spec/lib/array_spec.rb +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75f22a94cfe27dfcc43f9209d7684ee7cef8546c
|
4
|
+
data.tar.gz: 7077d45122b6498b960f459c5fda5c9965138902
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df8e4a2c6c6a6b27611d9ba1d52785323239ec7df2a9239862a1116db897b4112a875d6d279f1a507c7906615247d88375198a9e921e33d9272c6e76d8e46d4c
|
7
|
+
data.tar.gz: a71629faafba5302d768e80c556d5deec6249e9a09b14f1a3fd7457e97edf4d14bcd075ca89b89d0c9a2110e2dfcf6e6b86ea3540c43ad334c5e50de1da70b8b
|
data/README.md
CHANGED
@@ -28,7 +28,11 @@ module Darthjee
|
|
28
28
|
# @example Average of array of integer values
|
29
29
|
# array = [1, 2, 3, 4]
|
30
30
|
# array.average # returns 2.5
|
31
|
+
#
|
32
|
+
# @example An empty array
|
33
|
+
# [].average # returns 0
|
31
34
|
def average
|
35
|
+
return 0 if empty?
|
32
36
|
sum * 1.0 / length
|
33
37
|
end
|
34
38
|
|
data/spec/lib/array_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: darthjee-core_ext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Darthjee
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|