cosm-rb 0.2.07 → 0.2.09

Sign up to get free protection for your applications and to get access to all the features.
@@ -62,7 +62,7 @@ describe "default datastream xml templates" do
62
62
  Nokogiri.parse(@datastream.generate_xml("0.5.1")).at_xpath("//xmlns:max_value").should be_nil
63
63
  Nokogiri.parse(@datastream.generate_xml("0.5.1")).at_xpath("//xmlns:min_value").should be_nil
64
64
  end
65
-
65
+
66
66
  it "should ignore blank units" do
67
67
  @datastream.unit_symbol = nil
68
68
  @datastream.unit_label = nil
data/spec/spec_helper.rb CHANGED
@@ -2,21 +2,17 @@ require 'rubygems'
2
2
  require 'bundler/setup'
3
3
 
4
4
  require 'rspec'
5
-
5
+ require 'webmock/rspec'
6
6
  require 'time'
7
7
 
8
8
  if !defined?(JRUBY_VERSION)
9
- if RUBY_VERSION < "1.9"
10
- require 'ruby-debug'
11
- else
12
- if ENV["COVERAGE"] == "on"
13
- require 'simplecov'
14
- SimpleCov.start do
15
- add_filter "/spec/"
16
- add_filter "/lib/cosm-rb.rb"
17
- add_filter "/vendor/"
18
- minimum_coverage 100
19
- end
9
+ if ENV["COVERAGE"] == "on"
10
+ require 'simplecov'
11
+ SimpleCov.start do
12
+ add_filter "/spec/"
13
+ add_filter "/lib/cosm-rb.rb"
14
+ add_filter "/vendor/"
15
+ minimum_coverage 100
20
16
  end
21
17
  end
22
18
  end
@@ -16,6 +16,8 @@ RSpec::Matchers.define :contain_feed_eeml_for_version do |eeml_version|
16
16
  environment.at_xpath("//xmlns:icon").content.should == hash["icon"]
17
17
  environment.at_xpath("//xmlns:website").content.should == hash["website"]
18
18
  environment.at_xpath("//xmlns:email").content.should == hash["email"]
19
+ environment.at_xpath("//xmlns:product_id").content.should == hash["product_id"]
20
+ environment.at_xpath("//xmlns:device_serial").content.should == hash["device_serial"]
19
21
  tags = environment.xpath("//xmlns:tag")
20
22
  hash["tags"].split(',').map(&:strip).sort{|a,b| a.downcase <=> b.downcase}.each_with_index do |tag, index|
21
23
  tags[index].content.should == tag
@@ -12,19 +12,19 @@ def datapoint_as_(format, options = {})
12
12
  }
13
13
  when 'xml'
14
14
  data = <<-XML
15
- <?xml version="1.0" encoding="UTF-8"?>
16
- <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">
17
- <environment>
18
- <data>
19
- <datapoints>
20
- <value at="2011-03-02T15:59:56.895922Z">2000</value>
21
- </datapoints>
22
- </data>
23
- </environment>
24
- </eeml>
15
+ <?xml version="1.0" encoding="UTF-8"?>
16
+ <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">
17
+ <environment>
18
+ <data>
19
+ <datapoints>
20
+ <value at="2011-03-02T15:59:56.895922Z">2000</value>
21
+ </datapoints>
22
+ </data>
23
+ </environment>
24
+ </eeml>
25
25
  XML
26
26
  end
27
-
27
+
28
28
  # Add extra options we passed
29
29
  if options[:with]
30
30
  options[:with].each do |field, value|
@@ -33,7 +33,7 @@ def datastream_as_(format, options = {})
33
33
  when 'csv'
34
34
  data = datastream_as_csv(options[:version] || "plain")
35
35
  end
36
-
36
+
37
37
  # Add extra options we passed
38
38
  if options[:with]
39
39
  options[:with].each do |field, value|
@@ -136,88 +136,88 @@ def datastream_as_xml(version, except_node = nil, omit_version = true)
136
136
  when "0.5.1"
137
137
  if except_node == :tag
138
138
  xml = <<XML
139
- <?xml version="1.0" encoding="UTF-8"?>
140
- <eeml xmlns="http://www.eeml.org/xsd/0.5.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" #{omit_version ? '' : '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">
141
- <environment updated="2011-02-16T16:21:01.834174Z" id="504" creator="http://appdev.loc:3000/users/occaecati">
142
- <data id="0">
143
- <current_value at="2011-02-16T16:21:01.834174Z">14</current_value>
144
- <max_value>658.0</max_value>
145
- <min_value>0.0</min_value>
146
- <unit type="derivedSI" symbol="A">Alpha</unit>
147
- </data>
148
- </environment>
139
+ <?xml version="1.0" encoding="UTF-8"?>
140
+ <eeml xmlns="http://www.eeml.org/xsd/0.5.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" #{omit_version ? '' : '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">
141
+ <environment updated="2011-02-16T16:21:01.834174Z" id="504" creator="http://appdev.loc:3000/users/occaecati">
142
+ <data id="0">
143
+ <current_value at="2011-02-16T16:21:01.834174Z">14</current_value>
144
+ <max_value>658.0</max_value>
145
+ <min_value>0.0</min_value>
146
+ <unit type="derivedSI" symbol="A">Alpha</unit>
147
+ </data>
148
+ </environment>
149
149
  </eeml>
150
150
  XML
151
151
  elsif except_node == :unit
152
152
  xml = <<XML
153
- <?xml version="1.0" encoding="UTF-8"?>
154
- <eeml xmlns="http://www.eeml.org/xsd/0.5.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" #{omit_version ? '' : '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">
155
- <environment updated="2011-02-16T16:21:01.834174Z" id="504" creator="http://appdev.loc:3000/users/occaecati">
156
- <data id="0">
157
- <tag>freakin lasers</tag>
158
- <tag>humidity</tag>
159
- <tag>Temperature</tag>
160
- <current_value at="2011-02-16T16:21:01.834174Z">14</current_value>
161
- <max_value>658.0</max_value>
162
- <min_value>0.0</min_value>
163
- </data>
164
- </environment>
153
+ <?xml version="1.0" encoding="UTF-8"?>
154
+ <eeml xmlns="http://www.eeml.org/xsd/0.5.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" #{omit_version ? '' : '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">
155
+ <environment updated="2011-02-16T16:21:01.834174Z" id="504" creator="http://appdev.loc:3000/users/occaecati">
156
+ <data id="0">
157
+ <tag>freakin lasers</tag>
158
+ <tag>humidity</tag>
159
+ <tag>Temperature</tag>
160
+ <current_value at="2011-02-16T16:21:01.834174Z">14</current_value>
161
+ <max_value>658.0</max_value>
162
+ <min_value>0.0</min_value>
163
+ </data>
164
+ </environment>
165
165
  </eeml>
166
166
  XML
167
167
  elsif except_node == :unit_attributes
168
168
  xml = <<XML
