booster-time_parser 0.0.5.1 → 0.0.6

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.
@@ -1,25 +1,35 @@
1
- class Float
2
- def to_seconds
3
- self
4
- end
1
+ module TimeParser
2
+ module CoreExt
3
+ def to_seconds
4
+ self
5
+ end
5
6
 
6
- def to_minutes
7
- self / 60.0
8
- end
7
+ def to_minutes
8
+ self / 60.0
9
+ end
9
10
 
10
- def to_hours
11
- self / 3600.0
12
- end
11
+ def to_hours
12
+ self / 3600.0
13
+ end
13
14
 
14
- def to_days
15
- self / 86_400
16
- end
15
+ def to_days
16
+ self / 86_400.0
17
+ end
17
18
 
18
- def to_weeks
19
- self / 604_800
19
+ def to_weeks
20
+ self / 604_800.0
21
+ end
20
22
  end
21
23
  end
22
24
 
25
+ class Float
26
+ include TimeParser::CoreExt
27
+ end
28
+
29
+ class Fixnum
30
+ include TimeParser::CoreExt
31
+ end
32
+
23
33
  class String
24
34
  def to_seconds
25
35
  TimeParser.parse(self)
data/lib/time_parser.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'time_parser/core_ext'
2
2
 
3
3
  module TimeParser
4
- VERSION = '0.0.5.1'
4
+ VERSION = '0.0.6'
5
5
 
6
6
  MULTIPLIERS = [['seconds', 1],
7
7
  ['minutes', 60],
data/time_parser.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{time_parser}
5
- s.version = "0.0.5.1"
5
+ s.version = "0.0.6"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Cameron Cox"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: booster-time_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5.1
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cameron Cox