iso8601 0.5.2 → 0.6.0
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +4 -23
- data/lib/iso8601/date.rb +1 -1
- data/lib/iso8601/dateTime.rb +1 -1
- data/lib/iso8601/duration.rb +6 -0
- data/lib/iso8601/time.rb +1 -1
- data/lib/iso8601/version.rb +1 -1
- data/spec/iso8601/dateTime_spec.rb +11 -0
- data/spec/iso8601/date_spec.rb +10 -0
- data/spec/iso8601/duration_spec.rb +7 -0
- data/spec/iso8601/time_spec.rb +9 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9dcdc5cbdd5d7ca45c4cdda75be726ba788883b
|
4
|
+
data.tar.gz: 579e363f9c3969d20987122e9108e07e94acae56
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c906351a59be4c6173cb08a666396659b2f37b0ba481899bb751434c5ab316f6fcd2d31f9da188c10307d22d85016851038d26351bb6f35d4f97c94aec77da56
|
7
|
+
data.tar.gz: 666289b7461bdd1d29ed51eed7c810fe3a55ec4403df3163cedce303f31f1888877319fce5efc2294122ffb80dd4b5f64a05ffeeb1b9280dc31b384ab868a009
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -15,6 +15,8 @@ times) standard.
|
|
15
15
|
* MRI 2.1
|
16
16
|
* RBX 2
|
17
17
|
|
18
|
+
Check the [changelog](https://github.com/arnau/ISO8601/blob/master/CHANGELOG.md) if you are upgrading from an older version.
|
19
|
+
|
18
20
|
|
19
21
|
## Comments about this implementation
|
20
22
|
|
@@ -82,24 +84,6 @@ Week dates raise an error when two digit days provied instead of return monday:
|
|
82
84
|
DateTime.new('2014-W15-02') # => #<Date: 2014-04-07 ((2456755j,0s,0n),+0s,2299161j)>
|
83
85
|
|
84
86
|
|
85
|
-
## Changes since 0.5
|
86
|
-
|
87
|
-
* Drop support for Ruby 1.8.7
|
88
|
-
* Add support for Rubinius 2
|
89
|
-
* `ISO8601::DateTime#century` no longer exists. Truncated representations were
|
90
|
-
removed in ISO 8601:2004.
|
91
|
-
* `ISO8601::DateTime#zone` delegates to core `DateTime#zone`.
|
92
|
-
* `ISO8601::DateTime#timezone` no longer exists. Now it delegates to
|
93
|
-
`DateTime#zone`.
|
94
|
-
* A date can have sign: `-1000-01-01`, `+2014-05-06T10:11:12Z`.
|
95
|
-
* A date time can be converted to an array of atoms with `#to_a`.
|
96
|
-
* Ordinal dates supported.
|
97
|
-
* A date component is represented by `ISO8601::Date`.
|
98
|
-
* Week date pattern (YYYY-Wdww, YYYY-Www-D).
|
99
|
-
|
100
|
-
Check the [changelog](https://github.com/arnau/ISO8601/blob/master/CHANGELOG.md)
|
101
|
-
for a more complete list.
|
102
|
-
|
103
87
|
|
104
88
|
## TODO
|
105
89
|
|
@@ -108,11 +92,8 @@ for a more complete list.
|
|
108
92
|
|
109
93
|
## Contributors
|
110
94
|
|
111
|
-
|
112
|
-
|
113
|
-
* [Takahiro Noda](https://github.com/tnoda)
|
114
|
-
* [Porras](https://github.com/porras)
|
115
|
-
* [Kenichi Kamiya](https://github.com/kachick)
|
95
|
+
[Contributors](https://github.com/arnau/ISO8601/graphs/contributors)
|
96
|
+
|
116
97
|
|
117
98
|
## License
|
118
99
|
|
data/lib/iso8601/date.rb
CHANGED
data/lib/iso8601/dateTime.rb
CHANGED
data/lib/iso8601/duration.rb
CHANGED
@@ -147,6 +147,12 @@ module ISO8601
|
|
147
147
|
raise ISO8601::Errors::DurationBaseError.new(duration) if @base.to_s != duration.base.to_s
|
148
148
|
(self.to_seconds == duration.to_seconds)
|
149
149
|
end
|
150
|
+
##
|
151
|
+
# @return [Fixnum]
|
152
|
+
def hash
|
153
|
+
@atoms.hash
|
154
|
+
end
|
155
|
+
|
150
156
|
|
151
157
|
private
|
152
158
|
##
|
data/lib/iso8601/time.rb
CHANGED
data/lib/iso8601/version.rb
CHANGED
@@ -122,4 +122,15 @@ describe ISO8601::DateTime do
|
|
122
122
|
dt.should == [2014, 5, 31, 19, 29, 39, '+00:00']
|
123
123
|
end
|
124
124
|
end
|
125
|
+
|
126
|
+
describe '#hash' do
|
127
|
+
it "should return the datetime hash" do
|
128
|
+
subject = ISO8601::DateTime.new('2014-08-16T20:11:10Z')
|
129
|
+
contrast = ::DateTime.new(2014, 8, 16, 20, 11, 10, 'Z')
|
130
|
+
|
131
|
+
expect(subject).to respond_to(:hash)
|
132
|
+
expect(subject.hash).to eq(contrast.hash)
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
125
136
|
end
|
data/spec/iso8601/date_spec.rb
CHANGED
@@ -81,4 +81,14 @@ describe ISO8601::Date do
|
|
81
81
|
ISO8601::Date.new('2014').atoms.should == [2014]
|
82
82
|
end
|
83
83
|
end
|
84
|
+
|
85
|
+
describe '#hash' do
|
86
|
+
it "should return the date hash" do
|
87
|
+
subject = ISO8601::Date.new('2014-08-16')
|
88
|
+
contrast = ::Date.new(2014, 8, 16)
|
89
|
+
|
90
|
+
expect(subject).to respond_to(:hash)
|
91
|
+
expect(subject.hash).to eq(contrast.hash)
|
92
|
+
end
|
93
|
+
end
|
84
94
|
end
|
data/spec/iso8601/time_spec.rb
CHANGED
@@ -80,4 +80,13 @@ describe ISO8601::Time do
|
|
80
80
|
ISO8601::Time.new('T19').atoms.should == [19]
|
81
81
|
end
|
82
82
|
end
|
83
|
+
|
84
|
+
describe '#hash' do
|
85
|
+
it "should return the time hash" do
|
86
|
+
subject = ISO8601::Time.new('T20:11:10Z')
|
87
|
+
|
88
|
+
expect(subject).to respond_to(:hash)
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
83
92
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iso8601
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arnau Siches
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|