eeml 0.0.32 → 0.0.33

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.
data/CHANGELOG CHANGED
@@ -1,3 +1,11 @@
1
+ commit 3ff4ebaa57c67011da5e8942c390a767108b9526
2
+ Author: Levent Ali <lebreeze@gmail.com>
3
+ Date: Mon Feb 14 13:55:21 2011 +0000
4
+
5
+ Version 0.0.33
6
+
7
+ Current value is now optional on eeml 0.5.1
8
+
1
9
  commit 750283de4b56996f05adae5bc02f992c56af4ef5
2
10
  Author: Paul Bellamy <paul@connectedenvironments.com>
3
11
  Date: Mon Jan 17 10:30:15 2011 +0000
@@ -151,7 +151,7 @@ module Eeml
151
151
  end
152
152
 
153
153
  value_nodes = node.find('x:current_value', "x:#{@@eeml_version[:href]}")
154
- raise exception_for_node(node, DataMissingValue, "Data node is missing current_value node.") if value_nodes.empty?
154
+ # raise exception_for_node(node, DataMissingValue, "Data node is missing current_value node.") if value_nodes.empty?
155
155
  raise exception_for_node(node, DataHasMultipleValues, "Data node has multiple 'value' nodes.") if value_nodes.size > 1
156
156
 
157
157
  value_node = value_nodes.first
@@ -162,8 +162,10 @@ module Eeml
162
162
  value = Value.new
163
163
  value.min_value = min_value_node.content if min_value_node
164
164
  value.max_value = max_value_node.content if max_value_node
165
- value.value = value_node.content.strip
166
- value.recorded_at = value_node['at'] unless value_node['at'].blank?
165
+ if value_node
166
+ value.value = value_node.content.strip
167
+ value.recorded_at = value_node['at'] unless value_node['at'].blank?
168
+ end
167
169
 
168
170
  data.add_value(value)
169
171
 
data/lib/eeml.rb CHANGED
@@ -16,7 +16,7 @@ require 'time'
16
16
  module Eeml
17
17
 
18
18
  # library version number
19
- VERSION = '0.0.32'
19
+ VERSION = '0.0.33'
20
20
 
21
21
  # TODO: put in some configuration file, not here
22
22
  LOCAL_EEML_SCHEMA_LOCATION = 'schemas/eeml/005.xsd'
@@ -81,7 +81,7 @@
81
81
  <xsd:complexType>
82
82
  <xsd:sequence>
83
83
  <xsd:element minOccurs="0" maxOccurs="unbounded" name="tag" type="xsd:string" />
84
- <xsd:element name="current_value">
84
+ <xsd:element minOccurs="0" maxOccurs="1" name="current_value">
85
85
  <xsd:complexType>
86
86
  <xsd:simpleContent>
87
87
  <xsd:extension base="xsd:string">
@@ -0,0 +1,8 @@
1
+ <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">
2
+ <environment>
3
+ <title>Pachube Office environment</title>
4
+ <data id="0" />
5
+ <data id="1" />
6
+ </environment>
7
+ </eeml>
8
+
@@ -200,6 +200,11 @@ class TestEnvironment < Test::Unit::TestCase
200
200
  assert_equal 'celsius', d.unit_value
201
201
  end
202
202
 
203
+ test "parses environment with stub datastreams v051 xml" do
204
+ env = create_env_from_xml_file('environment_minimal_051.xml')
205
+ assert_equal 2, env.datastreams.size
206
+ end
207
+
203
208
  test "parses environment level tags from v051 xml" do
204
209
  env = create_env_from_xml_file('environment_tags.xml')
205
210
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eeml
3
3
  version: !ruby/object:Gem::Version
4
- hash: 95
4
+ hash: 93
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 32
10
- version: 0.0.32
9
+ - 33
10
+ version: 0.0.33
11
11
  platform: ruby
12
12
  authors:
13
13
  - Neill Bogie
@@ -79,7 +79,6 @@ extra_rdoc_files:
79
79
  - LICENSE
80
80
  - README
81
81
  files:
82
- - .gitignore
83
82
  - CHANGELOG
84
83
  - LICENSE
85
84
  - Manifest
@@ -119,6 +118,7 @@ files:
119
118
  - test/data/doc_2.xml
120
119
  - test/data/doc_2_expected.json
121
120
  - test/data/eeml_datastream_051.xml
121
+ - test/data/environment_minimal_051.xml
122
122
  - test/data/environment_tags.json
123
123
  - test/data/environment_tags.xml
124
124
  - test/data/list.xml
@@ -137,8 +137,8 @@ homepage:
137
137
  licenses: []
138
138
 
139
139
  post_install_message:
140
- rdoc_options:
141
- - --charset=UTF-8
140
+ rdoc_options: []
141
+
142
142
  require_paths:
143
143
  - lib
144
144
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -168,9 +168,9 @@ specification_version: 3
168
168
  summary: Simple little library for programmatically manipulating EEML documents.
169
169
  test_files:
170
170
  - test/libxml_test_helper.rb
171
- - test/test_libxml_test_helper.rb
172
- - test/test_libxml_eeml_parser_v005.rb
173
- - test/test_csv_parser_v2.rb
174
- - test/test_helper.rb
175
171
  - test/test_csv_parser_v1.rb
172
+ - test/test_csv_parser_v2.rb
176
173
  - test/test_environment.rb
174
+ - test/test_helper.rb
175
+ - test/test_libxml_eeml_parser_v005.rb
176
+ - test/test_libxml_test_helper.rb
data/.gitignore DELETED
@@ -1,9 +0,0 @@
1
- .rvmrc
2
- pkg
3
- coverage/
4
- doc
5
- eeml.gemspec
6
- client_config.yml
7
- coverage/
8
- .*.swp
9
- gem_deps_manual/