169
- <?xml version="1.0" encoding="UTF-8"?>
170
- <eeml xmlns="http://www.eeml.org/xsd/0.5.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" #{omit_version ? '' : '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">
171
- <environment updated="2011-02-16T16:21:01.834174Z" id="504" creator="http://appdev.loc:3000/users/occaecati">
172
- <data id="0">
173
- <tag>freakin lasers</tag>
174
- <tag>humidity</tag>
175
- <tag>Temperature</tag>
176
- <current_value at="2011-02-16T16:21:01.834174Z">14</current_value>
177
- <max_value>658.0</max_value>
178
- <min_value>0.0</min_value>
179
- <unit>Alpha</unit>
180
- </data>
181
- </environment>
169
+ <?xml version="1.0" encoding="UTF-8"?>
170
+ <eeml xmlns="http://www.eeml.org/xsd/0.5.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" #{omit_version ? '' : '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">
171
+ <environment updated="2011-02-16T16:21:01.834174Z" id="504" creator="http://appdev.loc:3000/users/occaecati">
172
+ <data id="0">
173
+ <tag>freakin lasers</tag>
174
+ <tag>humidity</tag>
175
+ <tag>Temperature</tag>
176
+ <current_value at="2011-02-16T16:21:01.834174Z">14</current_value>
177
+ <max_value>658.0</max_value>
178
+ <min_value>0.0</min_value>
179
+ <unit>Alpha</unit>
180
+ </data>
181
+ </environment>
182
182
  </eeml>
183
183
  XML
184
184
  elsif except_node == :timestamps
185
185
  xml = <<XML
186
- <?xml version="1.0" encoding="UTF-8"?>
187
- <eeml xmlns="http://www.eeml.org/xsd/0.5.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" #{omit_version ? '' : '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">
188
- <environment id="504" creator="http://appdev.loc:3000/users/occaecati">
189
- <data id="0">
190
- <tag>freakin lasers</tag>
191
- <tag>humidity</tag>
192
- <tag>Temperature</tag>
193
- <current_value>14</current_value>
194
- <max_value>658.0</max_value>
195
- <min_value>0.0</min_value>
196
- <unit type="derivedSI" symbol="A">Alpha</unit>
197
- </data>
198
- </environment>
186
+ <?xml version="1.0" encoding="UTF-8"?>
187
+ <eeml xmlns="http://www.eeml.org/xsd/0.5.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" #{omit_version ? '' : '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">
188
+ <environment id="504" creator="http://appdev.loc:3000/users/occaecati">
189
+ <data id="0">
190
+ <tag>freakin lasers</tag>
191
+ <tag>humidity</tag>
192
+ <tag>Temperature</tag>
193
+ <current_value>14</current_value>
194
+ <max_value>658.0</max_value>
195
+ <min_value>0.0</min_value>
196
+ <unit type="derivedSI" symbol="A">Alpha</unit>
197
+ </data>
198
+ </environment>
199
199
  </eeml>
200
200
  XML
201
201
  else
202
202
  xml = <<XML
203
- <?xml version="1.0" encoding="UTF-8"?>
204
- <eeml xmlns="http://www.eeml.org/xsd/0.5.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" #{omit_version ? '' : '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">
205
- <environment updated="2011-02-16T16:21:01.834174Z" id="504" creator="http://appdev.loc:3000/users/occaecati">
206
- <data id="0">
207
- <tag>freakin lasers</tag>
208
- <tag>humidity</tag>
209
- <tag>Temperature</tag>
210
- <current_value at="2011-02-16T16:21:01.834174Z">14</current_value>
211
- <max_value>658.0</max_value>
212
- <min_value>0.0</min_value>
213
- <unit type="derivedSI" symbol="A">Alpha</unit>
214
- <datapoints>
215
- <value at="2011-03-02T15:59:56.895922Z">1</value>
216
- <value at="2011-03-02T16:00:07.188648Z">1</value>
217
- <value at="2011-03-02T16:00:18.416500Z">2</value>
203
+ <?xml version="1.0" encoding="UTF-8"?>
204
+ <eeml xmlns="http://www.eeml.org/xsd/0.5.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" #{omit_version ? '' : '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">
205
+ <environment updated="2011-02-16T16:21:01.834174Z" id="504" creator="http://appdev.loc:3000/users/occaecati">
206
+ <data id="0">
207
+ <tag>freakin lasers</tag>
208
+ <tag>humidity</tag>
209
+ <tag>Temperature</tag>
210
+ <current_value at="2011-02-16T16:21:01.834174Z">14</current_value>
211
+ <max_value>658.0</max_value>
212
+ <min_value>0.0</min_value>
213
+ <unit type="derivedSI" symbol="A">Alpha</unit>
214
+ <datapoints>
215
+ <value at="2011-03-02T15:59:56.895922Z">1</value>
216
+ <value at="2011-03-02T16:00:07.188648Z">1</value>
217
+ <value at="2011-03-02T16:00:18.416500Z">2</value>
218
218
  </datapoints>
219
- </data>
220
- </environment>
219
+ </data>
220
+ </environment>
221
221
  </eeml>
222
222
  XML
223
223
  end
@@ -225,87 +225,87 @@ XML
225
225
  if except_node == :tag
226
226
  xml = <<XML
227
227
  <?xml version="1.0" encoding="UTF-8"?>
228
- <eeml xmlns="http://www.eeml.org/xsd/005" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" #{omit_version ? '' : 'version="5"'} xsi:schemaLocation="http://www.eeml.org/xsd/005 http://www.eeml.org/xsd/005/005.xsd">
229
- <environment updated="2011-02-16T16:21:01.834174Z" id="504" creator="http://appdev.loc:3000/users/occaecati">
230
- <data id="0">
231
- <value maxValue="658.0" minValue="658">14</value>
232
- <unit type="derivedSI" symbol="A">Alpha</unit>
233
- </data>
234
- </environment>
228
+ <eeml xmlns="http://www.eeml.org/xsd/005" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" #{omit_version ? '' : 'version="5"'} xsi:schemaLocation="http://www.eeml.org/xsd/005 http://www.eeml.org/xsd/005/005.xsd">
229
+ <environment updated="2011-02-16T16:21:01.834174Z" id="504" creator="http://appdev.loc:3000/users/occaecati">
230
+ <data id="0">
231
+ <value maxValue="658.0" minValue="658">14</value>
232
+ <unit type="derivedSI" symbol="A">Alpha</unit>
233
+ </data>
234
+ </environment>
235
235
  </eeml>
236
236
  XML
237
237
  elsif except_node == :unit
238
238
  xml = <<XML
239
239
  <?xml version="1.0" encoding="UTF-8"?>
240
- <eeml xmlns="http://www.eeml.org/xsd/005" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="5" xsi:schemaLocation="http://www.eeml.org/xsd/005 http://www.eeml.org/xsd/005/005.xsd">
241
- <environment updated="2011-02-16T16:21:01.834174Z" id="504" creator="http://appdev.loc:3000/users/occaecati">
242
- <data id="0">
243
- <tag>freakin lasers</tag>
244
- <tag>humidity</tag>
245
- <tag>Temperature</tag>
246
- <value maxValue="658.0" minValue="658">14</value>
247
- </data>
248
- </environment>
240
+ <eeml xmlns="http://www.eeml.org/xsd/005" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="5" xsi:schemaLocation="http://www.eeml.org/xsd/005 http://www.eeml.org/xsd/005/005.xsd">
241
+ <environment updated="2011-02-16T16:21:01.834174Z" id="504" creator="http://appdev.loc:3000/users/occaecati">
242
+ <data id="0">
243
+ <tag>freakin lasers</tag>
244
+ <tag>humidity</tag>
245
+ <tag>Temperature</tag>
246
+ <value maxValue="658.0" minValue="658">14</value>
247
+ </data>
248
+ </environment>
249
249
  </eeml>
250
250
  XML
251
251
  elsif except_node == :unit_attributes
252
252
  xml = <<XML
253
253
  <?xml version="1.0" encoding="UTF-8"?>
254
- <eeml xmlns="http://www.eeml.org/xsd/005" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" #{omit_version ? '' : 'version="5"'} xsi:schemaLocation="http://www.eeml.org/xsd/005 http://www.eeml.org/xsd/005/005.xsd">
255
- <environment updated="2011-02-16T16:21:01.834174Z" id="504" creator="http://appdev.loc:3000/users/occaecati">
256
- <data id="0">
257
- <tag>freakin lasers</tag>
258
- <tag>humidity</tag>
259
- <tag>Temperature</tag>
260
- <value maxValue="658.0" minValue="658">14</value>
261
- <unit>Alpha</unit>
262
- </data>
263
- </environment>
254
+ <eeml xmlns="http://www.eeml.org/xsd/005" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" #{omit_version ? '' : 'version="5"'} xsi:schemaLocation="http://www.eeml.org/xsd/005 http://www.eeml.org/xsd/005/005.xsd">
255
+ <environment updated="2011-02-16T16:21:01.834174Z" id="504" creator="http://appdev.loc:3000/users/occaecati">
256
+ <data id="0">
257
+ <tag>freakin lasers</tag>
258
+ <tag>humidity</tag>
259
+ <tag>Temperature</tag>
260
+ <value maxValue="658.0" minValue="658">14</value>
261
+ <unit>Alpha</unit>
262
+ </data>
263
+ </environment>
264
264
  </eeml>
265
265
  XML
266
266
  elsif except_node == :value_attributes
267
267
  xml = <<XML
268
268
  <?xml version="1.0" encoding="UTF-8"?>
269
- <eeml xmlns="http://www.eeml.org/xsd/005" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="5" xsi:schemaLocation="http://www.eeml.org/xsd/005 http://www.eeml.org/xsd/005/005.xsd">
270
- <environment updated="2011-02-16T16:21:01.834174Z" id="504" creator="http://appdev.loc:3000/users/occaecati">
271
- <data id="0">
272
- <tag>freakin lasers</tag>
273
- <tag>humidity</tag>
274
- <tag>Temperature</tag>
275
- <value>14</value>
276
- <unit type="derivedSI" symbol="A">Alpha</unit>
277
- </data>
278
- </environment>
269
+ <eeml xmlns="http://www.eeml.org/xsd/005" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="5" xsi:schemaLocation="http://www.eeml.org/xsd/005 http://www.eeml.org/xsd/005/005.xsd">
270
+ <environment updated="2011-02-16T16:21:01.834174Z" id="504" creator="http://appdev.loc:3000/users/occaecati">
271
+ <data id="0">
272
+ <tag>freakin lasers</tag>
273
+ <tag>humidity</tag>
274
+ <tag>Temperature</tag>
275
+ <value>14</value>
276
+ <unit type="derivedSI" symbol="A">Alpha</unit>
277
+ </data>
278
+ </environment>
279
279
  </eeml>
280
280
  XML
281
281
  elsif except_node == :timestamps
282
282
  xml = <<XML
283
283
  <?xml version="1.0" encoding="UTF-8"?>
284
- <eeml xmlns="http://www.eeml.org/xsd/005" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" #{omit_version ? '' : 'version="5"'} xsi:schemaLocation="http://www.eeml.org/xsd/005 http://www.eeml.org/xsd/005/005.xsd">
285
- <environment id="504" creator="http://appdev.loc:3000/users/occaecati">
286
- <data id="0">
287
- <tag>freakin lasers</tag>
288
- <tag>humidity</tag>
289
- <tag>Temperature</tag>
290
- <value maxValue="658.0" minValue="658">14</value>
291
- <unit type="derivedSI" symbol="A">Alpha</unit>
292
- </data>
293
- </environment>
284
+ <eeml xmlns="http://www.eeml.org/xsd/005" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" #{omit_version ? '' : 'version="5"'} xsi:schemaLocation="http://www.eeml.org/xsd/005 http://www.eeml.org/xsd/005/005.xsd">
285
+ <environment id="504" creator="http://appdev.loc:3000/users/occaecati">
286
+ <data id="0">
287
+ <tag>freakin lasers</tag>
288
+ <tag>humidity</tag>
289
+ <tag>Temperature</tag>
290
+ <value maxValue="658.0" minValue="658">14</value>
291
+ <unit type="derivedSI" symbol="A">Alpha</unit>
292
+ </data>
293
+ </environment>
294
294
  </eeml>
295
295
  XML
296
296
  else
297
297
  xml = <<XML
298
298
  <?xml version="1.0" encoding="UTF-8"?>
299
- <eeml xmlns="http://www.eeml.org/xsd/005" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" #{omit_version ? '' : 'version="5"'} xsi:schemaLocation="http://www.eeml.org/xsd/005 http://www.eeml.org/xsd/005/005.xsd">
300
- <environment updated="2011-02-16T16:21:01.834174Z" id="504" creator="http://appdev.loc:3000/users/occaecati">
301
- <data id="0">
302
- <tag>freakin lasers</tag>
303
- <tag>humidity</tag>
304
- <tag>Temperature</tag>
305
- <value maxValue="658.0" minValue="658">14</value>
306
- <unit type="derivedSI" symbol="A">Alpha</unit>
307
- </data>
308
- </environment>
299
+ <eeml xmlns="http://www.eeml.org/xsd/005" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" #{omit_version ? '' : 'version="5"'} xsi:schemaLocation="http://www.eeml.org/xsd/005 http://www.eeml.org/xsd/005/005.xsd">
300
+ <environment updated="2011-02-16T16:21:01.834174Z" id="504" creator="http://appdev.loc:3000/users/occaecati">
301
+ <data id="0">
302
+ <tag>freakin lasers</tag>
303
+ <tag>humidity</tag>
304
+ <tag>Temperature</tag>
305
+ <value maxValue="658.0" minValue="658">14</value>
306
+ <unit type="derivedSI" symbol="A">Alpha</unit>
307
+ </data>
308
+ </environment>
309
309
  </eeml>
310
310
  XML
311
311
  end
@@ -19,6 +19,8 @@ def feed_as_(format, options = {})
19
19
  "email"=>"abc@example.com",
20
20
  "status"=>"live",
21
21
  "creator"=>"http://cosm.com/users/skeletor",
22
+ "product_id" => "product_id",
23
+ "device_serial" => "device_serial",
22
24
  'location_domain' => 'physical',
23
25
  'location_lon' => -0.0807666778564453,
24
26
  'location_disposition' => 'fixed',
@@ -383,194 +385,194 @@ def feed_as_xml(version, except_node = nil, omit_version = false)
383
385
  if except_node == :location
384
386
  xml = <<XML
385
387
  <?xml version="1.0" encoding="UTF-8"?>
386
- <eeml xmlns="http://www.eeml.org/xsd/0.5.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" #{omit_version ? '' : '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">
387
- <environment updated="2011-02-16T16:21:01.834174Z" id="504" creator="http://test.host/users/fred">
388
- <title>Cosm Office environment</title>
389
- <feed>http://test.host/v2/feeds/2357.xml</feed>
388
+ <eeml xmlns="http://www.eeml.org/xsd/0.5.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" #{omit_version ? '' : '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">
389
+ <environment updated="2011-02-16T16:21:01.834174Z" id="504" creator="http://test.host/users/fred">
390
+ <title>Cosm Office environment</title>
391
+ <feed>http://test.host/v2/feeds/2357.xml</feed>
390
392
  <auto_feed_url>http://test.host2/testfeed.xml?q=something</auto_feed_url>
391
- <status>frozen</status>
392
- <description>meh</description>
393
- <website>http://alpha.com</website>
394
- <email>fred@example.com</email>
395
- <private>true</private>
396
- <tag>jag</tag>
397
- <tag>lag</tag>
398
- <tag>mag</tag>
399
- <tag>tag</tag>
393
+ <status>frozen</status>
394
+ <description>meh</description>
395
+ <website>http://alpha.com</website>
396
+ <email>fred@example.com</email>
397
+ <private>true</private>
398
+ <tag>jag</tag>
399
+ <tag>lag</tag>
400
+ <tag>mag</tag>
401
+ <tag>tag</tag>
400
402
  <user>
401
403
  <login>fred</login>
402
404
  </user>
403
- <data id="0">
404
- <tag>freakin lasers</tag>
405
- <tag>humidity</tag>
406
- <tag>Temperature</tag>
407
- <current_value at="2011-02-16T16:21:01.834174Z">14</current_value>
405
+ <data id="0">
406
+ <tag>freakin lasers</tag>
407
+ <tag>humidity</tag>
408
+ <tag>Temperature</tag>
409
+ <current_value at="2011-02-16T16:21:01.834174Z">14</current_value>
408
410
  <max_value>658</max_value>
409
411
  <min_value>54</min_value>
410
- <unit type="derivedSI" symbol="A">Alpha</unit>
411
- <datapoints>
412
- <value at="2011-03-02T15:59:56.895922Z">1</value>
413
- <value at="2011-03-02T16:00:07.188648Z">1</value>
414
- <value at="2011-03-02T16:00:18.416500Z">2</value>
412
+ <unit type="derivedSI" symbol="A">Alpha</unit>
413
+ <datapoints>
414
+ <value at="2011-03-02T15:59:56.895922Z">1</value>
415
+ <value at="2011-03-02T16:00:07.188648Z">1</value>
416
+ <value at="2011-03-02T16:00:18.416500Z">2</value>
415
417
  </datapoints>
416
- </data>
418
+ </data>
417
419
  <data id="1">
418
- <current_value at="2011-02-16T16:21:01.834174Z">14444</current_value>
419
- <unit>Alpha</unit>
420
- </data>
420
+ <current_value at="2011-02-16T16:21:01.834174Z">14444</current_value>
421
+ <unit>Alpha</unit>
422
+ </data>
421
423
  <data id="two">
422
- <max_value>1004</max_value>
423
- <current_value at="2011-02-16T16:21:01.834174Z">14344</current_value>
424
- <unit type="derivedSI">Alpha</unit>
425
- <datapoints>
426
- <value at="2011-03-02T16:00:18.416500Z">2</value>
424
+ <max_value>1004</max_value>
425
+ <current_value at="2011-02-16T16:21:01.834174Z">14344</current_value>
426
+ <unit type="derivedSI">Alpha</unit>
427
+ <datapoints>
428
+ <value at="2011-03-02T16:00:18.416500Z">2</value>
427
429
  </datapoints>
428
- </data>
429
- </environment>
430
+ </data>
431
+ </environment>
430
432
  </eeml>
431
433
  XML
432
434
  elsif except_node == :unit
433
435
  xml = <<XML
434
436
  <?xml version="1.0" encoding="UTF-8"?>
435
- <eeml xmlns="http://www.eeml.org/xsd/0.5.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" #{omit_version ? '' : '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">
436
- <environment updated="2011-02-16T16:21:01.834174Z" id="504" creator="http://test.host/users/fred">
437
- <title>Cosm Office environment</title>
438
- <feed>http://test.host/v2/feeds/2357.xml</feed>
439
- <status>frozen</status>
440
- <description>meh</description>
441
- <website>http://alpha.com</website>
442
- <email>fred@example.com</email>
443
- <private>true</private>
444
- <tag>jag</tag>
445
- <tag>lag</tag>
446
- <tag>mag</tag>
447
- <tag>tag</tag>
448
- <location domain="physical" exposure="indoor" disposition="fixed">
449
- <name>house</name>
450
- <lat>53.3308729830171</lat>
451
- <lon>111.796875</lon>
452
- <ele>2000</ele>
453
- </location>
454
- <data id="0">
455
- <tag>freakin lasers</tag>
456
- <tag>humidity</tag>
457
- <tag>Temperature</tag>
458
- <current_value at="2011-02-16T16:21:01.834174Z">14</current_value>
437
+ <eeml xmlns="http://www.eeml.org/xsd/0.5.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" #{omit_version ? '' : '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">
438
+ <environment updated="2011-02-16T16:21:01.834174Z" id="504" creator="http://test.host/users/fred">
439
+ <title>Cosm Office environment</title>
440
+ <feed>http://test.host/v2/feeds/2357.xml</feed>
441
+ <status>frozen</status>
442
+ <description>meh</description>
443
+ <website>http://alpha.com</website>
444
+ <email>fred@example.com</email>
445
+ <private>true</private>
446
+ <tag>jag</tag>
447
+ <tag>lag</tag>
448
+ <tag>mag</tag>
449
+ <tag>tag</tag>
450
+ <location domain="physical" exposure="indoor" disposition="fixed">
451
+ <name>house</name>
452
+ <lat>53.3308729830171</lat>
453
+ <lon>111.796875</lon>
454
+ <ele>2000</ele>
455
+ </location>
456
+ <data id="0">
457
+ <tag>freakin lasers</tag>
458
+ <tag>humidity</tag>
459
+ <tag>Temperature</tag>
460
+ <current_value at="2011-02-16T16:21:01.834174Z">14</current_value>
459
461
  <max_value>658</max_value>
460
462
  <min_value>54</min_value>
461
- <datapoints>
462
- <value at="2011-03-02T15:59:56.895922Z">1</value>
463
- <value at="2011-03-02T16:00:07.188648Z">1</value>
464
- <value at="2011-03-02T16:00:18.416500Z">2</value>
463
+ <datapoints>
464
+ <value at="2011-03-02T15:59:56.895922Z">1</value>
465
+ <value at="2011-03-02T16:00:07.188648Z">1</value>
466
+ <value at="2011-03-02T16:00:18.416500Z">2</value>
465
467
  </datapoints>
466
- </data>
468
+ </data>
467
469
  <data id="1">
468
- <current_value at="2011-02-16T16:21:01.834174Z">14444</current_value>
469
- </data>
470
+ <current_value at="2011-02-16T16:21:01.834174Z">14444</current_value>
471
+ </data>
470
472
  <data id="two">
471
- <max_value>1004</max_value>
472
- <current_value at="2011-02-16T16:21:01.834174Z">14344</current_value>
473
- <datapoints>
474
- <value at="2011-03-02T16:00:18.416500Z">2</value>
473
+ <max_value>1004</max_value>
474
+ <current_value at="2011-02-16T16:21:01.834174Z">14344</current_value>
475
+ <datapoints>
476
+ <value at="2011-03-02T16:00:18.416500Z">2</value>
475
477
  </datapoints>
476
- </data>
477
- </environment>
478
+ </data>
479
+ </environment>
478
480
  </eeml>
479
481
  XML
480
482
  elsif except_node == :tag
481
483
  xml = <<XML
482
484
  <?xml version="1.0" encoding="UTF-8"?>
483
- <eeml xmlns="http://www.eeml.org/xsd/0.5.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" #{omit_version ? '' : '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">
484
- <environment updated="2011-02-16T16:21:01.834174Z" id="504" creator="http://test.host/users/fred">
485
- <title>Cosm Office environment</title>
486
- <feed>http://test.host/v2/feeds/2357.xml</feed>
487
- <status>frozen</status>
488
- <description>meh</description>
489
- <website>http://alpha.com</website>
490
- <email>fred@example.com</email>
491
- <private>true</private>
492
- <location domain="physical" exposure="indoor" disposition="fixed">
493
- <name>house</name>
494
- <lat>53.3308729830171</lat>
495
- <lon>111.796875</lon>
496
- <ele>2000</ele>
497
- </location>
498
- <data id="0">
499
- <current_value at="2011-02-16T16:21:01.834174Z">14</current_value>
485
+ <eeml xmlns="http://www.eeml.org/xsd/0.5.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" #{omit_version ? '' : '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">
486
+ <environment updated="2011-02-16T16:21:01.834174Z" id="504" creator="http://test.host/users/fred">
487
+ <title>Cosm Office environment</title>
488
+ <feed>http://test.host/v2/feeds/2357.xml</feed>
489
+ <status>frozen</status>
490
+ <description>meh</description>
491
+ <website>http://alpha.com</website>
492
+ <email>fred@example.com</email>
493
+ <private>true</private>
494
+ <location domain="physical" exposure="indoor" disposition="fixed">
495
+ <name>house</name>
496
+ <lat>53.3308729830171</lat>
497
+ <lon>111.796875</lon>
498
+ <ele>2000</ele>
499
+ </location>
500
+ <data id="0">
501
+ <current_value at="2011-02-16T16:21:01.834174Z">14</current_value>
500
502
  <max_value>658</max_value>
501
503
  <min_value>54</min_value>
502
- <unit type="derivedSI" symbol="A">Alpha</unit>
503
- <datapoints>
504
- <value at="2011-03-02T15:59:56.895922Z">1</value>
505
- <value at="2011-03-02T16:00:07.188648Z">1</value>
506
- <value at="2011-03-02T16:00:18.416500Z">2</value>
504
+ <unit type="derivedSI" symbol="A">Alpha</unit>
505
+ <datapoints>
506
+ <value at="2011-03-02T15:59:56.895922Z">1</value>
507
+ <value at="2011-03-02T16:00:07.188648Z">1</value>
508
+ <value at="2011-03-02T16:00:18.416500Z">2</value>
507
509
  </datapoints>
508
- </data>
510
+ </data>
509
511
  <data id="1">
510
- <current_value at="2011-02-16T16:21:01.834174Z">14444</current_value>
511
- <unit>Alpha</unit>
512
- </data>
512
+ <current_value at="2011-02-16T16:21:01.834174Z">14444</current_value>
513
+ <unit>Alpha</unit>
514
+ </data>
513
515
  <data id="two">
514
- <max_value>1004</max_value>
515
- <current_value at="2011-02-16T16:21:01.834174Z">14344</current_value>
516
- <unit type="derivedSI">Alpha</unit>
517
- <datapoints>
518
- <value at="2011-03-02T16:00:18.416500Z">2</value>
516
+ <max_value>1004</max_value>
517
+ <current_value at="2011-02-16T16:21:01.834174Z">14344</current_value>
518
+ <unit type="derivedSI">Alpha</unit>
519
+ <datapoints>
520
+ <value at="2011-03-02T16:00:18.416500Z">2</value>
519
521
  </datapoints>
520
- </data>
521
- </environment>
522
+ </data>
523
+ </environment>
522
524
  </eeml>
523
525
  XML
524
526
 
525
527
  else
526
528
  xml = <<XML
527
529
  <?xml version="1.0" encoding="UTF-8"?>
