cosm-rb 0.2.01 → 0.2.02

Sign up to get free protection for your applications and to get access to all the features.
@@ -86,9 +86,10 @@ module Cosm
86
86
  end
87
87
 
88
88
  def _extract_datapoint(xml)
89
+ value = convert_to_hash(xml)
89
90
  {
90
- :at => strip(xml,'at'),
91
- :value => strip(xml,'__content__')
91
+ :at => strip(value,'at'),
92
+ :value => strip(value,'__content__')
92
93
  }
93
94
  end
94
95
 
@@ -1,3 +1,3 @@
1
1
  module Cosm #:nodoc:
2
- VERSION = '0.2.01'
2
+ VERSION = '0.2.02'
3
3
  end
@@ -123,5 +123,26 @@ XML
123
123
  Cosm::Datastream.new("This is not xml", :v2, :xml)
124
124
  }.to raise_error(Cosm::Parsers::XML::InvalidXMLError)
125
125
  end
126
+
127
+ it "should handle being passed xml containing datapoints with no timestamp" do
128
+ xml = <<-XML
129
+ <eeml xmlns="http://www.eeml.org/xsd/0.5.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="0.5.1" xsi:schemaLocation="http://www.eeml.org/xsd/0.5.1 http://www.eeml.org/xsd/0.5.1/0.5.1.xsd">
130
+ <environment>
131
+ <data>
132
+ <datapoints>
133
+ <value at="2010-05-20T11:01:43Z">294</value>
134
+ <value>295</value>
135
+ <value at="2010-05-20T11:01:45Z">296</value>
136
+ <value at="2010-05-20T11:01:46Z">297</value>
137
+ </datapoints>
138
+ </data>
139
+ </environment>
140
+ </eeml>
141
+ XML
142
+
143
+ expect {
144
+ Cosm::Datastream.new(xml)
145
+ }.to_not raise_error
146
+ end
126
147
  end
127
148
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cosm-rb
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 1
10
- version: 0.2.01
9
+ - 2
10
+ version: 0.2.02
11
11
  platform: ruby
12
12
  authors:
13
13
  - Paul Bellamy
@@ -17,11 +17,13 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2012-09-11 00:00:00 +00:00
20
+ date: 2012-09-12 00:00:00 +00:00
21
21
  default_executable:
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency
24
- version_requirements: &id001 !ruby/object:Gem::Requirement
24
+ name: multi_json
25
+ prerelease: false
26
+ requirement: &id001 !ruby/object:Gem::Requirement
25
27
  none: false
26
28
  requirements:
27
29
  - - ">="
@@ -32,12 +34,12 @@ dependencies:
32
34
  - 3
33
35
  - 6
34
36
  version: 1.3.6
35
- requirement: *id001
36
37
  type: :runtime
37
- name: multi_json
38
- prerelease: false
38
+ version_requirements: *id001
39
39
  - !ruby/object:Gem::Dependency
40
- version_requirements: &id002 !ruby/object:Gem::Requirement
40
+ name: multi_xml
41
+ prerelease: false
42
+ requirement: &id002 !ruby/object:Gem::Requirement
41
43
  none: false
42
44
  requirements:
43
45
  - - ">="
@@ -48,12 +50,12 @@ dependencies:
48
50
  - 5
49
51
  - 1
50
52
  version: 0.5.1
51
- requirement: *id002
52
53
  type: :runtime
53
- name: multi_xml
54
- prerelease: false
54
+ version_requirements: *id002
55
55
  - !ruby/object:Gem::Dependency
56
- version_requirements: &id003 !ruby/object:Gem::Requirement
56
+ name: yajl-ruby
57
+ prerelease: false
58
+ requirement: &id003 !ruby/object:Gem::Requirement
57
59
  none: false
58
60
  requirements:
59
61
  - - ">="
@@ -64,12 +66,12 @@ dependencies:
64
66
  - 1
65
67
  - 0
66
68
  version: 1.1.0
67
- requirement: *id003
68
69
  type: :runtime
69
- name: yajl-ruby
70
- prerelease: false
70
+ version_requirements: *id003
71
71
  - !ruby/object:Gem::Dependency
72
- version_requirements: &id004 !ruby/object:Gem::Requirement
72
+ name: nokogiri
73
+ prerelease: false
74
+ requirement: &id004 !ruby/object:Gem::Requirement
73
75
  none: false
74
76
  requirements:
75
77
  - - ">="
@@ -80,12 +82,12 @@ dependencies:
80
82
  - 4
81
83
  - 4
82
84
  version: 1.4.4
