mean 0.0.3 → 0.1.0
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.
- data/History.txt +5 -1
- data/README.rdoc +35 -17
- data/lib/mean.rb +1 -1
- metadata +1 -1
data/History.txt
CHANGED
data/README.rdoc
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
Monkeypatches Ruby's Array Class to add "sum" and "mean" methods.
|
8
8
|
|
9
|
-
== FEATURES
|
9
|
+
== FEATURES:
|
10
10
|
|
11
11
|
* Find the mean of an array of integers
|
12
12
|
|
@@ -16,13 +16,31 @@ Monkeypatches Ruby's Array Class to add "sum" and "mean" methods.
|
|
16
16
|
|
17
17
|
== SYNOPSIS:
|
18
18
|
|
19
|
-
|
20
|
-
|
19
|
+
$ python
|
20
|
+
>>> sum((1, 2, 3))
|
21
|
+
6
|
21
22
|
|
22
|
-
|
23
|
+
Hmm...
|
23
24
|
|
24
|
-
|
25
|
+
$ irb
|
26
|
+
>> [1, 2, 3].sum
|
27
|
+
=> NoMethodError: undefined method `sum' for [1, 2, 3]:Array
|
28
|
+
|
29
|
+
:-( :-( :-( :-(
|
30
|
+
|
31
|
+
Hmm...
|
32
|
+
|
33
|
+
>> require 'rubygems'
|
34
|
+
>> require 'mean'
|
35
|
+
>> [1, 2, 3].sum
|
25
36
|
=> 6
|
37
|
+
|
38
|
+
:-) :-) :-) :-)
|
39
|
+
|
40
|
+
$ [1, 2, 3].mean
|
41
|
+
=> 2
|
42
|
+
|
43
|
+
:-D :-D :-D :-D !!!
|
26
44
|
|
27
45
|
== INSTALL:
|
28
46
|
|
@@ -30,20 +48,20 @@ sudo gem install mean
|
|
30
48
|
|
31
49
|
== LICENSE:
|
32
50
|
|
33
|
-
|
51
|
+
(The WTFPL License)
|
34
52
|
|
35
|
-
|
53
|
+
Copyright (c) 2009 Bryan Woods
|
36
54
|
|
37
|
-
|
38
|
-
|
55
|
+
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
56
|
+
Version 2, December 2004
|
39
57
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
58
|
+
Copyright (C) 2004 Sam Hocevar
|
59
|
+
14 rue de Plaisance, 75014 Paris, France
|
60
|
+
Everyone is permitted to copy and distribute verbatim or modified
|
61
|
+
copies of this license document, and changing it is allowed as long
|
62
|
+
as the name is changed.
|
45
63
|
|
46
|
-
|
47
|
-
|
64
|
+
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
65
|
+
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
48
66
|
|
49
|
-
|
67
|
+
0. You just DO WHAT THE FUCK YOU WANT TO.
|
data/lib/mean.rb
CHANGED