528
- <eeml xmlns="http://www.eeml.org/xsd/0.5.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" #{omit_version ? '' : '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">
529
- <environment updated="2011-02-16T16:21:01.834174Z" id="504" creator="http://test.host/users/fred">
530
- <title>Cosm Office environment</title>
531
- <feed>http://test.host/v2/feeds/2357.xml</feed>
532
- <status>frozen</status>
533
- <description>meh</description>
534
- <website>http://alpha.com</website>
535
- <email>fred@example.com</email>
536
- <private>true</private>
537
- <tag>jag</tag>
538
- <tag>lag</tag>
539
- <tag>mag</tag>
540
- <tag>tag</tag>
541
- <location domain="physical" exposure="indoor" disposition="fixed">
542
- <name>house</name>
543
- <lat>53.3308729830171</lat>
544
- <lon>111.796875</lon>
545
- <ele>2000</ele>
546
- </location>
547
- <data id="0">
548
- <tag>freakin lasers</tag>
549
- <tag>humidity</tag>
550
- <tag>Temperature</tag>
551
- <current_value at="2011-02-16T16:21:01.834174Z">14</current_value>
530
+ <eeml xmlns="http://www.eeml.org/xsd/0.5.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" #{omit_version ? '' : '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">
531
+ <environment updated="2011-02-16T16:21:01.834174Z" id="504" creator="http://test.host/users/fred">
532
+ <title>Cosm Office environment</title>
533
+ <feed>http://test.host/v2/feeds/2357.xml</feed>
534
+ <status>frozen</status>
535
+ <description>meh</description>
536
+ <website>http://alpha.com</website>
537
+ <email>fred@example.com</email>
538
+ <private>true</private>
539
+ <tag>jag</tag>
540
+ <tag>lag</tag>
541
+ <tag>mag</tag>
542
+ <tag>tag</tag>
543
+ <location domain="physical" exposure="indoor" disposition="fixed">
544
+ <name>house</name>
545
+ <lat>53.3308729830171</lat>
546
+ <lon>111.796875</lon>
547
+ <ele>2000</ele>
548
+ </location>
549
+ <data id="0">
550
+ <tag>freakin lasers</tag>
551
+ <tag>humidity</tag>
552
+ <tag>Temperature</tag>
553
+ <current_value at="2011-02-16T16:21:01.834174Z">14</current_value>
552
554
  <max_value>658</max_value>
553
555
  <min_value>54</min_value>
554
- <unit type="derivedSI" symbol="A">Alpha</unit>
555
- <datapoints>
556
- <value at="2011-03-02T15:59:56.895922Z">1</value>
557
- <value at="2011-03-02T16:00:07.188648Z">1</value>
558
- <value at="2011-03-02T16:00:18.416500Z">2</value>
556
+ <unit type="derivedSI" symbol="A">Alpha</unit>
557
+ <datapoints>
558
+ <value at="2011-03-02T15:59:56.895922Z">1</value>
559
+ <value at="2011-03-02T16:00:07.188648Z">1</value>
560
+ <value at="2011-03-02T16:00:18.416500Z">2</value>
559
561
  </datapoints>
560
- </data>
562
+ </data>
561
563
  <data id="1">
562
- <current_value at="2011-02-16T16:21:01.834174Z">14444</current_value>
563
- <unit>Alpha</unit>
564
- </data>
564
+ <current_value at="2011-02-16T16:21:01.834174Z">14444</current_value>
565
+ <unit>Alpha</unit>
566
+ </data>
565
567
  <data id="two">
566
- <max_value>1004</max_value>
567
- <current_value at="2011-02-16T16:21:01.834174Z">14344</current_value>
568
- <unit type="derivedSI">Alpha</unit>
569
- <datapoints>
570
- <value at="2011-03-02T16:00:18.416500Z">2</value>
568
+ <max_value>1004</max_value>
569
+ <current_value at="2011-02-16T16:21:01.834174Z">14344</current_value>
570
+ <unit type="derivedSI">Alpha</unit>
571
+ <datapoints>
572
+ <value at="2011-03-02T16:00:18.416500Z">2</value>
571
573
  </datapoints>
572
- </data>
573
- </environment>
574
+ </data>
575
+ </environment>
574
576
  </eeml>
575
577
  XML
576
578
  end
@@ -578,199 +580,199 @@ XML
578
580
  if except_node == :location
579
581
  xml = <<XML
580
582
  <?xml version="1.0" encoding="UTF-8"?>
581
- <eeml xmlns="http://www.eeml.org/xsd/005" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" #{omit_version ? '' : 'version="5"'} xsi:schemaLocation="http://www.eeml.org/xsd/005 http://www.eeml.org/xsd/005/005.xsd">
582
- <environment updated="2011-02-16T16:21:01.834174Z" id="504" creator="http://test.host/users/fred">
583
- <title>Cosm Office environment</title>
584
- <feed>http://test.host/v2/feeds/2357.xml</feed>
585
- <status>frozen</status>
586
- <description>meh</description>
587
- <website>http://alpha.com</website>
588
- <email>fred@example.com</email>
589
- <data id="0">
590
- <tag>freakin lasers</tag>
591
- <tag>humidity</tag>
592
- <tag>Temperature</tag>
593
- <value maxValue="658.0" minValue="658">14</value>
594
- <unit type="derivedSI" symbol="A">Alpha</unit>
595
- </data>
583
+ <eeml xmlns="http://www.eeml.org/xsd/005" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" #{omit_version ? '' : 'version="5"'} xsi:schemaLocation="http://www.eeml.org/xsd/005 http://www.eeml.org/xsd/005/005.xsd">
584
+ <environment updated="2011-02-16T16:21:01.834174Z" id="504" creator="http://test.host/users/fred">
585
+ <title>Cosm Office environment</title>
586
+ <feed>http://test.host/v2/feeds/2357.xml</feed>
587
+ <status>frozen</status>
588
+ <description>meh</description>
589
+ <website>http://alpha.com</website>
590
+ <email>fred@example.com</email>
591
+ <data id="0">
592
+ <tag>freakin lasers</tag>
593
+ <tag>humidity</tag>
594
+ <tag>Temperature</tag>
595
+ <value maxValue="658.0" minValue="658">14</value>
596
+ <unit type="derivedSI" symbol="A">Alpha</unit>
597
+ </data>
596
598
  <data id="1">
597
- <value>14</value>
598
- <unit>Alpha</unit>
599
- </data>
599
+ <value>14</value>
600
+ <unit>Alpha</unit>
601
+ </data>
600
602
  <data id="two">
601
- <value maxValue="658.0">1004</value>
602
- <unit type="derivedSI">Alpha</unit>
603
- </data>
604
- </environment>
603
+ <value maxValue="658.0">1004</value>
604
+ <unit type="derivedSI">Alpha</unit>
605
+ </data>
606
+ </environment>
605
607
  </eeml>
606
608
  XML
607
609
  elsif except_node == :unit
608
610
  xml = <<XML
609
611
  <?xml version="1.0" encoding="UTF-8"?>