83
- requirement: *id004
84
85
  type: :runtime
85
- name: nokogiri
86
- prerelease: false
86
+ version_requirements: *id004
87
87
  - !ruby/object:Gem::Dependency
88
- version_requirements: &id005 !ruby/object:Gem::Requirement
88
+ name: httparty
89
+ prerelease: false
90
+ requirement: &id005 !ruby/object:Gem::Requirement
89
91
  none: false
90
92
  requirements:
91
93
  - - ">="
@@ -96,12 +98,12 @@ dependencies:
96
98
  - 8
97
99
  - 3
98
100
  version: 0.8.3
99
- requirement: *id005
100
101
  type: :runtime
101
- name: httparty
102
- prerelease: false
102
+ version_requirements: *id005
103
103
  - !ruby/object:Gem::Dependency
104
- version_requirements: &id006 !ruby/object:Gem::Requirement
104
+ name: fastercsv
105
+ prerelease: false
106
+ requirement: &id006 !ruby/object:Gem::Requirement
105
107
  none: false
106
108
  requirements:
107
109
  - - ">="
@@ -112,12 +114,12 @@ dependencies:
112
114
  - 5
113
115
  - x
114
116
  version: 1.5.x
115
- requirement: *id006
116
117
  type: :runtime
117
- name: fastercsv
118
- prerelease: false
118
+ version_requirements: *id006
119
119
  - !ruby/object:Gem::Dependency
120
- version_requirements: &id007 !ruby/object:Gem::Requirement
120
+ name: ox
121
+ prerelease: false
122
+ requirement: &id007 !ruby/object:Gem::Requirement
121
123
  none: false
122
124
  requirements:
123
125
  - - ">="
@@ -128,12 +130,12 @@ dependencies:
128
130
  - 5
129
131
  - 9
130
132
  version: 1.5.9
131
- requirement: *id007
132
133
  type: :runtime
133
- name: ox
134
- prerelease: false
134
+ version_requirements: *id007
135
135
  - !ruby/object:Gem::Dependency
136
- version_requirements: &id008 !ruby/object:Gem::Requirement
136
+ name: ruby-debug
137
+ prerelease: false
138
+ requirement: &id008 !ruby/object:Gem::Requirement
137
139
  none: false
138
140
  requirements:
139
141
  - - ">="
@@ -142,12 +144,12 @@ dependencies:
142
144
  segments:
143
145
  - 0
144
146
  version: "0"
145
- requirement: *id008
146
147
  type: :development
147
- name: ruby-debug
148
- prerelease: false
148
+ version_requirements: *id008
149
149
  - !ruby/object:Gem::Dependency
150
- version_requirements: &id009 !ruby/object:Gem::Requirement
150
+ name: rcov
151
+ prerelease: false
152
+ requirement: &id009 !ruby/object:Gem::Requirement
151
153
  none: false
152
154
  requirements:
153
155
  - - ">="
@@ -158,12 +160,12 @@ dependencies:
158
160
  - 9
159
161
  - 9
160
162
  version: 0.9.9
161
- requirement: *id009
162
163
  type: :development
163
- name: rcov
164
- prerelease: false
164
+ version_requirements: *id009
165
165
  - !ruby/object:Gem::Dependency
166
- version_requirements: &id010 !ruby/object:Gem::Requirement
166
+ name: rake
167
+ prerelease: false
168
+ requirement: &id010 !ruby/object:Gem::Requirement
167
169
  none: false
168
170
  requirements:
169
171
  - - "="
@@ -174,12 +176,12 @@ dependencies:
174
176
  - 8
175
177
  - 7
176
178
  version: 0.8.7
177
- requirement: *id010
178
179
  type: :development
179
- name: rake
180
- prerelease: false
180
+ version_requirements: *id010
181
181
  - !ruby/object:Gem::Dependency
182
- version_requirements: &id011 !ruby/object:Gem::Requirement
182
+ name: rspec
183
+ prerelease: false
184
+ requirement: &id011 !ruby/object:Gem::Requirement
183
185
  none: false
184
186
  requirements:
185
187
  - - "="
@@ -190,10 +192,8 @@ dependencies:
190
192
  - 6
191
193
  - 0
192
194
  version: 2.6.0
193
- requirement: *id011
194
195
  type: :development
195
- name: rspec
196
- prerelease: false
196
+ version_requirements: *id011
197
197
  description: A library for communicating with the Cosm REST API, parsing and rendering Cosm feed formats
198
198
  email:
199
199
  - paul.a.bellamy@gmail.com