iso8601 0.8.2 → 0.8.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 +4 -4
- data/README.md +3 -1
- data/lib/iso8601/time.rb +3 -2
- data/lib/iso8601/version.rb +1 -1
- data/spec/iso8601/time_spec.rb +3 -2
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 53a7fd7f860f636a1839b537d889f5ca7a191e5f
|
4
|
+
data.tar.gz: d7262af5731bd023d7c9be999518c89abd7c09e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2c5acdf6062821b7a0055fd24fefa92e4a24717013a92060f2ff77c93d57e2311bf5540249926bcff03cf4dbc2a6cedf718378b77d80c0a6cfd03057782dd75
|
7
|
+
data.tar.gz: 54b513cb8c894158d116c34d212505a32ad18128d74f0656c68132fe35d9941f8ae778507f37f4770b74ed85b7eddb0c482499d068d910b6ad1559b2f4601002
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# ISO8601
|
2
2
|
|
3
|
+
[](https://gitter.im/arnau/ISO8601?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
4
|
+
|
3
5
|
ISO8601 is a simple implementation of the ISO 8601 (Data elements and
|
4
6
|
interchange formats — Information interchange — Representation of dates and
|
5
7
|
times) standard.
|
@@ -7,8 +9,8 @@ times) standard.
|
|
7
9
|
## Build status
|
8
10
|
|
9
11
|
[](http://travis-ci.org/arnau/ISO8601/)
|
10
|
-
|
11
12
|
[](https://gemnasium.com/arnau/ISO8601)
|
13
|
+
[](http://badge.fury.io/rb/iso8601)
|
12
14
|
|
13
15
|
## Supported versions
|
14
16
|
|
data/lib/iso8601/time.rb
CHANGED
@@ -121,8 +121,8 @@ module ISO8601
|
|
121
121
|
@separator = separator
|
122
122
|
|
123
123
|
hour = hour.to_i
|
124
|
-
minute
|
125
|
-
second
|
124
|
+
minute = minute.to_i
|
125
|
+
second = second.nil? ? 0.0 : second.tr(',', '.').to_f
|
126
126
|
|
127
127
|
fail ISO8601::Errors::UnknownPattern, @original unless valid_zone?(zone)
|
128
128
|
|
@@ -146,6 +146,7 @@ module ISO8601
|
|
146
146
|
#
|
147
147
|
# @return [::DateTime]
|
148
148
|
def compose(atoms, base)
|
149
|
+
puts atoms.inspect
|
149
150
|
::DateTime.new(*[base.year, base.month, base.day], *atoms)
|
150
151
|
rescue ArgumentError
|
151
152
|
raise ISO8601::Errors::RangeError, @original
|
data/lib/iso8601/version.rb
CHANGED
data/spec/iso8601/time_spec.rb
CHANGED
@@ -18,6 +18,7 @@ describe ISO8601::Time do
|
|
18
18
|
it "should parse any allowed pattern" do
|
19
19
|
expect { ISO8601::Time.new('T10') }.to_not raise_error
|
20
20
|
expect { ISO8601::Time.new('T10:30') }.to_not raise_error
|
21
|
+
expect { ISO8601::Time.new('T10:30Z') }.to_not raise_error
|
21
22
|
expect { ISO8601::Time.new('T10:30:12') }.to_not raise_error
|
22
23
|
expect { ISO8601::Time.new('T10:30:12Z') }.to_not raise_error
|
23
24
|
expect { ISO8601::Time.new('T10:30:12+04') }.to_not raise_error
|
@@ -79,8 +80,8 @@ describe ISO8601::Time do
|
|
79
80
|
expect(ISO8601::Time.new('T19:29:39+04:00').atoms).to eq([19, 29, 39, '+04:00'])
|
80
81
|
expect(ISO8601::Time.new('T19:29:39Z').atoms).to eq([19, 29, 39, 'Z'])
|
81
82
|
expect(ISO8601::Time.new('T19:29:39').atoms).to eq([19, 29, 39])
|
82
|
-
expect(ISO8601::Time.new('T19:29').atoms).to eq([19, 29])
|
83
|
-
expect(ISO8601::Time.new('T19').atoms).to eq([19])
|
83
|
+
expect(ISO8601::Time.new('T19:29').atoms).to eq([19, 29, 0.0])
|
84
|
+
expect(ISO8601::Time.new('T19:29Z').atoms).to eq([19, 29, 0.0, 'Z'])
|
84
85
|
end
|
85
86
|
end
|
86
87
|
|
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.8.
|
4
|
+
version: 0.8.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arnau Siches
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -90,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
90
90
|
version: '0'
|
91
91
|
requirements: []
|
92
92
|
rubyforge_project: iso8601
|
93
|
-
rubygems_version: 2.
|
93
|
+
rubygems_version: 2.0.14
|
94
94
|
signing_key:
|
95
95
|
specification_version: 4
|
96
96
|
summary: Ruby parser to work with ISO 8601 dateTimes and durations - http://en.wikipedia.org/wiki/ISO_8601
|
@@ -101,3 +101,4 @@ test_files:
|
|
101
101
|
- spec/iso8601/duration_spec.rb
|
102
102
|
- spec/iso8601/time_spec.rb
|
103
103
|
- spec/spec_helper.rb
|
104
|
+
has_rdoc: yard
|