610
- <eeml xmlns="http://www.eeml.org/xsd/005" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" #{omit_version ? '' : 'version="5"'} xsi:schemaLocation="http://www.eeml.org/xsd/005 http://www.eeml.org/xsd/005/005.xsd">
611
- <environment updated="2011-02-16T16:21:01.834174Z" id="504" creator="http://test.host/users/fred">
612
- <title>Cosm Office environment</title>
613
- <feed>http://test.host/v2/feeds/2357.xml</feed>
614
- <status>frozen</status>
615
- <description>meh</description>
616
- <website>http://alpha.com</website>
617
- <email>fred@example.com</email>
618
- <location domain="physical" exposure="indoor" disposition="fixed">
619
- <name>house</name>
620
- <lat>53.3308729830171</lat>
621
- <lon>111.796875</lon>
622
- <ele>2000</ele>
623
- </location>
624
- <data id="0">
625
- <tag>freakin lasers</tag>
626
- <tag>humidity</tag>
627
- <tag>Temperature</tag>
628
- <value maxValue="658.0" minValue="658">14</value>
629
- </data>
612
+ <eeml xmlns="http://www.eeml.org/xsd/005" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" #{omit_version ? '' : 'version="5"'} xsi:schemaLocation="http://www.eeml.org/xsd/005 http://www.eeml.org/xsd/005/005.xsd">
613
+ <environment updated="2011-02-16T16:21:01.834174Z" id="504" creator="http://test.host/users/fred">
614
+ <title>Cosm Office environment</title>
615
+ <feed>http://test.host/v2/feeds/2357.xml</feed>
616
+ <status>frozen</status>
617
+ <description>meh</description>
618
+ <website>http://alpha.com</website>
619
+ <email>fred@example.com</email>
620
+ <location domain="physical" exposure="indoor" disposition="fixed">
621
+ <name>house</name>
622
+ <lat>53.3308729830171</lat>
623
+ <lon>111.796875</lon>
624
+ <ele>2000</ele>
625
+ </location>
626
+ <data id="0">
627
+ <tag>freakin lasers</tag>
628
+ <tag>humidity</tag>
629
+ <tag>Temperature</tag>
630
+ <value maxValue="658.0" minValue="658">14</value>
631
+ </data>
630
632
  <data id="1">
631
- <value>14</value>
632
- </data>
633
+ <value>14</value>
634
+ </data>
633
635
  <data id="two">
634
- <value maxValue="658.0">1004</value>
635
- </data>
636
- </environment>
636
+ <value maxValue="658.0">1004</value>
637
+ </data>
638
+ </environment>
637
639
  </eeml>
638
640
  XML
639
641
  elsif except_node == :unit_attributes
640
642
  xml = <<XML
641
643
  <?xml version="1.0" encoding="UTF-8"?>
642
- <eeml xmlns="http://www.eeml.org/xsd/005" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" #{omit_version ? '' : 'version="5"'} xsi:schemaLocation="http://www.eeml.org/xsd/005 http://www.eeml.org/xsd/005/005.xsd">
643
- <environment updated="2011-02-16T16:21:01.834174Z" id="504" creator="http://test.host/users/fred">
644
- <title>Cosm Office environment</title>
645
- <feed>http://test.host/v2/feeds/2357.xml</feed>
646
- <status>frozen</status>
647
- <description>meh</description>
648
- <website>http://alpha.com</website>
649
- <email>fred@example.com</email>
650
- <location domain="physical" exposure="indoor" disposition="fixed">
651
- <name>house</name>
652
- <lat>53.3308729830171</lat>
653
- <lon>111.796875</lon>
654
- <ele>2000</ele>
655
- </location>
656
- <data id="0">
657
- <tag>freakin lasers</tag>
658
- <tag>humidity</tag>
659
- <tag>Temperature</tag>
660
- <value maxValue="658.0" minValue="658">14</value>
661
- <unit>Alpha</unit>
662
- </data>
644
+ <eeml xmlns="http://www.eeml.org/xsd/005" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" #{omit_version ? '' : 'version="5"'} xsi:schemaLocation="http://www.eeml.org/xsd/005 http://www.eeml.org/xsd/005/005.xsd">
645
+ <environment updated="2011-02-16T16:21:01.834174Z" id="504" creator="http://test.host/users/fred">
646
+ <title>Cosm Office environment</title>
647
+ <feed>http://test.host/v2/feeds/2357.xml</feed>
648
+ <status>frozen</status>
649
+ <description>meh</description>
650
+ <website>http://alpha.com</website>
651
+ <email>fred@example.com</email>
652
+ <location domain="physical" exposure="indoor" disposition="fixed">
653
+ <name>house</name>
654
+ <lat>53.3308729830171</lat>
655
+ <lon>111.796875</lon>
656
+ <ele>2000</ele>
657
+ </location>
658
+ <data id="0">
659
+ <tag>freakin lasers</tag>
660
+ <tag>humidity</tag>
661
+ <tag>Temperature</tag>
662
+ <value maxValue="658.0" minValue="658">14</value>
663
+ <unit>Alpha</unit>
664
+ </data>
663
665
  <data id="1">
664
- <value>14</value>
665
- <unit>Alpha</unit>
666
- </data>
666
+ <value>14</value>
667
+ <unit>Alpha</unit>
668
+ </data>
667
669
  <data id="two">
668
- <value maxValue="658.0">1004</value>
669
- <unit>Alpha</unit>
670
- </data>
671
- </environment>
670
+ <value maxValue="658.0">1004</value>
671
+ <unit>Alpha</unit>
672
+ </data>
673
+ </environment>
672
674
  </eeml>
673
675
  XML
674
676
  elsif except_node == :value_attributes
675
677
  xml = <<XML
676
678
  <?xml version="1.0" encoding="UTF-8"?>
677
- <eeml xmlns="http://www.eeml.org/xsd/005" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" #{omit_version ? '' : 'version="5"'} xsi:schemaLocation="http://www.eeml.org/xsd/005 http://www.eeml.org/xsd/005/005.xsd">
678
- <environment updated="2011-02-16T16:21:01.834174Z" id="504" creator="http://test.host/users/fred">
679
- <title>Cosm Office environment</title>
680
- <feed>http://test.host/v2/feeds/2357.xml</feed>
681
- <status>frozen</status>
682
- <description>meh</description>
683
- <website>http://alpha.com</website>
684
- <email>fred@example.com</email>
685
- <location domain="physical" exposure="indoor" disposition="fixed">
686
- <name>house</name>
687
- <lat>53.3308729830171</lat>
688
- <lon>111.796875</lon>
689
- <ele>2000</ele>
690
- </location>
691
- <data id="0">
692
- <tag>freakin lasers</tag>
693
- <tag>humidity</tag>
694
- <tag>Temperature</tag>
695
- <value>14</value>
696
- <unit type="derivedSI" symbol="A">Alpha</unit>
697
- </data>
679
+ <eeml xmlns="http://www.eeml.org/xsd/005" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" #{omit_version ? '' : 'version="5"'} xsi:schemaLocation="http://www.eeml.org/xsd/005 http://www.eeml.org/xsd/005/005.xsd">
680
+ <environment updated="2011-02-16T16:21:01.834174Z" id="504" creator="http://test.host/users/fred">
681
+ <title>Cosm Office environment</title>
682
+ <feed>http://test.host/v2/feeds/2357.xml</feed>
683
+ <status>frozen</status>
684
+ <description>meh</description>
685
+ <website>http://alpha.com</website>
686
+ <email>fred@example.com</email>
687
+ <location domain="physical" exposure="indoor" disposition="fixed">
688
+ <name>house</name>
689
+ <lat>53.3308729830171</lat>
690
+ <lon>111.796875</lon>
691
+ <ele>2000</ele>
692
+ </location>
693
+ <data id="0">
694
+ <tag>freakin lasers</tag>
695
+ <tag>humidity</tag>
696
+ <tag>Temperature</tag>
697
+ <value>14</value>
698
+ <unit type="derivedSI" symbol="A">Alpha</unit>
699
+ </data>
698
700
  <data id="1">
