flash_extensions 3.2.0 → 3.2.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
  SHA1:
3
- metadata.gz: 29bc0da7ad03da1d52f8eee6a230cf349c977bf7
4
- data.tar.gz: 4ff32a8160e43520e058d9376bcef76ee0718803
3
+ metadata.gz: 99dac26e58f923bbf2daa7719f51b61738fc45aa
4
+ data.tar.gz: 54be7232e912e4079654e4e5fd672b482b3b70aa
5
5
  SHA512:
6
- metadata.gz: f29027c054f49c5a80423aabb8c70bdd7f6b223a0b6565fcd4e2df10eba781b0f148106c907c0867923a57cd63acf350c01b604fbf1a8198f268e42848932faa
7
- data.tar.gz: 1e22b5d041b52897ec998a05ec5edec1c583a85cd8ffd95b43c62e38ee99794f7bfde795165165e3feca097e6951676a834dd2f41493aeacebb10de6291ad904
6
+ metadata.gz: c8427a50a81aac4ba4810d74de7a4dcf4bd37617a19c2b130292610a34a9a3ffa3dc3499574a5153d635d04a9c7cc326b73bf968d2aa75e019d1c2620ad15a56
7
+ data.tar.gz: 0cde6abc20782ed2a26f25ffa67e151ccaffe5eee403a0c6ccca028b2661e3a9306115618407197af5e277e1043e3f621cc5d1f46aaf7e3e2142116e75ab0871
@@ -111,7 +111,7 @@ module Enumerable
111
111
  end
112
112
 
113
113
  def standard_deviation
114
- return if length < 2
114
+ return 0 if length < 2
115
115
  Math.sqrt(variance)
116
116
  end
117
117
 
@@ -133,7 +133,7 @@ module Enumerable
133
133
  def variance
134
134
  collection_length = length
135
135
 
136
- return if collection_length < 1
136
+ return 0 if collection_length < 1
137
137
  sum = inject(0) { |accumulator, value| accumulator + (value - mean) ** 2 }
138
138
  sum / (collection_length.to_f - 1)
139
139
  end
@@ -1,3 +1,3 @@
1
1
  module FlashExtensions
2
- VERSION = "3.2.0"
2
+ VERSION = "3.2.1"
3
3
  end
@@ -164,11 +164,11 @@ describe Enumerable do
164
164
  end
165
165
 
166
166
  it 'to be nil for single element arrays' do
167
- expect([1].standard_deviation).to be_nil
167
+ expect([1].standard_deviation).to eq(0)
168
168
  end
169
169
 
170
170
  it 'to be nil if empty' do
171
- expect([].standard_deviation).to be_nil
171
+ expect([].standard_deviation).to eq(0)
172
172
  end
173
173
  end
174
174
 
@@ -212,7 +212,7 @@ describe Enumerable do
212
212
  end
213
213
 
214
214
  it 'to be nil if empty' do
215
- expect([].variance).to be_nil
215
+ expect([].variance).to eq(0)
216
216
  end
217
217
  end
218
218
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flash_extensions
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0
4
+ version: 3.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez