eeml 0.0.32 → 0.0.33
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +8 -0
- data/lib/eeml/libxml_eeml_parser_v051.rb +5 -3
- data/lib/eeml.rb +1 -1
- data/schemas/eeml/0.5.1.xsd +1 -1
- data/test/data/environment_minimal_051.xml +8 -0
- data/test/test_environment.rb +5 -0
- metadata +10 -10
- data/.gitignore +0 -9
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
|
-
|
166
|
-
|
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
data/schemas/eeml/0.5.1.xsd
CHANGED
@@ -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
|
+
|
data/test/test_environment.rb
CHANGED
@@ -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:
|
4
|
+
hash: 93
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
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
|
-
|
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
|