699
- <value>14</value>
700
- <unit>Alpha</unit>
701
- </data>
701
+ <value>14</value>
702
+ <unit>Alpha</unit>
703
+ </data>
702
704
  <data id="two">
703
- <value>1004</value>
704
- <unit type="derivedSI">Alpha</unit>
705
- </data>
706
- </environment>
705
+ <value>1004</value>
706
+ <unit type="derivedSI">Alpha</unit>
707
+ </data>
708
+ </environment>
707
709
  </eeml>
708
710
  XML
709
711
  elsif except_node == :tag
710
712
  xml = <<XML
711
713
  <?xml version="1.0" encoding="UTF-8"?>
712
- <eeml xmlns="http://www.eeml.org/xsd/005" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" #{omit_version ? '' : 'version="5"'} xsi:schemaLocation="http://www.eeml.org/xsd/005 http://www.eeml.org/xsd/005/005.xsd">
713
- <environment updated="2011-02-16T16:21:01.834174Z" id="504" creator="http://test.host/users/fred">
714
- <title>Cosm Office environment</title>
715
- <feed>http://test.host/v2/feeds/2357.xml</feed>
716
- <status>frozen</status>
717
- <description>meh</description>
718
- <website>http://alpha.com</website>
719
- <email>fred@example.com</email>
720
- <location domain="physical" exposure="indoor" disposition="fixed">
721
- <name>house</name>
722
- <lat>53.3308729830171</lat>
723
- <lon>111.796875</lon>
724
- <ele>2000</ele>
725
- </location>
726
- <data id="0">
727
- <value maxValue="658.0" minValue="658">14</value>
728
- <unit type="derivedSI" symbol="A">Alpha</unit>
729
- </data>
714
+ <eeml xmlns="http://www.eeml.org/xsd/005" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" #{omit_version ? '' : 'version="5"'} xsi:schemaLocation="http://www.eeml.org/xsd/005 http://www.eeml.org/xsd/005/005.xsd">
715
+ <environment updated="2011-02-16T16:21:01.834174Z" id="504" creator="http://test.host/users/fred">
716
+ <title>Cosm Office environment</title>
717
+ <feed>http://test.host/v2/feeds/2357.xml</feed>
718
+ <status>frozen</status>
719
+ <description>meh</description>
720
+ <website>http://alpha.com</website>
721
+ <email>fred@example.com</email>
722
+ <location domain="physical" exposure="indoor" disposition="fixed">
723
+ <name>house</name>
724
+ <lat>53.3308729830171</lat>
725
+ <lon>111.796875</lon>
726
+ <ele>2000</ele>
727
+ </location>
728
+ <data id="0">
729
+ <value maxValue="658.0" minValue="658">14</value>
730
+ <unit type="derivedSI" symbol="A">Alpha</unit>
731
+ </data>
730
732
  <data id="1">
731
- <value>14</value>
732
- <unit>Alpha</unit>
733
- </data>
733
+ <value>14</value>
734
+ <unit>Alpha</unit>
735
+ </data>
734
736
  <data id="two">
735
- <value maxValue="658.0">1004</value>
736
- <unit type="derivedSI">Alpha</unit>
737
- </data>
738
- </environment>
737
+ <value maxValue="658.0">1004</value>
738
+ <unit type="derivedSI">Alpha</unit>
739
+ </data>
740
+ </environment>
739
741
  </eeml>
740
742
  XML
741
743
  else
742
744
  xml = <<XML
743
745
  <?xml version="1.0" encoding="UTF-8"?>
744
- <eeml xmlns="http://www.eeml.org/xsd/005" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" #{omit_version ? '' : 'version="5"'} xsi:schemaLocation="http://www.eeml.org/xsd/005 http://www.eeml.org/xsd/005/005.xsd">
745
- <environment updated="2011-02-16T16:21:01.834174Z" id="504" creator="http://test.host/users/fred">
746
- <title>Cosm Office environment</title>
747
- <feed>http://test.host/v2/feeds/2357.xml</feed>
748
- <status>frozen</status>
749
- <description>meh</description>
750
- <website>http://alpha.com</website>
751
- <email>fred@example.com</email>
752
- <location domain="physical" exposure="indoor" disposition="fixed">
753
- <name>house</name>
754
- <lat>53.3308729830171</lat>
755
- <lon>111.796875</lon>
756
- <ele>2000</ele>
757
- </location>
758
- <data id="0">
759
- <tag>freakin lasers</tag>
760
- <tag>humidity</tag>
761
- <tag>Temperature</tag>
762
- <value maxValue="658.0" minValue="658">14</value>
763
- <unit type="derivedSI" symbol="A">Alpha</unit>
764
- </data>
746
+ <eeml xmlns="http://www.eeml.org/xsd/005" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" #{omit_version ? '' : 'version="5"'} xsi:schemaLocation="http://www.eeml.org/xsd/005 http://www.eeml.org/xsd/005/005.xsd">
747
+ <environment updated="2011-02-16T16:21:01.834174Z" id="504" creator="http://test.host/users/fred">
748
+ <title>Cosm Office environment</title>
749
+ <feed>http://test.host/v2/feeds/2357.xml</feed>
750
+ <status>frozen</status>
751
+ <description>meh</description>
752
+ <website>http://alpha.com</website>
753
+ <email>fred@example.com</email>
754
+ <location domain="physical" exposure="indoor" disposition="fixed">
755
+ <name>house</name>
756
+ <lat>53.3308729830171</lat>
757
+ <lon>111.796875</lon>
758
+ <ele>2000</ele>
759
+ </location>
760
+ <data id="0">
761
+ <tag>freakin lasers</tag>
762
+ <tag>humidity</tag>
763
+ <tag>Temperature</tag>
764
+ <value maxValue="658.0" minValue="658">14</value>
765
+ <unit type="derivedSI" symbol="A">Alpha</unit>
766
+ </data>
765
767
  <data id="1">
766
- <value>14</value>
767
- <unit>Alpha</unit>
768
- </data>
768
+ <value>14</value>
769
+ <unit>Alpha</unit>
770
+ </data>
769
771
  <data id="two">
770
- <value maxValue="658.0">1004</value>
771
- <unit type="derivedSI">Alpha</unit>
772
- </data>
773
- </environment>
772
+ <value maxValue="658.0">1004</value>
773
+ <unit type="derivedSI">Alpha</unit>
774
+ </data>
775
+ </environment>
774
776
  </eeml>
775
777
  XML
776
778
  end