date_time_precision 0.7.1 → 0.7.2
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 -7
- data/.travis.yml +3 -0
- data/Appraisals +11 -0
- data/Gemfile +1 -1
- data/README.md +1 -1
- data/Rakefile +3 -1
- data/date_time_precision.gemspec +1 -0
- data/gemfiles/activesupport2.gemfile +4 -7
- data/gemfiles/activesupport3.gemfile +4 -7
- data/gemfiles/activesupport4.gemfile +4 -7
- data/lib/date_time_precision/format/string.rb +1 -0
- data/lib/date_time_precision/version.rb +1 -1
- data/spec/active_support_spec.rb +28 -28
- data/spec/compatibility_spec.rb +106 -26
- data/spec/date_time_precision_spec.rb +67 -67
- data/spec/format_spec.rb +52 -52
- metadata +109 -68
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
5
|
-
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: cfd81b7cf64c7f1cde510e2b5a8224758bb9bdf7
|
4
|
+
data.tar.gz: bd625c14c4ba483ddf55210ebdc2785b0618c2fe
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 0447b421ed938b6d15662d9800f8475c25e6879afd67f488ab03d7b57a2f1f7bc17be88823417c675bb026fb58923c691573bd51e034a346c2751fe0ac677b86
|
7
|
+
data.tar.gz: a97c3006ba3a3f22e165025eb2cde9ed9b4358fb8cb2003003cb3d14b07197f858206f99e8b756fb0914137b9e6246379f6be32cbfc1c33db46c6ac4affb23f9
|
data/.travis.yml
CHANGED
@@ -7,6 +7,7 @@ rvm:
|
|
7
7
|
- 2.1.0
|
8
8
|
- 2.1.1
|
9
9
|
- 2.1.2
|
10
|
+
- 2.1.3
|
10
11
|
- jruby-18mode
|
11
12
|
- jruby-19mode
|
12
13
|
- rbx-2
|
@@ -28,6 +29,8 @@ matrix:
|
|
28
29
|
gemfile: gemfiles/activesupport2.gemfile
|
29
30
|
- rvm: 2.1.2
|
30
31
|
gemfile: gemfiles/activesupport2.gemfile
|
32
|
+
- rvm: 2.1.3
|
33
|
+
gemfile: gemfiles/activesupport2.gemfile
|
31
34
|
- rvm: jruby-19mode
|
32
35
|
gemfile: gemfiles/activesupport2.gemfile
|
33
36
|
- rvm: rbx-2
|
data/Appraisals
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
appraise "activesupport2" do
|
2
|
+
gem 'activesupport', '~> 2.3', :require => false
|
3
|
+
end
|
4
|
+
|
5
|
+
appraise "activesupport3" do
|
6
|
+
gem 'activesupport', '~> 3.2', :require => false
|
7
|
+
end
|
8
|
+
|
9
|
+
appraise "activesupport4" do
|
10
|
+
gem 'activesupport', '~> 4', :require => false
|
11
|
+
end
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -112,7 +112,7 @@ Time.iso8601("2000-05").precision
|
|
112
112
|
|
113
113
|
## Ruby Compatibility
|
114
114
|
|
115
|
-
Tested in MRI 1.8.7/1.9.2/1.9.3/2.0.0/2.1.
|
115
|
+
Tested in MRI 1.8.7/1.9.2/1.9.3/2.0.0/2.1.x, REE, JRuby 1.8/1.9, and Rubinius 1.8/1.9.
|
116
116
|
|
117
117
|
Note that starting in MRI 1.9.3, the core Date/Time classes were rewritten in C, making it difficult to
|
118
118
|
override internal functionality. Some functions are now implemented internally and are not exposed.
|
data/Rakefile
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
#!/usr/bin/env rake
|
2
|
+
require "rubygems"
|
3
|
+
require "bundler/setup"
|
2
4
|
require "bundler/gem_tasks"
|
3
5
|
|
4
6
|
Dir['gem_tasks/**/*.rake'].each { |rake| load rake }
|
5
7
|
|
6
|
-
task :default => [:spec, 'spec:format', 'spec:active_support', 'spec:compatibility']
|
8
|
+
task :default => [:spec, 'spec:format', 'spec:active_support', 'spec:compatibility']
|
data/date_time_precision.gemspec
CHANGED
@@ -1,10 +1,7 @@
|
|
1
|
-
|
1
|
+
# This file was generated by Appraisal
|
2
2
|
|
3
|
-
|
4
|
-
gem 'rspec'
|
3
|
+
source "https://rubygems.org"
|
5
4
|
|
6
|
-
gem
|
5
|
+
gem "activesupport", "~> 2.3", :require => false
|
7
6
|
|
8
|
-
|
9
|
-
gem 'virtus', '0.5.4'
|
10
|
-
gem 'coercible', '0.0.1'
|
7
|
+
gemspec :path => "../"
|
@@ -1,10 +1,7 @@
|
|
1
|
-
|
1
|
+
# This file was generated by Appraisal
|
2
2
|
|
3
|
-
|
4
|
-
gem 'rspec'
|
3
|
+
source "https://rubygems.org"
|
5
4
|
|
6
|
-
gem
|
5
|
+
gem "activesupport", "~> 3.2", :require => false
|
7
6
|
|
8
|
-
|
9
|
-
gem 'virtus', '0.5.4'
|
10
|
-
gem 'coercible', '0.0.1'
|
7
|
+
gemspec :path => "../"
|
@@ -1,10 +1,7 @@
|
|
1
|
-
|
1
|
+
# This file was generated by Appraisal
|
2
2
|
|
3
|
-
|
4
|
-
gem 'rspec'
|
3
|
+
source "https://rubygems.org"
|
5
4
|
|
6
|
-
gem
|
5
|
+
gem "activesupport", "~> 4", :require => false
|
7
6
|
|
8
|
-
|
9
|
-
gem 'virtus', '0.5.4'
|
10
|
-
gem 'coercible', '0.0.1'
|
7
|
+
gemspec :path => "../"
|
data/spec/active_support_spec.rb
CHANGED
@@ -11,62 +11,62 @@ describe DateTimePrecision, 'Conversions' do
|
|
11
11
|
context 'when converting from Date to Time or DateTime' do
|
12
12
|
it 'maintains precision' do
|
13
13
|
d = Date.new(2005, 1)
|
14
|
-
d.precision.
|
15
|
-
d.to_date.precision.
|
16
|
-
d.to_datetime.precision.
|
14
|
+
expect(d.precision).to eq(DateTimePrecision::MONTH)
|
15
|
+
expect(d.to_date.precision).to eq(DateTimePrecision::MONTH)
|
16
|
+
expect(d.to_datetime.precision).to eq(DateTimePrecision::MONTH)
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
20
|
it 'loses precision when converting from DateTime or Time to Date' do
|
21
21
|
t = Time::parse('2000-1-1 00:00:00 EST') # => Fri Dec 31 21:00:00 -0800 1999
|
22
|
-
t.precision.
|
23
|
-
t.to_datetime.precision.
|
24
|
-
t.to_date.precision.
|
22
|
+
expect(t.precision).to eq(DateTimePrecision::SEC)
|
23
|
+
expect(t.to_datetime.precision).to eq(DateTimePrecision::SEC)
|
24
|
+
expect(t.to_date.precision).to eq(DateTimePrecision::DAY)
|
25
25
|
end
|
26
26
|
|
27
27
|
it 'converts a date to a hash' do
|
28
28
|
date = Date.new(1999, 10)
|
29
|
-
date.as_json.
|
29
|
+
expect(date.as_json).to eq(date.to_h)
|
30
30
|
end
|
31
31
|
|
32
32
|
it 'retains precision when converting to and from JSON' do
|
33
33
|
date = Date.new(1999, 10)
|
34
|
-
date.precision.
|
34
|
+
expect(date.precision).to eq(DateTimePrecision::MONTH)
|
35
35
|
json = ActiveSupport::JSON.encode(date)
|
36
36
|
|
37
37
|
date_from_json = ActiveSupport::JSON.decode(json).to_date
|
38
|
-
date_from_json.precision.
|
38
|
+
expect(date_from_json.precision).to eq(date.precision)
|
39
39
|
end
|
40
40
|
|
41
41
|
context 'when formatting as a string' do
|
42
42
|
require 'date_time_precision/format/string'
|
43
43
|
|
44
44
|
it 'takes precision into account for the :long format' do
|
45
|
-
Date.new(2000).to_s(:long).
|
46
|
-
Date.new(2000, 8).to_s(:long).
|
47
|
-
Date.new(2000, 3, 9).to_s(:long).
|
48
|
-
Date.new(nil, 5, 13).to_s(:long).
|
49
|
-
Date.new(nil, 6).to_s(:long).
|
45
|
+
expect(Date.new(2000).to_s(:long)).to eq("2000")
|
46
|
+
expect(Date.new(2000, 8).to_s(:long)).to eq("August 2000")
|
47
|
+
expect(Date.new(2000, 3, 9).to_s(:long)).to eq("March 9, 2000")
|
48
|
+
expect(Date.new(nil, 5, 13).to_s(:long)).to eq("May 13")
|
49
|
+
expect(Date.new(nil, 6).to_s(:long)).to eq("June")
|
50
50
|
|
51
|
-
DateTime.new(1800).to_s(:long).
|
52
|
-
DateTime.new(1990, 8).to_s(:long).
|
53
|
-
DateTime.new(-50, 3, 9).to_s(:long).
|
54
|
-
DateTime.new(2004, 7, 8, 10).to_s(:long).
|
55
|
-
DateTime.new(2004, 7, 8, 10, 5).to_s(:long).
|
56
|
-
DateTime.new(nil, 5, 13).to_s(:long).
|
57
|
-
DateTime.new(nil, 6).to_s(:long).
|
51
|
+
expect(DateTime.new(1800).to_s(:long)).to eq("1800")
|
52
|
+
expect(DateTime.new(1990, 8).to_s(:long)).to eq("August 1990")
|
53
|
+
expect(DateTime.new(-50, 3, 9).to_s(:long)).to eq("March 09, -0050")
|
54
|
+
expect(DateTime.new(2004, 7, 8, 10).to_s(:long)).to eq("July 08, 2004")
|
55
|
+
expect(DateTime.new(2004, 7, 8, 10, 5).to_s(:long)).to eq("July 08, 2004 10:05")
|
56
|
+
expect(DateTime.new(nil, 5, 13).to_s(:long)).to eq("May 13")
|
57
|
+
expect(DateTime.new(nil, 6).to_s(:long)).to eq("June")
|
58
58
|
|
59
|
-
Time.mktime(1800).to_s(:long).
|
60
|
-
Time.mktime(1990, 8).to_s(:long).
|
59
|
+
expect(Time.mktime(1800).to_s(:long)).to eq("1800")
|
60
|
+
expect(Time.mktime(1990, 8).to_s(:long)).to eq("August 1990")
|
61
61
|
|
62
62
|
# Every Ruby seems to have a different idea about how to format this exactly
|
63
|
-
Time.mktime(-50, 3, 9).to_s(:long).
|
63
|
+
expect(Time.mktime(-50, 3, 9).to_s(:long)).to match /^March 09, 0*\-0*50$/
|
64
64
|
|
65
|
-
Time.mktime(2004, 7, 8, 10).to_s(:long).
|
66
|
-
Time.mktime(2004, 7, 8, 10, 5).to_s(:long).
|
65
|
+
expect(Time.mktime(2004, 7, 8, 10).to_s(:long)).to eq("July 08, 2004")
|
66
|
+
expect(Time.mktime(2004, 7, 8, 10, 5).to_s(:long)).to eq("July 08, 2004 10:05")
|
67
67
|
|
68
|
-
Time.mktime(nil, 5, 13).to_s(:long).
|
69
|
-
Time.mktime(nil, 6).to_s(:long).
|
68
|
+
expect(Time.mktime(nil, 5, 13).to_s(:long)).to eq("May 13")
|
69
|
+
expect(Time.mktime(nil, 6).to_s(:long)).to eq("June")
|
70
70
|
end
|
71
71
|
end
|
72
72
|
end
|
data/spec/compatibility_spec.rb
CHANGED
@@ -32,29 +32,69 @@ describe DateTimePrecision do
|
|
32
32
|
context 'when coercing a hash to a Date' do
|
33
33
|
subject { model.date }
|
34
34
|
|
35
|
-
it {
|
36
|
-
|
37
|
-
|
35
|
+
it { is_expected.to be_a Date }
|
36
|
+
|
37
|
+
describe '#year' do
|
38
|
+
subject { super().year }
|
39
|
+
it { is_expected.to eq(1990) }
|
40
|
+
end
|
41
|
+
|
42
|
+
describe '#precision' do
|
43
|
+
subject { super().precision }
|
44
|
+
it { is_expected.to eq(DateTimePrecision::YEAR) }
|
45
|
+
end
|
38
46
|
end
|
39
47
|
|
40
48
|
context 'when coercing a hash to a DateTime' do
|
41
49
|
subject { model.datetime }
|
42
50
|
|
43
|
-
it {
|
44
|
-
|
45
|
-
|
46
|
-
|
51
|
+
it { is_expected.to be_a DateTime }
|
52
|
+
|
53
|
+
describe '#year' do
|
54
|
+
subject { super().year }
|
55
|
+
it { is_expected.to eq(1800) }
|
56
|
+
end
|
57
|
+
|
58
|
+
describe '#month' do
|
59
|
+
subject { super().month }
|
60
|
+
it { is_expected.to eq(2) }
|
61
|
+
end
|
62
|
+
|
63
|
+
describe '#precision' do
|
64
|
+
subject { super().precision }
|
65
|
+
it { is_expected.to eq(DateTimePrecision::MONTH) }
|
66
|
+
end
|
47
67
|
end
|
48
68
|
|
49
69
|
context 'when coercing a hash to a Time' do
|
50
70
|
subject { model.time }
|
51
71
|
|
52
|
-
it {
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
72
|
+
it { is_expected.to be_a Time }
|
73
|
+
|
74
|
+
describe '#year' do
|
75
|
+
subject { super().year }
|
76
|
+
it { is_expected.to eq(1950) }
|
77
|
+
end
|
78
|
+
|
79
|
+
describe '#month' do
|
80
|
+
subject { super().month }
|
81
|
+
it { is_expected.to eq(5) }
|
82
|
+
end
|
83
|
+
|
84
|
+
describe '#day' do
|
85
|
+
subject { super().day }
|
86
|
+
it { is_expected.to eq(19) }
|
87
|
+
end
|
88
|
+
|
89
|
+
describe '#hour' do
|
90
|
+
subject { super().hour }
|
91
|
+
it { is_expected.to eq(5) }
|
92
|
+
end
|
93
|
+
|
94
|
+
describe '#precision' do
|
95
|
+
subject { super().precision }
|
96
|
+
it { is_expected.to eq(DateTimePrecision::HOUR) }
|
97
|
+
end
|
58
98
|
end
|
59
99
|
end
|
60
100
|
|
@@ -66,29 +106,69 @@ describe DateTimePrecision do
|
|
66
106
|
context 'when coercing a hash to a Date' do
|
67
107
|
subject { coercer.to_date(date_hash) }
|
68
108
|
|
69
|
-
it {
|
70
|
-
|
71
|
-
|
109
|
+
it { is_expected.to be_a Date }
|
110
|
+
|
111
|
+
describe '#year' do
|
112
|
+
subject { super().year }
|
113
|
+
it { is_expected.to eq(1990) }
|
114
|
+
end
|
115
|
+
|
116
|
+
describe '#precision' do
|
117
|
+
subject { super().precision }
|
118
|
+
it { is_expected.to eq(DateTimePrecision::YEAR) }
|
119
|
+
end
|
72
120
|
end
|
73
121
|
|
74
122
|
context 'when coercing a hash to a DateTime' do
|
75
123
|
subject { coercer.to_datetime(datetime_hash) }
|
76
124
|
|
77
|
-
it {
|
78
|
-
|
79
|
-
|
80
|
-
|
125
|
+
it { is_expected.to be_a DateTime }
|
126
|
+
|
127
|
+
describe '#year' do
|
128
|
+
subject { super().year }
|
129
|
+
it { is_expected.to eq(1800) }
|
130
|
+
end
|
131
|
+
|
132
|
+
describe '#month' do
|
133
|
+
subject { super().month }
|
134
|
+
it { is_expected.to eq(2) }
|
135
|
+
end
|
136
|
+
|
137
|
+
describe '#precision' do
|
138
|
+
subject { super().precision }
|
139
|
+
it { is_expected.to eq(DateTimePrecision::MONTH) }
|
140
|
+
end
|
81
141
|
end
|
82
142
|
|
83
143
|
context 'when coercing a hash to a Time' do
|
84
144
|
subject { coercer.to_time(time_hash) }
|
85
145
|
|
86
|
-
it {
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
146
|
+
it { is_expected.to be_a Time }
|
147
|
+
|
148
|
+
describe '#year' do
|
149
|
+
subject { super().year }
|
150
|
+
it { is_expected.to eq(1950) }
|
151
|
+
end
|
152
|
+
|
153
|
+
describe '#month' do
|
154
|
+
subject { super().month }
|
155
|
+
it { is_expected.to eq(5) }
|
156
|
+
end
|
157
|
+
|
158
|
+
describe '#day' do
|
159
|
+
subject { super().day }
|
160
|
+
it { is_expected.to eq(19) }
|
161
|
+
end
|
162
|
+
|
163
|
+
describe '#hour' do
|
164
|
+
subject { super().hour }
|
165
|
+
it { is_expected.to eq(5) }
|
166
|
+
end
|
167
|
+
|
168
|
+
describe '#precision' do
|
169
|
+
subject { super().precision }
|
170
|
+
it { is_expected.to eq(DateTimePrecision::HOUR) }
|
171
|
+
end
|
92
172
|
end
|
93
173
|
end
|
94
174
|
end
|
@@ -5,166 +5,166 @@ describe DateTimePrecision do
|
|
5
5
|
context 'Constructors' do
|
6
6
|
it 'has no precision for unspecified date' do
|
7
7
|
d = Date.new
|
8
|
-
d.precision.
|
9
|
-
d.year
|
8
|
+
expect(d.precision).to eq(DateTimePrecision::NONE)
|
9
|
+
expect(d.year?).to be_falsey
|
10
10
|
|
11
11
|
dt = DateTime.new
|
12
|
-
dt.precision.
|
13
|
-
dt.year
|
12
|
+
expect(dt.precision).to eq(DateTimePrecision::NONE)
|
13
|
+
expect(dt.year?).to be_falsey
|
14
14
|
end
|
15
15
|
|
16
16
|
it 'has no precision for nil values' do
|
17
|
-
nil.precision.
|
17
|
+
expect(nil.precision).to eq(DateTimePrecision::NONE)
|
18
18
|
end
|
19
19
|
|
20
20
|
it 'has year precision when only year is supplied' do
|
21
21
|
d = Date.new(1982)
|
22
|
-
d.precision.
|
23
|
-
d.year
|
24
|
-
d.month
|
25
|
-
d.day
|
22
|
+
expect(d.precision).to eq(DateTimePrecision::YEAR)
|
23
|
+
expect(d.year?).to be_truthy
|
24
|
+
expect(d.month?).to be_falsey
|
25
|
+
expect(d.day?).to be_falsey
|
26
26
|
end
|
27
27
|
|
28
28
|
it 'has month precision when year and month are supplied' do
|
29
29
|
d = Date.new(1982, 11)
|
30
|
-
d.precision.
|
31
|
-
d.year
|
32
|
-
d.month
|
33
|
-
d.day
|
30
|
+
expect(d.precision).to eq(DateTimePrecision::MONTH)
|
31
|
+
expect(d.year?).to be_truthy
|
32
|
+
expect(d.month?).to be_truthy
|
33
|
+
expect(d.day?).to be_falsey
|
34
34
|
end
|
35
35
|
|
36
36
|
it 'has day precision when year, month, and day are passed in' do
|
37
37
|
dt = DateTime.new(1987,10,19)
|
38
|
-
dt.precision.
|
39
|
-
dt.year
|
40
|
-
dt.month
|
41
|
-
dt.day
|
42
|
-
dt.hour
|
38
|
+
expect(dt.precision).to eq(DateTimePrecision::DAY)
|
39
|
+
expect(dt.year?).to be_truthy
|
40
|
+
expect(dt.month?).to be_truthy
|
41
|
+
expect(dt.day?).to be_truthy
|
42
|
+
expect(dt.hour?).to be_falsey
|
43
43
|
end
|
44
44
|
|
45
45
|
it 'has hour precision' do
|
46
46
|
dt = DateTime.new(1970, 1, 2, 3)
|
47
|
-
dt.precision.
|
48
|
-
dt.year
|
49
|
-
dt.month
|
50
|
-
dt.day
|
51
|
-
dt.hour
|
52
|
-
dt.min
|
47
|
+
expect(dt.precision).to eq(DateTimePrecision::HOUR)
|
48
|
+
expect(dt.year?).to be_truthy
|
49
|
+
expect(dt.month?).to be_truthy
|
50
|
+
expect(dt.day?).to be_truthy
|
51
|
+
expect(dt.hour?).to be_truthy
|
52
|
+
expect(dt.min?).to be_falsey
|
53
53
|
end
|
54
54
|
|
55
55
|
it 'tracks which attributes were explicitly set separately from precision' do
|
56
56
|
[Date.new(nil, 11, 12), DateTime.new(nil, 10, 11, nil), Time.mktime(nil, 12, 13, nil, 14)].each do |d|
|
57
|
-
d.year
|
58
|
-
d.month
|
59
|
-
d.day
|
60
|
-
d.hour
|
61
|
-
d.min
|
62
|
-
d.precision.
|
57
|
+
expect(d.year?).to be_falsey
|
58
|
+
expect(d.month?).to be_truthy
|
59
|
+
expect(d.day?).to be_truthy
|
60
|
+
expect(d.hour?).to be_falsey
|
61
|
+
expect(d.min?).to be_truthy if d.is_a? Time
|
62
|
+
expect(d.precision).to eq(DateTimePrecision::NONE)
|
63
63
|
end
|
64
64
|
end
|
65
65
|
|
66
66
|
it 'has max precision for fully specified dates/times' do
|
67
67
|
# Time.new is an alias for Time.now
|
68
68
|
[Time.new, Time.now, DateTime.now, Date.today].each do |t|
|
69
|
-
t.precision.
|
69
|
+
expect(t.precision).to eq(t.class::MAX_PRECISION)
|
70
70
|
end
|
71
71
|
end
|
72
72
|
|
73
73
|
it 'accepts nil values in the constructor' do
|
74
|
-
Date.new(nil).precision.
|
75
|
-
Date.new(2000, nil).precision.
|
76
|
-
DateTime.new(2000, 1, nil).precision.
|
77
|
-
Time.mktime(2000, 1, 1, nil, nil).precision.
|
74
|
+
expect(Date.new(nil).precision).to eq(DateTimePrecision::NONE)
|
75
|
+
expect(Date.new(2000, nil).precision).to eq(DateTimePrecision::YEAR)
|
76
|
+
expect(DateTime.new(2000, 1, nil).precision).to eq(DateTimePrecision::MONTH)
|
77
|
+
expect(Time.mktime(2000, 1, 1, nil, nil).precision).to eq(DateTimePrecision::DAY)
|
78
78
|
end
|
79
79
|
end
|
80
80
|
|
81
81
|
context 'Time Zones' do
|
82
82
|
it 'should retain precision when switching to UTC' do
|
83
|
-
Time.mktime(2000).utc.precision.
|
84
|
-
Time.mktime(2000).gmtime.precision.
|
83
|
+
expect(Time.mktime(2000).utc.precision).to eq(DateTimePrecision::YEAR)
|
84
|
+
expect(Time.mktime(2000).gmtime.precision).to eq(DateTimePrecision::YEAR)
|
85
85
|
end
|
86
86
|
|
87
87
|
it 'should track precision when creating a date, time, or datetime in UTC' do
|
88
|
-
Time.utc(1945, 10).precision.
|
89
|
-
Time.gm(1945, 10).precision.
|
88
|
+
expect(Time.utc(1945, 10).precision).to eq(DateTimePrecision::MONTH)
|
89
|
+
expect(Time.gm(1945, 10).precision).to eq(DateTimePrecision::MONTH)
|
90
90
|
|
91
|
-
Date.utc(1945, 10).precision.
|
92
|
-
DateTime.utc(1945, 10).precision.
|
91
|
+
expect(Date.utc(1945, 10).precision).to eq(DateTimePrecision::MONTH)
|
92
|
+
expect(DateTime.utc(1945, 10).precision).to eq(DateTimePrecision::MONTH)
|
93
93
|
end
|
94
94
|
|
95
95
|
it 'should track precision when creating a time in the local timezone' do
|
96
|
-
Time.local(2004, 5, 6).precision.
|
96
|
+
expect(Time.local(2004, 5, 6).precision).to eq(DateTimePrecision::DAY)
|
97
97
|
end
|
98
98
|
end
|
99
99
|
|
100
100
|
context 'Parsing' do
|
101
101
|
it 'should have second/frac precision when parsing a timestamp' do
|
102
102
|
t = Time::parse('2000-2-3 00:00:00 UTC')
|
103
|
-
t.precision.
|
104
|
-
t.year.
|
105
|
-
t.month.
|
106
|
-
t.day.
|
103
|
+
expect(t.precision).to eq(DateTimePrecision::SEC)
|
104
|
+
expect(t.year).to eq(2000)
|
105
|
+
expect(t.month).to eq(2)
|
106
|
+
expect(t.day).to eq(3)
|
107
107
|
end
|
108
108
|
|
109
109
|
it 'should have minute precision when seconds are not in the timestamp' do
|
110
110
|
dt = DateTime::parse('2000-1-1 00:00 EST') # => Sat, 01 Jan 2000 00:00:00 -0500
|
111
|
-
dt.precision.
|
112
|
-
dt.year.
|
113
|
-
dt.day.
|
111
|
+
expect(dt.precision).to eq(DateTimePrecision::MIN)
|
112
|
+
expect(dt.year).to eq(2000)
|
113
|
+
expect(dt.day).to eq(1)
|
114
114
|
end
|
115
115
|
|
116
116
|
it 'should have day precision wehn parsing into a Date object' do
|
117
117
|
d = Date::parse('2000-1-1 00:00:00 EST') # => Sat, 01 Jan 2000
|
118
|
-
d.precision.
|
118
|
+
expect(d.precision).to eq(DateTimePrecision::DAY)
|
119
119
|
end
|
120
120
|
|
121
121
|
it 'should have month precision when day is not in the parsed string' do
|
122
122
|
t = Time::parse('January 2000 UTC').utc # => Sat Jan 01 00:00:00 -0800 2000
|
123
|
-
t.precision.
|
124
|
-
t.year.
|
125
|
-
t.month.
|
123
|
+
expect(t.precision).to eq(DateTimePrecision::MONTH)
|
124
|
+
expect(t.year).to eq(2000)
|
125
|
+
expect(t.month).to eq(1)
|
126
126
|
end
|
127
127
|
end
|
128
128
|
|
129
129
|
context 'strptime' do
|
130
130
|
it 'should have day precision when day is specified in date string' do
|
131
131
|
d = Date.strptime('02/09/1968', '%m/%d/%Y')
|
132
|
-
d.precision.
|
132
|
+
expect(d.precision).to eq(DateTimePrecision::DAY)
|
133
133
|
end
|
134
134
|
|
135
135
|
it 'should have minute precision when extracting down to the minute' do
|
136
136
|
dt = DateTime.strptime('2011-02-03 15:14:52','%Y-%m-%d %H:%M')
|
137
|
-
dt.precision.
|
137
|
+
expect(dt.precision).to eq(DateTimePrecision::MIN)
|
138
138
|
end
|
139
139
|
|
140
140
|
it 'should have second precision when extracting down to the second' do
|
141
141
|
t = DateTime.strptime('2011-02-03 15:14:52','%Y-%m-%d %H:%M:%S')
|
142
|
-
t.precision.
|
142
|
+
expect(t.precision).to eq(DateTimePrecision::SEC)
|
143
143
|
end
|
144
144
|
end
|
145
145
|
|
146
146
|
context 'Addition' do
|
147
147
|
it 'should default to max precision when adding or subtracting' do
|
148
148
|
d = Date.new
|
149
|
-
d.precision.
|
149
|
+
expect(d.precision).to eq(DateTimePrecision::NONE)
|
150
150
|
d += 3
|
151
|
-
d.precision.
|
151
|
+
expect(d.precision).to eq(Date::MAX_PRECISION)
|
152
152
|
d -= 2
|
153
|
-
d.precision.
|
153
|
+
expect(d.precision).to eq(Date::MAX_PRECISION)
|
154
154
|
|
155
155
|
dt = DateTime.new
|
156
|
-
dt.precision.
|
156
|
+
expect(dt.precision).to eq(DateTimePrecision::NONE)
|
157
157
|
dt += 3
|
158
|
-
dt.precision.
|
158
|
+
expect(dt.precision).to eq(DateTime::MAX_PRECISION)
|
159
159
|
dt -= 2
|
160
|
-
dt.precision.
|
160
|
+
expect(dt.precision).to eq(DateTime::MAX_PRECISION)
|
161
161
|
|
162
162
|
t = Time::parse('January 2000 UTC').utc
|
163
|
-
t.precision.
|
163
|
+
expect(t.precision).to eq(DateTimePrecision::MONTH)
|
164
164
|
t += 10
|
165
|
-
t.precision.
|
165
|
+
expect(t.precision).to eq(Time::MAX_PRECISION)
|
166
166
|
t -= 8
|
167
|
-
t.precision.
|
167
|
+
expect(t.precision).to eq(Time::MAX_PRECISION)
|
168
168
|
end
|
169
169
|
end
|
170
170
|
|
@@ -172,8 +172,8 @@ describe DateTimePrecision do
|
|
172
172
|
it 'should match when differing only in day precision' do
|
173
173
|
d1 = Date.new(2001,3,2)
|
174
174
|
d2 = Date.new(2001,3)
|
175
|
-
d1.partial_match?(d2).
|
176
|
-
d2.partial_match?(d1).
|
175
|
+
expect(d1.partial_match?(d2)).to be_truthy
|
176
|
+
expect(d2.partial_match?(d1)).to be_truthy
|
177
177
|
end
|
178
178
|
end
|
179
179
|
|
data/spec/format_spec.rb
CHANGED
@@ -28,40 +28,40 @@ describe DateTimePrecision do
|
|
28
28
|
|
29
29
|
[:iso8601, :xmlschema].each do |format_method|
|
30
30
|
it 'converts a date to and from ISO 8601' do
|
31
|
-
date.send(format_method).
|
31
|
+
expect(date.send(format_method)).to eq("1989-03-11")
|
32
32
|
|
33
33
|
@table.take(3).each do |args, format_string|
|
34
|
-
Date.new(*args).send(format_method).
|
34
|
+
expect(Date.new(*args).send(format_method)).to eq(format_string)
|
35
35
|
|
36
36
|
d = Date.send(format_method, format_string)
|
37
|
-
d.
|
38
|
-
d.precision.
|
37
|
+
expect(d).to eq(Date.new(*args))
|
38
|
+
expect(d.precision).to eq(args.length)
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
42
|
it 'converts a datetime to and from ISO 8601' do
|
43
|
-
datetime.send(format_method).
|
43
|
+
expect(datetime.send(format_method)).to eq("1989-03-11T08:30:15Z")
|
44
44
|
|
45
45
|
@table.each do |args, format_string|
|
46
|
-
DateTime.new(*args).send(format_method).
|
46
|
+
expect(DateTime.new(*args).send(format_method)).to eq(format_string)
|
47
47
|
|
48
48
|
d = DateTime.send(format_method, format_string)
|
49
49
|
constructor = args.length > 3 ? :utc : :local
|
50
|
-
d.
|
51
|
-
d.precision.
|
50
|
+
expect(d).to eq(DateTime.send(constructor, *args))
|
51
|
+
expect(d.precision).to eq(args.length)
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
55
55
|
it 'converts a time to ISO 8601' do
|
56
|
-
Time.mktime(1900).send(format_method).
|
56
|
+
expect(Time.mktime(1900).send(format_method)).to eq("1900")
|
57
57
|
|
58
58
|
@table.each do |args, format_string|
|
59
|
-
Time.utc(*args).send(format_method).
|
59
|
+
expect(Time.utc(*args).send(format_method)).to eq(format_string)
|
60
60
|
|
61
61
|
t = Time.send(format_method, format_string)
|
62
62
|
constructor = args.length > 3 ? :utc : :local
|
63
|
-
t.
|
64
|
-
t.precision.
|
63
|
+
expect(t).to eq(Time.send(constructor, *args))
|
64
|
+
expect(t.precision).to eq(args.length)
|
65
65
|
end
|
66
66
|
end
|
67
67
|
end
|
@@ -97,19 +97,19 @@ describe DateTimePrecision do
|
|
97
97
|
|
98
98
|
context 'Converting to hash' do
|
99
99
|
it 'should convert Date to a hash' do
|
100
|
-
date.to_h.
|
100
|
+
expect(date.to_h).to eq(date_hash)
|
101
101
|
end
|
102
102
|
|
103
103
|
it 'should convert DateTime to a hash' do
|
104
|
-
datetime.to_h.
|
104
|
+
expect(datetime.to_h).to eq(datetime_hash)
|
105
105
|
end
|
106
106
|
|
107
107
|
it 'should convert Time to a hash' do
|
108
|
-
time.to_h.
|
108
|
+
expect(time.to_h).to eq(time_hash)
|
109
109
|
end
|
110
110
|
|
111
111
|
it 'should skip year if not included' do
|
112
|
-
Date.new(nil, 8, 10).to_h.
|
112
|
+
expect(Date.new(nil, 8, 10).to_h).to eq({:mon => 8, :day => 10})
|
113
113
|
end
|
114
114
|
end
|
115
115
|
|
@@ -131,22 +131,22 @@ describe DateTimePrecision do
|
|
131
131
|
end
|
132
132
|
|
133
133
|
it 'should convert Date to a short hash' do
|
134
|
-
date.to_h(:short).
|
134
|
+
expect(date.to_h(:short)).to eq(short_date_hash)
|
135
135
|
end
|
136
136
|
|
137
137
|
it 'should convert Date to a long hash' do
|
138
|
-
date.to_h(:long).
|
138
|
+
expect(date.to_h(:long)).to eq(long_date_hash)
|
139
139
|
end
|
140
140
|
|
141
141
|
it 'should convert DateTime to a long hash' do
|
142
|
-
datetime.to_h(:long).
|
142
|
+
expect(datetime.to_h(:long)).to eq({
|
143
143
|
:year => 1989,
|
144
144
|
:month => 3,
|
145
145
|
:day => 11,
|
146
146
|
:hour => 8,
|
147
147
|
:minute => 30,
|
148
148
|
:second => 15
|
149
|
-
}
|
149
|
+
})
|
150
150
|
end
|
151
151
|
|
152
152
|
it 'should convert Time to a short hash' do
|
@@ -161,75 +161,75 @@ describe DateTimePrecision do
|
|
161
161
|
|
162
162
|
hash.merge!(:us => 1) if DateTimePrecision::MICROSECONDS_SUPPORTED
|
163
163
|
|
164
|
-
time.to_h(:short).
|
164
|
+
expect(time.to_h(:short)).to eq(hash)
|
165
165
|
end
|
166
166
|
|
167
167
|
it 'should convert Time to a custom hash' do
|
168
|
-
Hash::DATE_FORMATS[:custom] = [:year, :mon, :d, :h, :min, :s]
|
168
|
+
::Hash::DATE_FORMATS[:custom] = [:year, :mon, :d, :h, :min, :s]
|
169
169
|
|
170
|
-
time.to_h(:custom).
|
170
|
+
expect(time.to_h(:custom)).to eq({
|
171
171
|
:year => 1989,
|
172
172
|
:mon => 3,
|
173
173
|
:d => 11,
|
174
174
|
:h => 8,
|
175
175
|
:min => 30,
|
176
176
|
:s => 15,
|
177
|
-
}
|
177
|
+
})
|
178
178
|
end
|
179
179
|
|
180
180
|
it 'should convert to the default hash format' do
|
181
|
-
Hash::DATE_FORMATS[:default] = Hash::DATE_FORMATS[:short]
|
182
|
-
date.to_h(:short).
|
183
|
-
Hash::DATE_FORMATS[:default] = Hash::DATE_FORMATS[:ruby]
|
181
|
+
::Hash::DATE_FORMATS[:default] = ::Hash::DATE_FORMATS[:short]
|
182
|
+
expect(date.to_h(:short)).to eq(short_date_hash)
|
183
|
+
::Hash::DATE_FORMATS[:default] = ::Hash::DATE_FORMATS[:ruby]
|
184
184
|
end
|
185
185
|
|
186
186
|
it 'should only include fields that were set' do
|
187
|
-
Date.new(nil, 3, 8).to_h.
|
188
|
-
DateTime.new(nil, 5, 6, nil, 7).to_h.
|
189
|
-
Time.mktime(nil, 1, nil, 9, nil, 10).to_h.
|
187
|
+
expect(Date.new(nil, 3, 8).to_h).to eq({:mon => 3, :day => 8})
|
188
|
+
expect(DateTime.new(nil, 5, 6, nil, 7).to_h).to eq({:mon => 5, :day => 6, :min => 7})
|
189
|
+
expect(Time.mktime(nil, 1, nil, 9, nil, 10).to_h).to eq({:mon => 1, :hour => 9, :sec => 10})
|
190
190
|
end
|
191
191
|
end
|
192
192
|
|
193
193
|
context 'Converting from hash' do
|
194
194
|
it 'converts a hash to a Date' do
|
195
|
-
date_hash.to_date.
|
195
|
+
expect(date_hash.to_date).to eq(date)
|
196
196
|
end
|
197
197
|
|
198
198
|
it 'converts a hash to a DateTime' do
|
199
|
-
datetime_hash.to_datetime.
|
199
|
+
expect(datetime_hash.to_datetime).to eq(datetime)
|
200
200
|
end
|
201
201
|
|
202
202
|
it 'converts a hash to a Time' do
|
203
|
-
time_hash.to_time.
|
203
|
+
expect(time_hash.to_time).to eq(time)
|
204
204
|
end
|
205
205
|
|
206
206
|
it 'accepts flexible keys' do
|
207
|
-
{
|
207
|
+
expect({
|
208
208
|
:y => 1989,
|
209
209
|
:m => 3,
|
210
210
|
:d => 11
|
211
|
-
}.to_date.
|
211
|
+
}.to_date).to eq(date)
|
212
212
|
|
213
|
-
{
|
213
|
+
expect({
|
214
214
|
:year => 1989,
|
215
215
|
:month => 3,
|
216
216
|
:day => 11
|
217
|
-
}.to_date.
|
217
|
+
}.to_date).to eq(date)
|
218
218
|
end
|
219
219
|
|
220
220
|
[:date, :datetime, :time].each do |klass|
|
221
221
|
it "accepts month and day without year when converting to a #{klass}" do
|
222
222
|
date = { :month => 5, :day => 18, :min => 48 }.send("to_#{klass}")
|
223
|
-
date.year
|
224
|
-
date.month
|
225
|
-
date.month.
|
226
|
-
date.day
|
227
|
-
date.day.
|
228
|
-
date.hour
|
223
|
+
expect(date.year?).to be_falsey
|
224
|
+
expect(date.month?).to be_truthy
|
225
|
+
expect(date.month).to eq(5)
|
226
|
+
expect(date.day?).to be_truthy
|
227
|
+
expect(date.day).to eq(18)
|
228
|
+
expect(date.hour?).to be_falsey
|
229
229
|
|
230
230
|
unless klass == :date
|
231
|
-
date.min
|
232
|
-
date.min.
|
231
|
+
expect(date.min?).to be_truthy
|
232
|
+
expect(date.min).to eq(48)
|
233
233
|
end
|
234
234
|
end
|
235
235
|
end
|
@@ -241,20 +241,20 @@ describe DateTimePrecision do
|
|
241
241
|
require 'json'
|
242
242
|
|
243
243
|
it 'should convert a date to a JSON hash' do
|
244
|
-
date.as_json.
|
245
|
-
date.to_json.
|
244
|
+
expect(date.as_json).to eq(date.to_h)
|
245
|
+
expect(date.to_json).to eq(date.to_h.to_json)
|
246
246
|
end
|
247
247
|
|
248
248
|
it 'should convert a datetime to a JSON hash' do
|
249
|
-
datetime.as_json.
|
250
|
-
datetime.to_json.
|
249
|
+
expect(datetime.as_json).to eq(datetime.to_h)
|
250
|
+
expect(datetime.to_json).to eq(datetime.to_h.to_json)
|
251
251
|
end
|
252
252
|
|
253
253
|
it 'should convert a time to a JSON hash' do
|
254
|
-
time.as_json.
|
255
|
-
time.to_json.
|
254
|
+
expect(time.as_json).to eq(time.to_h)
|
255
|
+
expect(time.to_json).to eq(time.to_h.to_json)
|
256
256
|
end
|
257
257
|
end
|
258
258
|
|
259
259
|
end
|
260
|
-
end
|
260
|
+
end
|
metadata
CHANGED
@@ -1,83 +1,123 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: date_time_precision
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.7.2
|
5
5
|
platform: ruby
|
6
|
-
authors:
|
6
|
+
authors:
|
7
7
|
- David Butler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
- !ruby/object:Gem::Dependency
|
15
|
-
version_requirements: &id001 !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- &id002
|
18
|
-
- ">="
|
19
|
-
- !ruby/object:Gem::Version
|
20
|
-
version: "0"
|
11
|
+
date: 2014-10-01 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
21
14
|
name: rake
|
22
|
-
requirement:
|
23
|
-
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
24
20
|
type: :development
|
25
|
-
|
26
|
-
version_requirements:
|
27
|
-
requirements:
|
28
|
-
-
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
29
28
|
name: rspec
|
30
|
-
requirement:
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
31
35
|
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: appraisal
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
32
48
|
type: :development
|
33
|
-
- !ruby/object:Gem::Dependency
|
34
|
-
version_requirements: &id004 !ruby/object:Gem::Requirement
|
35
|
-
requirements:
|
36
|
-
- *id002
|
37
|
-
name: activesupport
|
38
|
-
requirement: *id004
|
39
49
|
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: activesupport
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
40
62
|
type: :development
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
version_requirements: &id005 !ruby/object:Gem::Requirement
|
43
|
-
requirements:
|
44
|
-
- *id002
|
45
|
-
name: json
|
46
|
-
requirement: *id005
|
47
63
|
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: json
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
48
76
|
type: :development
|
49
|
-
- !ruby/object:Gem::Dependency
|
50
|
-
version_requirements: &id006 !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: 0.5.4
|
55
|
-
name: virtus
|
56
|
-
requirement: *id006
|
57
77
|
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: virtus
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 0.5.4
|
58
90
|
type: :development
|
59
|
-
- !ruby/object:Gem::Dependency
|
60
|
-
version_requirements: &id007 !ruby/object:Gem::Requirement
|
61
|
-
requirements:
|
62
|
-
- - "="
|
63
|
-
- !ruby/object:Gem::Version
|
64
|
-
version: 0.0.1
|
65
|
-
name: coercible
|
66
|
-
requirement: *id007
|
67
91
|
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 0.5.4
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: coercible
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - '='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 0.0.1
|
68
104
|
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - '='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 0.0.1
|
69
111
|
description: Patches Date, Time, and DateTime ruby classes to keep track of precision
|
70
|
-
email:
|
112
|
+
email:
|
71
113
|
- dwbutler@ucla.edu
|
72
114
|
executables: []
|
73
|
-
|
74
115
|
extensions: []
|
75
|
-
|
76
116
|
extra_rdoc_files: []
|
77
|
-
|
78
|
-
|
79
|
-
- .
|
80
|
-
-
|
117
|
+
files:
|
118
|
+
- ".gitignore"
|
119
|
+
- ".travis.yml"
|
120
|
+
- Appraisals
|
81
121
|
- Gemfile
|
82
122
|
- LICENSE
|
83
123
|
- README
|
@@ -118,29 +158,30 @@ files:
|
|
118
158
|
- spec/format_spec.rb
|
119
159
|
- spec/spec_helper.rb
|
120
160
|
homepage: http://github.com/Spokeo/date_time_precision
|
121
|
-
licenses:
|
161
|
+
licenses:
|
122
162
|
- MIT
|
123
163
|
metadata: {}
|
124
|
-
|
125
164
|
post_install_message:
|
126
165
|
rdoc_options: []
|
127
|
-
|
128
|
-
require_paths:
|
166
|
+
require_paths:
|
129
167
|
- lib
|
130
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
131
|
-
requirements:
|
132
|
-
-
|
133
|
-
|
134
|
-
|
135
|
-
|
168
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
169
|
+
requirements:
|
170
|
+
- - ">="
|
171
|
+
- !ruby/object:Gem::Version
|
172
|
+
version: '0'
|
173
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
174
|
+
requirements:
|
175
|
+
- - ">="
|
176
|
+
- !ruby/object:Gem::Version
|
177
|
+
version: '0'
|
136
178
|
requirements: []
|
137
|
-
|
138
179
|
rubyforge_project:
|
139
180
|
rubygems_version: 2.2.2
|
140
181
|
signing_key:
|
141
182
|
specification_version: 4
|
142
183
|
summary: Patches Date, Time, and DateTime ruby classes to keep track of precision
|
143
|
-
test_files:
|
184
|
+
test_files:
|
144
185
|
- spec/active_support_spec.rb
|
145
186
|
- spec/compatibility_spec.rb
|
146
187
|
- spec/date_time_precision_spec.rb
|