sixarm_ruby_date_age 1.1.0 → 1.1.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.
- checksums.yaml +7 -0
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/Rakefile +8 -4
- data/lib/sixarm_ruby_date_age.rb +12 -31
- data/test/sixarm_ruby_date_age_test.rb +150 -27
- metadata +155 -55
- metadata.gz.sig +0 -0
- data/.gemtest +0 -0
- data/INSTALL.txt +0 -32
- data/LICENSE.txt +0 -12
- data/README.rdoc +0 -24
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: b36fe4098f4d211986f0d355864c72b0c241688b
|
4
|
+
data.tar.gz: cb02002ba004786c1c3d082b69ca7b27c3f9913b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f400debf7d5ce597f8368d2d74c378eca3ef3b754e3bcf13bac5134d82fbde8f68cf9cb07b8b81afa2f2de9f5dd12318164a94decffa03c9418bb8fedc563983
|
7
|
+
data.tar.gz: 0ebe380dad2f6728ee9c00e7d812c7bf16bfcc29ed3d904792f42a514040c681a0a150d4d310ce2cd63dc54bf765ca4c88375e7506f1339338c5006995c6cae4
|
checksums.yaml.gz.sig
ADDED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/Rakefile
CHANGED
@@ -1,8 +1,12 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
-
require
|
3
|
-
require
|
2
|
+
require "rake"
|
3
|
+
require "rake/testtask"
|
4
4
|
|
5
5
|
Rake::TestTask.new(:test) do |t|
|
6
|
-
t.libs
|
7
|
-
t.pattern =
|
6
|
+
t.libs.push("lib", "test")
|
7
|
+
t.pattern = "test/**/*.rb"
|
8
8
|
end
|
9
|
+
|
10
|
+
task :default => [:test]
|
11
|
+
task :default => [:test]
|
12
|
+
task :default => [:test]
|
data/lib/sixarm_ruby_date_age.rb
CHANGED
@@ -1,29 +1,6 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
-
|
3
2
|
=begin rdoc
|
4
|
-
|
5
|
-
= SixArm.com » Ruby » Date #age_in_years and #age_in_days methods
|
6
|
-
|
7
|
-
Author:: Joel Parker Henderson, joelparkerhenderson@gmail.com
|
8
|
-
Copyright:: Copyright (c) 2006-2011 Joel Parker Henderson
|
9
|
-
License:: See LICENSE.txt file
|
10
|
-
|
11
|
-
Date extensions to calculate an age in days and years.
|
12
|
-
|
13
|
-
@example
|
14
|
-
|
15
|
-
date=Date.new(1980,10,31)
|
16
|
-
date.age_in_days => 11124
|
17
|
-
date.age_in_years => 31
|
18
|
-
|
19
|
-
@example of custom dates
|
20
|
-
|
21
|
-
date=Date.new(1980,10,31)
|
22
|
-
new_years_eve=(2011,12,31)
|
23
|
-
date.age_in_days_on(new_years_eve) => 11383
|
24
|
-
date.age_in_years_on(new_years_eve) => 31
|
25
|
-
|
26
|
-
|
3
|
+
Please see README
|
27
4
|
=end
|
28
5
|
|
29
6
|
|
@@ -50,9 +27,9 @@ class Date
|
|
50
27
|
# new_years_eve = Date.new(2011,12,31)
|
51
28
|
# date.age_in_days(new_years_eve) => 11383
|
52
29
|
|
53
|
-
def age_in_days(compare_date=Date.today)
|
30
|
+
def age_in_days(compare_date = Date.today)
|
54
31
|
(compare_date.is_a? Date) or raise ArgumentError, "compare_date must be a date"
|
55
|
-
(compare_date-self).to_i
|
32
|
+
(compare_date - self).to_i
|
56
33
|
end
|
57
34
|
|
58
35
|
alias :age_in_days_on :age_in_days
|
@@ -62,7 +39,10 @@ class Date
|
|
62
39
|
#
|
63
40
|
# @example
|
64
41
|
#
|
65
|
-
#
|
42
|
+
# y = Date.today.year
|
43
|
+
# m = Date.today.month
|
44
|
+
# d = Date.today.mday
|
45
|
+
# date = Date.new(y - 30, m, day)
|
66
46
|
# date.age_in_years => 30
|
67
47
|
#
|
68
48
|
# @example of custom dates
|
@@ -78,11 +58,12 @@ class Date
|
|
78
58
|
# new_years_eve = Date.new(2011,12,31)
|
79
59
|
# date.age_years(new_years_eve) => 31 # after the birthday is one year older
|
80
60
|
|
81
|
-
def age_in_years(compare_date=Date.today)
|
61
|
+
def age_in_years(compare_date = Date.today)
|
82
62
|
(compare_date.is_a? Date) or raise ArgumentError, "compare_date must be a date"
|
83
|
-
|
84
|
-
|
85
|
-
|
63
|
+
return 0 if self == compare_date
|
64
|
+
age = compare_date.year - self.year
|
65
|
+
min, max = [self, compare_date].sort
|
66
|
+
age -= 1 if max.month < min.month or (max.month == min.month and max.day < min.day)
|
86
67
|
age
|
87
68
|
end
|
88
69
|
|
@@ -1,43 +1,166 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
-
require
|
2
|
+
require "minitest/autorun"
|
3
|
+
Minitest::Test ||= MiniTest::Unit::TestCase
|
4
|
+
require "simplecov"
|
3
5
|
SimpleCov.start
|
4
|
-
require
|
5
|
-
require 'sixarm_ruby_date_age'
|
6
|
+
require "sixarm_ruby_date_age"
|
6
7
|
|
7
|
-
|
8
|
+
describe Date do
|
8
9
|
|
9
|
-
|
10
|
-
BIRTHDATE = Date.new(1980,10,31)
|
11
|
-
VALENTINES = Date.new(2011,02,14)
|
12
|
-
HALLOWEEN = Date.new(2011,10,31)
|
13
|
-
NEW_YEARS_EVE = Date.new(2011,12,31)
|
10
|
+
DATE = rand(Date.new(2000,01,01)...Date.new(2021,01,01))
|
14
11
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
12
|
+
describe "#age_in_days" do
|
13
|
+
|
14
|
+
it "returns the difference in days" do
|
15
|
+
days = rand(10..1000)
|
16
|
+
DATE.age_in_days(DATE + days).must_equal days
|
17
|
+
end
|
18
|
+
|
19
|
+
it "raises on a non-date" do
|
20
|
+
assert_raises(ArgumentError){ DATE.age_in_days('') }
|
21
|
+
end
|
22
|
+
|
19
23
|
end
|
24
|
+
|
25
|
+
describe "#age_in_days_on is an alias" do
|
26
|
+
|
27
|
+
it "is equal to calling #age_in_days" do
|
28
|
+
days = rand(10..1000)
|
29
|
+
DATE.age_in_days(DATE + days).must_equal DATE.age_in_days_on(DATE + days)
|
30
|
+
end
|
20
31
|
|
21
|
-
def test_age_in_days_with_non_date
|
22
|
-
assert_raise(ArgumentError){ BIRTHDATE.age_in_days('') }
|
23
32
|
end
|
24
33
|
|
25
|
-
|
26
|
-
assert_equal(BIRTHDATE.age_in_days(VALENTINES), BIRTHDATE.age_in_days_on(VALENTINES))
|
27
|
-
end
|
34
|
+
describe "#age_in_years" do
|
28
35
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
36
|
+
before do
|
37
|
+
# Pick a random date, but just month 2..11 and day 2..26
|
38
|
+
# because the tests will increment/decrement the month and/or day
|
39
|
+
@date = Date.new(rand(2000..2020), rand(02..11), rand(02..26))
|
40
|
+
@years = rand(10..100)
|
41
|
+
end
|
42
|
+
|
43
|
+
it "compares with earlier year, earlier month, earlier day #=> year diff - 1" do
|
44
|
+
@date.age_in_years(Date.new(@date.year - @years, @date.month - 1, @date.mday - 1)).must_equal (-@years)
|
45
|
+
end
|
46
|
+
|
47
|
+
it "compares with earlier year, earlier month, same day #=> year diff" do
|
48
|
+
@date.age_in_years(Date.new(@date.year - @years, @date.month - 1, @date.mday)).must_equal (-@years)
|
49
|
+
end
|
50
|
+
|
51
|
+
it "compares with earlier year, earlier month, later day #=> year diff - 1" do
|
52
|
+
@date.age_in_years(Date.new(@date.year - @years, @date.month - 1, @date.mday)).must_equal (-@years)
|
53
|
+
end
|
54
|
+
|
55
|
+
it "compares with earlier year, same month, earlier day #=> year diff - 1" do
|
56
|
+
@date.age_in_years(Date.new(@date.year - @years, @date.month, @date.mday - 1)).must_equal (-@years)
|
57
|
+
end
|
58
|
+
|
59
|
+
it "compares with earlier year, same month, same day #=> year diff" do
|
60
|
+
@date.age_in_years(Date.new(@date.year - @years, @date.month, @date.mday)).must_equal (-@years)
|
61
|
+
end
|
62
|
+
|
63
|
+
it "compares with earlier year, same month, later day #=> year diff" do
|
64
|
+
@date.age_in_years(Date.new(@date.year - @years, @date.month, @date.mday + 1)).must_equal (-@years - 1)
|
65
|
+
end
|
66
|
+
|
67
|
+
it "compares with earlier year, later month, earlier day #=> year diff" do
|
68
|
+
@date.age_in_years(Date.new(@date.year - @years, @date.month + 1, @date.mday - 1)).must_equal (-@years - 1)
|
69
|
+
end
|
70
|
+
|
71
|
+
it "compares with earlier year, later month, same day #=> year diff" do
|
72
|
+
@date.age_in_years(Date.new(@date.year - @years, @date.month + 1, @date.mday)).must_equal (-@years - 1)
|
73
|
+
end
|
74
|
+
|
75
|
+
it "compares with earlier year, later month, later day #=> year diff" do
|
76
|
+
@date.age_in_years(Date.new(@date.year - @years, @date.month + 1, @date.mday + 1)).must_equal (-@years - 1)
|
77
|
+
end
|
78
|
+
|
79
|
+
it "compares with same year, earlier month, earlier day #=> 0" do
|
80
|
+
@date.age_in_years(Date.new(@date.year, @date.month - 1, @date.mday - 1)).must_equal 0
|
81
|
+
end
|
82
|
+
|
83
|
+
it "compares with same year, earlier month, same day #=> 0" do
|
84
|
+
@date.age_in_years(Date.new(@date.year, @date.month - 1, @date.mday)).must_equal 0
|
85
|
+
end
|
86
|
+
|
87
|
+
it "compares with same year, earlier month, later day #=> 0" do
|
88
|
+
@date.age_in_years(Date.new(@date.year, @date.month - 1, @date.mday + 1)).must_equal 0
|
89
|
+
end
|
90
|
+
|
91
|
+
it "compares with same year, same month, earlier day #=> 0" do
|
92
|
+
@date.age_in_years(Date.new(@date.year, @date.month, @date.mday - 1)).must_equal 0
|
93
|
+
end
|
94
|
+
|
95
|
+
it "compares with same year, same month, same day #=> 0" do
|
96
|
+
@date.age_in_years(Date.new(@date.year, @date.month, @date.mday)).must_equal 0
|
97
|
+
end
|
98
|
+
|
99
|
+
it "compares with same year, same month, later day #=> 0" do
|
100
|
+
@date.age_in_years(Date.new(@date.year, @date.month, @date.mday)).must_equal 0
|
101
|
+
end
|
34
102
|
|
35
|
-
|
36
|
-
|
103
|
+
it "compares with same year, later month, earlier day #=> 0" do
|
104
|
+
@date.age_in_years(Date.new(@date.year, @date.month + 1, @date.mday - 1)).must_equal 0
|
105
|
+
end
|
106
|
+
|
107
|
+
it "compares with same year, later month, same day #=> 0" do
|
108
|
+
@date.age_in_years(Date.new(@date.year, @date.month + 1, @date.mday)).must_equal 0
|
109
|
+
end
|
110
|
+
|
111
|
+
it "compares with same year, later month, later day #=> 0" do
|
112
|
+
@date.age_in_years(Date.new(@date.year, @date.month + 1, @date.mday + 1)).must_equal 0
|
113
|
+
end
|
114
|
+
|
115
|
+
it "compares with later year, earlier month, earlier day #=> year diff - 1" do
|
116
|
+
@date.age_in_years(Date.new(@date.year + @years, @date.month - 1, @date.mday - 1)).must_equal (@years - 1)
|
117
|
+
end
|
118
|
+
|
119
|
+
it "compares with later year, earlier month, same day #=> year diff - 1" do
|
120
|
+
@date.age_in_years(Date.new(@date.year + @years, @date.month - 1, @date.mday)).must_equal (@years - 1)
|
121
|
+
end
|
122
|
+
|
123
|
+
it "compares with later year, earlier month, later day #=> year diff - 1" do
|
124
|
+
@date.age_in_years(Date.new(@date.year + @years, @date.month - 1, @date.mday)).must_equal (@years - 1)
|
125
|
+
end
|
126
|
+
|
127
|
+
it "compares with later year, same month, earlier day #=> year diff - 1" do
|
128
|
+
@date.age_in_years(Date.new(@date.year + @years, @date.month, @date.mday - 1)).must_equal (@years - 1)
|
129
|
+
end
|
130
|
+
|
131
|
+
it "compares with later year, same month, same day #=> year diff" do
|
132
|
+
@date.age_in_years(Date.new(@date.year + @years, @date.month, @date.mday)).must_equal @years
|
133
|
+
end
|
134
|
+
|
135
|
+
it "compares with later year, same month, later day #=> year diff" do
|
136
|
+
@date.age_in_years(Date.new(@date.year + @years, @date.month, @date.mday)).must_equal @years
|
137
|
+
end
|
138
|
+
|
139
|
+
it "compares with later year, later month, earlier day #=> year diff" do
|
140
|
+
@date.age_in_years(Date.new(@date.year + @years, @date.month + 1, @date.mday - 1)).must_equal @years
|
141
|
+
end
|
142
|
+
|
143
|
+
it "compares with later year, later month, same day #=> year diff" do
|
144
|
+
@date.age_in_years(Date.new(@date.year + @years, @date.month + 1, @date.mday)).must_equal @years
|
145
|
+
end
|
146
|
+
|
147
|
+
it "compares with later year, later month, later day #=> year diff" do
|
148
|
+
@date.age_in_years(Date.new(@date.year + @years, @date.month + 1, @date.mday + 1)).must_equal @years
|
149
|
+
end
|
150
|
+
|
151
|
+
it "raises on a non-date" do
|
152
|
+
assert_raises(ArgumentError){ DATE.age_in_years('') }
|
153
|
+
end
|
154
|
+
|
37
155
|
end
|
38
156
|
|
39
|
-
|
40
|
-
|
157
|
+
describe "#age_in_years_on is an alias" do
|
158
|
+
|
159
|
+
it "is equal to calling #age_in_years" do
|
160
|
+
x = rand(10..100)
|
161
|
+
DATE.age_in_years(DATE + x).must_equal DATE.age_in_years_on(DATE + x)
|
162
|
+
end
|
163
|
+
|
41
164
|
end
|
42
165
|
|
43
166
|
end
|
metadata
CHANGED
@@ -1,82 +1,182 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: sixarm_ruby_date_age
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
version: 1.1.0
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.1.3
|
6
5
|
platform: ruby
|
7
|
-
authors:
|
6
|
+
authors:
|
8
7
|
- SixArm
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
|
-
cert_chain:
|
10
|
+
cert_chain:
|
12
11
|
- |
|
13
12
|
-----BEGIN CERTIFICATE-----
|
14
|
-
|
13
|
+
MIIGCTCCA/GgAwIBAgIJAK3igyLv2hNNMA0GCSqGSIb3DQEBBQUAMGAxCzAJBgNV
|
15
14
|
BAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1TYW4gRnJhbmNp
|
16
|
-
|
17
|
-
|
15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jhzh
|
43
|
+
w2grAHIhvR9mztm6uXQlZhv1fu3P+RWHDSYhnZSCJSCdxPzQJ1mG5T5ahiL3HvCZ
|
44
|
+
2AC9FOGkybW6DJEFSFFMlNk0IILsa/gNp8ufGuTVLWF9FUUdMNK+TMbghnifT8/1
|
45
|
+
n+ES/gQPOnvmVkLDGw==
|
31
46
|
-----END CERTIFICATE-----
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
47
|
+
date: 2017-08-13 00:00:00.000000000 Z
|
48
|
+
dependencies:
|
49
|
+
- !ruby/object:Gem::Dependency
|
50
|
+
name: minitest
|
51
|
+
requirement: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: 5.7.0
|
56
|
+
- - "<"
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: '6'
|
59
|
+
type: :development
|
60
|
+
prerelease: false
|
61
|
+
version_requirements: !ruby/object:Gem::Requirement
|
62
|
+
requirements:
|
63
|
+
- - ">="
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: 5.7.0
|
66
|
+
- - "<"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '6'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: sixarm_ruby_minitest_extensions
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 1.0.5
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 1.0.5
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rake
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 10.4.2
|
90
|
+
- - "<"
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: '11'
|
93
|
+
type: :development
|
94
|
+
prerelease: false
|
95
|
+
version_requirements: !ruby/object:Gem::Requirement
|
96
|
+
requirements:
|
97
|
+
- - ">"
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: 10.4.2
|
100
|
+
- - "<"
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '11'
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: simplecov
|
105
|
+
requirement: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - ">="
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: 0.10.0
|
110
|
+
- - "<"
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
version: '2'
|
113
|
+
type: :development
|
114
|
+
prerelease: false
|
115
|
+
version_requirements: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
117
|
+
- - ">="
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: 0.10.0
|
120
|
+
- - "<"
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
version: '2'
|
123
|
+
- !ruby/object:Gem::Dependency
|
124
|
+
name: coveralls
|
125
|
+
requirement: !ruby/object:Gem::Requirement
|
126
|
+
requirements:
|
127
|
+
- - ">="
|
128
|
+
- !ruby/object:Gem::Version
|
129
|
+
version: 0.8.2
|
130
|
+
- - "<"
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: '2'
|
133
|
+
type: :development
|
134
|
+
prerelease: false
|
135
|
+
version_requirements: !ruby/object:Gem::Requirement
|
136
|
+
requirements:
|
137
|
+
- - ">="
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: 0.8.2
|
140
|
+
- - "<"
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
version: '2'
|
143
|
+
description: 'Provide Date #age_in_days, #age_in_years'
|
38
144
|
email: sixarm@sixarm.com
|
39
145
|
executables: []
|
40
|
-
|
41
146
|
extensions: []
|
42
|
-
|
43
147
|
extra_rdoc_files: []
|
44
|
-
|
45
|
-
files:
|
46
|
-
- .gemtest
|
148
|
+
files:
|
47
149
|
- Rakefile
|
48
|
-
- README.rdoc
|
49
|
-
- INSTALL.txt
|
50
|
-
- LICENSE.txt
|
51
150
|
- lib/sixarm_ruby_date_age.rb
|
52
151
|
- test/sixarm_ruby_date_age_test.rb
|
53
|
-
has_rdoc: true
|
54
152
|
homepage: http://sixarm.com/
|
55
|
-
licenses:
|
56
|
-
|
153
|
+
licenses:
|
154
|
+
- Apache-2.0
|
155
|
+
- Artistic-2.0
|
156
|
+
- BSD-3-Clause
|
157
|
+
- GPL-3.0
|
158
|
+
- MIT
|
159
|
+
- MPL-2.0
|
160
|
+
metadata: {}
|
57
161
|
post_install_message:
|
58
162
|
rdoc_options: []
|
59
|
-
|
60
|
-
require_paths:
|
163
|
+
require_paths:
|
61
164
|
- lib
|
62
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
63
|
-
|
64
|
-
requirements:
|
165
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
166
|
+
requirements:
|
65
167
|
- - ">="
|
66
|
-
- !ruby/object:Gem::Version
|
67
|
-
version:
|
68
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
69
|
-
|
70
|
-
requirements:
|
168
|
+
- !ruby/object:Gem::Version
|
169
|
+
version: '0'
|
170
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
171
|
+
requirements:
|
71
172
|
- - ">="
|
72
|
-
- !ruby/object:Gem::Version
|
73
|
-
version:
|
173
|
+
- !ruby/object:Gem::Version
|
174
|
+
version: '0'
|
74
175
|
requirements: []
|
75
|
-
|
76
176
|
rubyforge_project:
|
77
|
-
rubygems_version:
|
177
|
+
rubygems_version: 2.6.12
|
78
178
|
signing_key:
|
79
|
-
specification_version:
|
80
|
-
summary:
|
81
|
-
test_files:
|
179
|
+
specification_version: 4
|
180
|
+
summary: SixArm.com → Ruby → Date age methods
|
181
|
+
test_files:
|
82
182
|
- test/sixarm_ruby_date_age_test.rb
|
metadata.gz.sig
CHANGED
Binary file
|
data/.gemtest
DELETED
File without changes
|
data/INSTALL.txt
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
|
2
|
-
= SixArm.com Ruby Gem Install
|
3
|
-
|
4
|
-
|
5
|
-
First-time users: add our gem certificate and source.
|
6
|
-
When you do this once, it works for all our gems.
|
7
|
-
|
8
|
-
sudo wget http://sixarm.com/sixarm.pem
|
9
|
-
sudo gem cert --add sixarm.pem
|
10
|
-
sudo gem sources --add http://sixarm.com
|
11
|
-
|
12
|
-
Install the gem with advanced options.
|
13
|
-
|
14
|
-
sudo gem install sixarm_ruby_date_age --test --trust-policy HighSecurity
|
15
|
-
|
16
|
-
|
17
|
-
== Notes
|
18
|
-
|
19
|
-
Do you have any questions, comments, suggestions, or feedback?
|
20
|
-
Let us know, we're happy to help. Our email is sixarm@sixarm.com
|
21
|
-
|
22
|
-
Do you want to create your own high security gems?
|
23
|
-
Learn how at http://www.rubygems.org/read/chapter/21
|
24
|
-
|
25
|
-
To see your current gem certificate list:
|
26
|
-
|
27
|
-
sudo gem cert --list
|
28
|
-
|
29
|
-
Our cert looks like this:
|
30
|
-
|
31
|
-
/C=US/ST=California/L=San Francisco/O=SixArm/CN=sixarm.com
|
32
|
-
|
data/LICENSE.txt
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
LICENSE
|
2
|
-
|
3
|
-
You may choose any of these licenses:
|
4
|
-
|
5
|
-
- CreativeCommons License, Non-commercial Share Alike
|
6
|
-
- LGPL, GNU Lesser General Public License
|
7
|
-
- MIT License
|
8
|
-
- Ruby License
|
9
|
-
|
10
|
-
THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
|
11
|
-
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
12
|
-
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
data/README.rdoc
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
= SixArm.com » Ruby » Date #age_in_years and #age_in_days methods
|
4
|
-
|
5
|
-
Author:: Joel Parker Henderson, joelparkerhenderson@gmail.com
|
6
|
-
Copyright:: Copyright (c) 2006-2011 Joel Parker Henderson
|
7
|
-
License:: See LICENSE.txt file
|
8
|
-
|
9
|
-
Date extensions to calculate an age in days and years.
|
10
|
-
|
11
|
-
@example
|
12
|
-
|
13
|
-
date=Date.new(1980,10,31)
|
14
|
-
date.age_in_days => 11124
|
15
|
-
date.age_in_years => 31
|
16
|
-
|
17
|
-
@example of custom dates
|
18
|
-
|
19
|
-
date=Date.new(1980,10,31)
|
20
|
-
new_years_eve=(2011,12,31)
|
21
|
-
date.age_in_days_on(new_years_eve) => 11383
|
22
|
-
date.age_in_years_on(new_years_eve) => 31
|
23
|
-
|
24
|
-
|