descriptive_statistics 2.4.0 → 2.5.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
  SHA1:
3
- metadata.gz: e28f48a7fc39460fc375049b65f79956f52cec0b
4
- data.tar.gz: 71570533e928cc63aaab9afbf7b16d02930b13d0
3
+ metadata.gz: 0149d80d96352eeef4100cc6e491f495c4ee8e47
4
+ data.tar.gz: e2aaaeaa80b8694aaa8dc4a1eebc8dfd2dbe736e
5
5
  SHA512:
6
- metadata.gz: 4c95bbdcfc03c5a90a70a0b165a38cc12f42601c6a4b4202ade3adf5793e87359a7f1acc975c7c89d4bbec9076b860cff29fa1f7d10eac2ca930c23eb4895205
7
- data.tar.gz: 0c4f66b5cb53468b89f0d6d88c7214ce4f295adf0f4dd3d9cc96f0ccc583df684a1f1b84b476992c3dd6a88bcf0b4ff580f738bbbdd286ff9bc1e68bf5c81bce
6
+ metadata.gz: c9167786bbbd8ea1ff330abd7f35b2f1c73de5343963818423447eb86a512cb421a01eb030f98e781eb2575345bc4c92b1aae8a831a7a992ab7d2c155e0d6dfa
7
+ data.tar.gz: 1e2ac15a981f485213ad688f44afab96874ea8778cdbda37b3ac2a8d9aceb48c4c0825fdff99d47b1953121fc2d4d10471fcf306df236c32fdc251a9f3d09794
@@ -1,11 +1,8 @@
1
1
  module Enumerable
2
- include DescriptiveStatistics
3
2
 
4
- # This is necessary because otherwise objects which
5
- # have already included Enumerable (such as Array) won't
6
- # be able to access DescriptiveStatistics's methods.
7
- # It is an evil hack though :-/
8
- DescriptiveStatistics.instance_methods.each do |m|
9
- define_method(m, DescriptiveStatistics.instance_method(m))
3
+ DescriptiveStatistics.instance_methods.each do |name|
4
+ method = DescriptiveStatistics.instance_method(name)
5
+ define_method(name, method)
10
6
  end
7
+
11
8
  end
@@ -0,0 +1,33 @@
1
+ require "descriptive_statistics/safe"
2
+
3
+ module DescriptiveStatistics
4
+
5
+ module Refinement
6
+
7
+ def self.new(*klasses)
8
+ refinement_module = Module.new
9
+
10
+ klasses.each do |klass|
11
+
12
+ refinement_module.instance_eval do
13
+
14
+ refine klass do
15
+
16
+ DescriptiveStatistics.instance_methods.each do |name|
17
+ method = DescriptiveStatistics.instance_method(name)
18
+ define_method(name, method)
19
+ end
20
+
21
+ end
22
+
23
+ end
24
+
25
+ end
26
+
27
+ return refinement_module
28
+
29
+ end
30
+
31
+ end
32
+
33
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: descriptive_statistics
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Derrick Parkhurst
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2014-11-15 00:00:00.000000000 Z
16
+ date: 2014-12-18 00:00:00.000000000 Z
17
17
  dependencies: []
18
18
  description: Adds descriptive statistics methods to Enumerable module for use on collections
19
19
  or Numeric data
@@ -33,6 +33,7 @@ files:
33
33
  - lib/descriptive_statistics/percentile.rb
34
34
  - lib/descriptive_statistics/percentile_rank.rb
35
35
  - lib/descriptive_statistics/range.rb
36
+ - lib/descriptive_statistics/refinement.rb
36
37
  - lib/descriptive_statistics/safe.rb
37
38
  - lib/descriptive_statistics/standard_deviation.rb
38
39
  - lib/descriptive_statistics/stats.rb