seconds 0.2 → 0.3

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.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/seconds.rb +15 -1
  3. metadata +23 -34
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: eca3946b1f0a3e0515bdbd673c8edf1ca117abb6
4
+ data.tar.gz: df9dff766ca03fcbe01d945473e83e1d27ebdd03
5
+ SHA512:
6
+ metadata.gz: 025cff2d0d49686d69f997cc7c9f23f6743ae91a8613e0fc156eea63aa6893bcd3150cf6dfa7919804e5ff08d1b23bfc4964773ce9c1ecac59e3c55e954bb43b
7
+ data.tar.gz: 094745a9c4302198cb6c042d664cddd59886f1cbeaae40b323dff9437912206394ceb2171ead02f76912d95f810724a7ef560599e9e2d63bcfafd92a0675ebfd
data/lib/seconds.rb CHANGED
@@ -79,6 +79,19 @@ Returns the number of seconds in +self+ months. Assumes a month is 28 days. Inte
79
79
  4*week
80
80
  end
81
81
 
82
+ =begin rdoc
83
+ Returns the number of seconds in +self+ years. Assumes a year is 365 days. Intended to be used with the +ago+ method.
84
+ Note that this doesn't account for leap years.
85
+
86
+ ---
87
+ 1.year
88
+ => 31536000
89
+ ---
90
+ =end
91
+ def year
92
+ 365*day
93
+ end
94
+
82
95
  =begin rdoc
83
96
  Returns a Time object +self+ seconds before Time.now.
84
97
 
@@ -132,5 +145,6 @@ in_an_hour = 1.hour.from_now
132
145
  alias :hours :hour
133
146
  alias :days :day
134
147
  alias :weeks :week
135
- alias :minutes :minute
148
+ alias :months :month
149
+ alias :years :year
136
150
  end
metadata CHANGED
@@ -1,58 +1,47 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: seconds
3
- version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: "0.2"
3
+ version: !ruby/object:Gem::Version
4
+ version: '0.3'
6
5
  platform: ruby
7
- authors:
6
+ authors:
8
7
  - Ethan Stryker
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
-
13
- date: 2012-03-23 00:00:00 +00:00
14
- default_executable:
11
+ date: 2015-12-10 00:00:00.000000000 Z
15
12
  dependencies: []
16
-
17
- description: " An extension of the Numeric class that provides Time object unit conversion similar to ActiveSupport's numeric extension.\n"
13
+ description: |2
14
+ An extension of the Numeric class that provides Time object unit conversion similar to ActiveSupport's numeric extension.
18
15
  email: e.stryker@gmail.com
19
16
  executables: []
20
-
21
17
  extensions: []
22
-
23
18
  extra_rdoc_files: []
24
-
25
- files:
26
- - lib/seconds.rb
27
- - README
19
+ files:
28
20
  - GPLv2-LICENSE
29
- has_rdoc: true
21
+ - README
22
+ - lib/seconds.rb
30
23
  homepage: http://seconds.rubyforge.org/
31
24
  licenses: []
32
-
25
+ metadata: {}
33
26
  post_install_message:
34
27
  rdoc_options: []
35
-
36
- require_paths:
28
+ require_paths:
37
29
  - lib
38
- required_ruby_version: !ruby/object:Gem::Requirement
39
- none: false
40
- requirements:
30
+ required_ruby_version: !ruby/object:Gem::Requirement
31
+ requirements:
41
32
  - - ">="
42
- - !ruby/object:Gem::Version
43
- version: "0"
44
- required_rubygems_version: !ruby/object:Gem::Requirement
45
- none: false
46
- requirements:
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ required_rubygems_version: !ruby/object:Gem::Requirement
36
+ requirements:
47
37
  - - ">="
48
- - !ruby/object:Gem::Version
49
- version: "0"
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
50
40
  requirements: []
51
-
52
41
  rubyforge_project: seconds
53
- rubygems_version: 1.6.2
42
+ rubygems_version: 2.2.2
54
43
  signing_key:
55
- specification_version: 3
44
+ specification_version: 4
56
45
  summary: An extension of the Numeric class that provides Time object unit conversion
57
46
  test_files: []
58
-
47
+ has_rdoc: true