iso8601 0.8.2 → 0.8.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fd22bba59a7a58d3de630fee01ac22e7d1883eef
4
- data.tar.gz: f74f72a6343a250efb7c364e72470973984dc0c7
3
+ metadata.gz: 53a7fd7f860f636a1839b537d889f5ca7a191e5f
4
+ data.tar.gz: d7262af5731bd023d7c9be999518c89abd7c09e0
5
5
  SHA512:
6
- metadata.gz: 871a47af5667cc18985c72b46ae93a98d0291be954818104891b27548fa8fa4953a3da8a0c3966bdc9813e3e0b3558f508ba3cbf8f3f59998ddea599bf089083
7
- data.tar.gz: 05aea0366c18e414d66b7ac50279656c5a2bbee537b22db547c58709445509de3ee8cf102f109ab011b2c84711ba59a30e02a8a8a0e8666c261af3c490efeadc
6
+ metadata.gz: c2c5acdf6062821b7a0055fd24fefa92e4a24717013a92060f2ff77c93d57e2311bf5540249926bcff03cf4dbc2a6cedf718378b77d80c0a6cfd03057782dd75
7
+ data.tar.gz: 54b513cb8c894158d116c34d212505a32ad18128d74f0656c68132fe35d9941f8ae778507f37f4770b74ed85b7eddb0c482499d068d910b6ad1559b2f4601002
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # ISO8601
2
2
 
3
+ [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](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
  [![Build Status](https://secure.travis-ci.org/arnau/ISO8601.png?branch=master)](http://travis-ci.org/arnau/ISO8601/)
10
-
11
12
  [![Dependency Status](https://gemnasium.com/arnau/ISO8601.svg)](https://gemnasium.com/arnau/ISO8601)
13
+ [![Gem Version](https://badge.fury.io/rb/iso8601.svg)](http://badge.fury.io/rb/iso8601)
12
14
 
13
15
  ## Supported versions
14
16
 
@@ -121,8 +121,8 @@ module ISO8601
121
121
  @separator = separator
122
122
 
123
123
  hour = hour.to_i
124
- minute &&= minute.to_i
125
- second &&= second.tr(',', '.').to_f
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
@@ -1,5 +1,5 @@
1
1
  module ISO8601
2
2
  ##
3
3
  # The gem version
4
- VERSION = '0.8.2'
4
+ VERSION = '0.8.3'
5
5
  end
@@ -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.2
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: 2014-09-16 00:00:00.000000000 Z
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.2.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