iso8601 0.5.1 → 0.5.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 CHANGED
@@ -1,7 +1,7 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 6de980e2da893c391f09b68e2e4cc46bd9d67c90
4
- data.tar.gz: 3853cfee5b7a1797e937e296b8ac7aff5f6c5a0d
5
- SHA512:
6
- metadata.gz: 5826689b055f19401bb1abd644982e3a589f12e7d44d57dda721124784401fe59ba9a8a52e68c9daf864ea2c00577366cd66d896eb3e5340a943cd979f27f799
7
- data.tar.gz: 65e6b987b1334d9b1023d80a2196ea5125c889a4dbd6c7323b989058ae5d2527acb75cdff12a5e785249737a0c93bdfafdacd2f0b3aa3ee27a04eb8dcb03e56b
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 1e768c6e31ed30d4c5275356329d3eeef4508fd3
4
+ data.tar.gz: 3a9ba019e31b7874535e200a067e5e78e583e06c
5
+ SHA512:
6
+ metadata.gz: 18b394d3a4ad6fdd33546d667743aeac309213c40793e66c0f03e0d05da7d0ad6f6f8ae259d7ed4401d2b847e477abc683ec54f1b712487d7d6ade37a28b15b6
7
+ data.tar.gz: 4d4f9ef990d4ff79a0023169e96de92200af682835c6124bcf78f98267a31f7eb0b8c2260e1c0909a2cbc4c3b323fa54f1ecae83f23a253fad9e37a3e36c84d5
@@ -0,0 +1,23 @@
1
+
2
+ ## Changes for 0.5.2
3
+
4
+ * Fix `DateTime` when handling empty strings.
5
+
6
+ ## Changes for 0.5.1
7
+
8
+ * Fix durations with sign.
9
+
10
+ ## Changes for 0.5
11
+
12
+ * Drop support for Ruby 1.8.7.
13
+ * Add support for Rubinius 2.
14
+ * `ISO8601::DateTime#century` no longer exists. Truncated representations were
15
+ removed in ISO 8601:2004.
16
+ * `ISO8601::DateTime#zone` delegates to core `DateTime#zone`.
17
+ * `ISO8601::DateTime#timezone` no longer exists. Now it delegates to
18
+ `DateTime#zone`.
19
+ * A date can have sign: `-1000-01-01`, `+2014-05-06T10:11:12Z`.
20
+ * A date time can be converted to an array of atoms with `#to_a`.
21
+ * Ordinal dates supported.
22
+ * A date component is represented by `ISO8601::Date`.
23
+ * Week date pattern (YYYY-Wdww, YYYY-Www-D).
data/README.md CHANGED
@@ -16,7 +16,7 @@ times) standard.
16
16
  * RBX 2
17
17
 
18
18
 
19
- ## Comments
19
+ ## Comments about this implementation
20
20
 
21
21
  ### Duration sign
22
22
 
@@ -97,6 +97,9 @@ removed in ISO 8601:2004.
97
97
  * A date component is represented by `ISO8601::Date`.
98
98
  * Week date pattern (YYYY-Wdww, YYYY-Www-D).
99
99
 
100
+ Check the [changelog](https://github.com/arnau/ISO8601/blob/master/CHANGELOG.md)
101
+ for a more complete list.
102
+
100
103
 
101
104
  ## TODO
102
105
 
@@ -26,5 +26,5 @@ Gem::Specification.new do |s|
26
26
  s.has_rdoc = 'yard'
27
27
 
28
28
  s.add_development_dependency 'rspec', '~> 2.14'
29
- s.add_development_dependency 'rerun'
29
+ s.add_development_dependency 'rerun', '~> 0'
30
30
  end
@@ -67,6 +67,8 @@ module ISO8601
67
67
  #
68
68
  # @param [String] date_time The ISO representation
69
69
  def parse(date_time)
70
+ raise ISO8601::Errors::UnknownPattern, date_time if date_time.empty?
71
+
70
72
  date, time = date_time.split('T')
71
73
 
72
74
  date_components = parse_date(date)
@@ -1,5 +1,5 @@
1
1
  module ISO8601
2
2
  ##
3
3
  # The gem version
4
- VERSION = '0.5.1'
4
+ VERSION = '0.5.2'
5
5
  end
@@ -4,6 +4,7 @@ require 'spec_helper'
4
4
 
5
5
  describe ISO8601::DateTime do
6
6
  it "should raise a ISO8601::Errors::UnknownPattern for any unknown pattern" do
7
+ expect { ISO8601::DateTime.new('') }.to raise_error(ISO8601::Errors::UnknownPattern)
7
8
  expect { ISO8601::DateTime.new('2') }.to raise_error(ISO8601::Errors::UnknownPattern)
8
9
  expect { ISO8601::DateTime.new('20') }.to raise_error(ISO8601::Errors::UnknownPattern)
9
10
  expect { ISO8601::DateTime.new('201') }.to raise_error(ISO8601::Errors::UnknownPattern)
@@ -2,6 +2,7 @@ require 'spec_helper'
2
2
 
3
3
  describe ISO8601::Date do
4
4
  it "should raise an error for any unknown pattern" do
5
+ expect { ISO8601::Date.new('') }.to raise_error(ISO8601::Errors::UnknownPattern)
5
6
  expect { ISO8601::Date.new('2') }.to raise_error(ISO8601::Errors::UnknownPattern)
6
7
  expect { ISO8601::Date.new('20') }.to raise_error(ISO8601::Errors::UnknownPattern)
7
8
  expect { ISO8601::Date.new('201') }.to raise_error(ISO8601::Errors::UnknownPattern)
@@ -2,6 +2,8 @@ require 'spec_helper'
2
2
 
3
3
  describe ISO8601::Time do
4
4
  it "should raise an error for any unknown pattern" do
5
+ expect { ISO8601::Time.new('') }.to raise_error(ISO8601::Errors::UnknownPattern)
6
+ expect { ISO8601::Time.new('T') }.to raise_error(ISO8601::Errors::UnknownPattern)
5
7
  expect { ISO8601::Time.new('T10:3012+0400') }.to raise_error(ISO8601::Errors::UnknownPattern)
6
8
  expect { ISO8601::Time.new('T10:30:12+0400') }.to raise_error(ISO8601::Errors::UnknownPattern)
7
9
  expect { ISO8601::Time.new('T10:30:12+040') }.to raise_error(ISO8601::Errors::UnknownPattern)
metadata CHANGED
@@ -1,48 +1,54 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: iso8601
3
- version: !ruby/object:Gem::Version
4
- version: 0.5.1
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.5.2
5
5
  platform: ruby
6
- authors:
6
+ authors:
7
7
  - Arnau Siches
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
-
12
- date: 2014-07-27 00:00:00 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
15
- version_requirements: &id001 !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ~>
18
- - !ruby/object:Gem::Version
19
- version: "2.14"
11
+ date: 2014-08-12 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
20
14
  name: rspec
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.14'
21
20
  type: :development
22
- requirement: *id001
23
21
  prerelease: false
24
- - !ruby/object:Gem::Dependency
25
- version_requirements: &id002 !ruby/object:Gem::Requirement
26
- requirements:
27
- - &id003
28
- - ">="
29
- - !ruby/object:Gem::Version
30
- version: "0"
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.14'
27
+ - !ruby/object:Gem::Dependency
31
28
  name: rerun
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
32
34
  type: :development
33
- requirement: *id002
34
35
  prerelease: false
35
- description: " ISO8601 is a simple implementation in Ruby of the ISO 8601 (Data elements and \n interchange formats - Information interchange - Representation of dates \n and times) standard.\n"
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: " ISO8601 is a simple implementation in Ruby of the ISO 8601 (Data
42
+ elements and \n interchange formats - Information interchange - Representation
43
+ of dates \n and times) standard.\n"
36
44
  email: arnau.siches@gmail.com
37
45
  executables: []
38
-
39
46
  extensions: []
40
-
41
47
  extra_rdoc_files: []
42
-
43
- files:
44
- - .gitignore
45
- - .travis.yml
48
+ files:
49
+ - ".gitignore"
50
+ - ".travis.yml"
51
+ - CHANGELOG.md
46
52
  - Gemfile
47
53
  - LICENSE
48
54
  - README.md
@@ -63,29 +69,30 @@ files:
63
69
  - spec/iso8601/time_spec.rb
64
70
  - spec/spec_helper.rb
65
71
  homepage: https://github.com/arnau/ISO8601
66
- licenses:
72
+ licenses:
67
73
  - MIT
68
74
  metadata: {}
69
-
70
75
  post_install_message:
71
76
  rdoc_options: []
72
-
73
- require_paths:
77
+ require_paths:
74
78
  - lib
75
- required_ruby_version: !ruby/object:Gem::Requirement
76
- requirements:
77
- - *id003
78
- required_rubygems_version: !ruby/object:Gem::Requirement
79
- requirements:
80
- - *id003
79
+ required_ruby_version: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
84
+ required_rubygems_version: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
81
89
  requirements: []
82
-
83
90
  rubyforge_project: iso8601
84
91
  rubygems_version: 2.2.2
85
92
  signing_key:
86
93
  specification_version: 4
87
94
  summary: Ruby parser to work with ISO 8601 dateTimes and durations - http://en.wikipedia.org/wiki/ISO_8601
88
- test_files:
95
+ test_files:
89
96
  - spec/iso8601/atoms_spec.rb
90
97
  - spec/iso8601/dateTime_spec.rb
91
98
  - spec/iso8601/date_spec.rb