expressive_math 0.0.1 → 0.0.2

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: 362a7828b60254b804776a127186413de81c3414
4
- data.tar.gz: bb8a12c40146310b1d79edee5ece605cfd80debc
3
+ metadata.gz: b0371ab3a98d4cf60dc95ea5cf60a5a75a230c8e
4
+ data.tar.gz: 6cd3f6d9f21955a840279b711f0f88a802a6ce4f
5
5
  SHA512:
6
- metadata.gz: 236c0314ad63227b3e03d464c240885d748bc77eb69fc91dd524801f70ee61f0d860cfc48fc33fc59a36f49f57452b514b8998a53b8a50eb9f6a6f8a4ac0d362
7
- data.tar.gz: c441cc08829f880dcfa567635bec843ab7dd7a970914fb7b1b8c54dfddf39af220a1b93b76fe6312b5255dcb485654d1097140a7950376bc73017ea38ca8337a
6
+ metadata.gz: b304950b24581e95d96a73e4cac373534cfb7892bf19eb13b3a707d91431ab5ee5443ee3008b2f2e8f847d0142d3c2109dc7c9c00a8fcf6fad7ee0455500c790
7
+ data.tar.gz: 4779e39667962f17be472c80b2fab699db1195c151e9ae35d9825f22fe8b5988abcfa8c8db88ddb42fd2eef88ed9cbc09f0e2f505a44911529b5d1c567ffccaa
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # ExpressiveMath
2
2
 
3
- TODO: Write a gem description
3
+ For now this is just a collection of useful mathy methods as I have to use them in other projects...
4
4
 
5
5
  ## Installation
6
6
 
@@ -0,0 +1,14 @@
1
+ class Array
2
+ def total
3
+ if self.length > 0
4
+ return self[0] if self.length == 1
5
+ self.inject(0) { |number, total| total + number }
6
+ else
7
+ 0
8
+ end
9
+ end
10
+
11
+ def average
12
+ self.inject { |total, number| total + number }.to_f
13
+ end
14
+ end
@@ -0,0 +1,5 @@
1
+ class Fixnum
2
+ def percent
3
+ self.to_f / 100
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class Time
2
+ def age(origin_date)
3
+ Time.now.year - origin_date.year
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
1
  module ExpressiveMath
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: expressive_math
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nate West
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-29 00:00:00.000000000 Z
11
+ date: 2013-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,6 +52,9 @@ files:
52
52
  - Rakefile
53
53
  - expressive_math.gemspec
54
54
  - lib/expressive_math.rb
55
+ - lib/expressive_math/array.rb
56
+ - lib/expressive_math/fixnum.rb
57
+ - lib/expressive_math/time.rb
55
58
  - lib/expressive_math/version.rb
56
59
  homepage: https://github.com/drumsrgr8forn8/expressive_math
57
60
  licenses: