edtf 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/lib/edtf.rb CHANGED
@@ -29,6 +29,8 @@
29
29
  #++
30
30
 
31
31
  require 'date'
32
+ require 'time'
33
+
32
34
  autoload :Rational, 'rational'
33
35
 
34
36
  require 'forwardable'
@@ -7,4 +7,13 @@
7
7
  # Time.parse(to_s)
8
8
  # end
9
9
  # end
10
- # end
10
+ # end
11
+
12
+
13
+ class DateTime
14
+
15
+ def iso8601
16
+ to_time.iso8601
17
+ end unless method_defined?(:iso8601)
18
+
19
+ end
data/lib/edtf/date.rb CHANGED
@@ -4,7 +4,7 @@ class Date
4
4
  FORMATS = %w{ %04d %02d %02d }.freeze
5
5
 
6
6
  EXTENDED_ATTRIBUTES = %w{ calendar precision uncertain approximate
7
- unspecified }.map(&:intern).freeze
7
+ unspecified }.map(&:to_sym).freeze
8
8
 
9
9
  extend Forwardable
10
10
 
@@ -47,7 +47,7 @@ class Date
47
47
  end
48
48
 
49
49
  def precision=(precision)
50
- precision = precision.intern
50
+ precision = precision.to_sym
51
51
  raise ArgumentError, "invalid precision #{precision.inspect}" unless PRECISIONS.include?(precision)
52
52
  @precision = precision
53
53
  update_precision_filter[-1]
data/lib/edtf/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module EDTF
2
- VERSION = '0.0.4'.freeze
2
+ VERSION = '0.0.5'.freeze
3
3
  end
metadata CHANGED
@@ -1,91 +1,123 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: edtf
3
- version: !ruby/object:Gem::Version
4
- version: 0.0.4
3
+ version: !ruby/object:Gem::Version
4
+ hash: 21
5
5
  prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 5
10
+ version: 0.0.5
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Sylvester Keil
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
- date: 2011-08-21 00:00:00.000000000Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
17
+
18
+ date: 2011-08-21 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
15
21
  name: activesupport
16
- requirement: &2156677080 !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
17
24
  none: false
18
- requirements:
25
+ requirements:
19
26
  - - ~>
20
- - !ruby/object:Gem::Version
21
- version: '3.0'
27
+ - !ruby/object:Gem::Version
28
+ hash: 7
29
+ segments:
30
+ - 3
31
+ - 0
32
+ version: "3.0"
22
33
  type: :runtime
23
- prerelease: false
24
- version_requirements: *2156677080
25
- - !ruby/object:Gem::Dependency
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
26
36
  name: rake
27
- requirement: &2156676480 !ruby/object:Gem::Requirement
37
+ prerelease: false
38
+ requirement: &id002 !ruby/object:Gem::Requirement
28
39
  none: false
29
- requirements:
40
+ requirements:
30
41
  - - ~>
31
- - !ruby/object:Gem::Version
32
- version: '0.9'
42
+ - !ruby/object:Gem::Version
43
+ hash: 25
44
+ segments:
45
+ - 0
46
+ - 9
47
+ version: "0.9"
33
48
  type: :development
34
- prerelease: false
35
- version_requirements: *2156676480
36
- - !ruby/object:Gem::Dependency
49
+ version_requirements: *id002
50
+ - !ruby/object:Gem::Dependency
37
51
  name: racc
38
- requirement: &2156675960 !ruby/object:Gem::Requirement
52
+ prerelease: false
53
+ requirement: &id003 !ruby/object:Gem::Requirement
39
54
  none: false
40
- requirements:
55
+ requirements:
41
56
  - - ~>
42
- - !ruby/object:Gem::Version
43
- version: '1.4'
57
+ - !ruby/object:Gem::Version
58
+ hash: 7
59
+ segments:
60
+ - 1
61
+ - 4
62
+ version: "1.4"
44
63
  type: :development
45
- prerelease: false
46
- version_requirements: *2156675960
47
- - !ruby/object:Gem::Dependency
64
+ version_requirements: *id003
65
+ - !ruby/object:Gem::Dependency
48
66
  name: cucumber
49
- requirement: &2156675420 !ruby/object:Gem::Requirement
67
+ prerelease: false
68
+ requirement: &id004 !ruby/object:Gem::Requirement
50
69
  none: false
51
- requirements:
70
+ requirements:
52
71
  - - ~>
53
- - !ruby/object:Gem::Version
54
- version: '1.0'
72
+ - !ruby/object:Gem::Version
73
+ hash: 15
74
+ segments:
75
+ - 1
76
+ - 0
77
+ version: "1.0"
55
78
  type: :development
56
- prerelease: false
57
- version_requirements: *2156675420
58
- - !ruby/object:Gem::Dependency
79
+ version_requirements: *id004
80
+ - !ruby/object:Gem::Dependency
59
81
  name: rspec
60
- requirement: &2156674860 !ruby/object:Gem::Requirement
82
+ prerelease: false
83
+ requirement: &id005 !ruby/object:Gem::Requirement
61
84
  none: false
62
- requirements:
85
+ requirements:
63
86
  - - ~>
64
- - !ruby/object:Gem::Version
65
- version: '2.6'
87
+ - !ruby/object:Gem::Version
88
+ hash: 15
89
+ segments:
90
+ - 2
91
+ - 6
92
+ version: "2.6"
66
93
  type: :development
67
- prerelease: false
68
- version_requirements: *2156674860
69
- - !ruby/object:Gem::Dependency
94
+ version_requirements: *id005
95
+ - !ruby/object:Gem::Dependency
70
96
  name: ZenTest
71
- requirement: &2156674380 !ruby/object:Gem::Requirement
97
+ prerelease: false
98
+ requirement: &id006 !ruby/object:Gem::Requirement
72
99
  none: false
73
- requirements:
100
+ requirements:
74
101
  - - ~>
75
- - !ruby/object:Gem::Version
76
- version: '4.6'
102
+ - !ruby/object:Gem::Version
103
+ hash: 23
104
+ segments:
105
+ - 4
106
+ - 6
107
+ version: "4.6"
77
108
  type: :development
78
- prerelease: false
79
- version_requirements: *2156674380
109
+ version_requirements: *id006
80
110
  description: An Extended Date/Time Format (EDTF) Parser for Ruby.
81
- email:
111
+ email:
82
112
  - http://sylvester.keil.or.at
83
113
  executables: []
114
+
84
115
  extensions: []
85
- extra_rdoc_files:
116
+
117
+ extra_rdoc_files:
86
118
  - README.md
87
119
  - LICENSE
88
- files:
120
+ files:
89
121
  - .autotest
90
122
  - .gitignore
91
123
  - .rspec
@@ -123,38 +155,45 @@ files:
123
155
  - spec/spec_helper.rb
124
156
  - lib/edtf/parser.rb
125
157
  homepage: http://inukshuk.github.com/edtf-ruby
126
- licenses:
158
+ licenses:
127
159
  - FreeBSD
128
160
  post_install_message:
129
- rdoc_options:
161
+ rdoc_options:
130
162
  - --line-numbers
131
163
  - --inline-source
132
164
  - --title
133
- - ! '"EDTF-Ruby"'
165
+ - "\"EDTF-Ruby\""
134
166
  - --main
135
167
  - README.md
136
168
  - --webcvs=http://github.com/inukshuk/edtf-ruby/tree/master/
137
- require_paths:
169
+ require_paths:
138
170
  - lib
139
- required_ruby_version: !ruby/object:Gem::Requirement
171
+ required_ruby_version: !ruby/object:Gem::Requirement
140
172
  none: false
141
- requirements:
142
- - - ! '>='
143
- - !ruby/object:Gem::Version
144
- version: '0'
145
- required_rubygems_version: !ruby/object:Gem::Requirement
173
+ requirements:
174
+ - - ">="
175
+ - !ruby/object:Gem::Version
176
+ hash: 3
177
+ segments:
178
+ - 0
179
+ version: "0"
180
+ required_rubygems_version: !ruby/object:Gem::Requirement
146
181
  none: false
147
- requirements:
148
- - - ! '>='
149
- - !ruby/object:Gem::Version
150
- version: '0'
182
+ requirements:
183
+ - - ">="
184
+ - !ruby/object:Gem::Version
185
+ hash: 3
186
+ segments:
187
+ - 0
188
+ version: "0"
151
189
  requirements: []
190
+
152
191
  rubyforge_project:
153
- rubygems_version: 1.8.7
192
+ rubygems_version: 1.8.5
154
193
  signing_key:
155
194
  specification_version: 3
156
195
  summary: Extended Date/Time Format for Ruby.
157
- test_files:
196
+ test_files:
158
197
  - features/parser/date_times.feature
159
198
  - features/parser/dates.feature
160
199
  - features/parser/intervals.feature