eeml 0.0.1 → 0.0.2
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 +506 -0
- data/Manifest +6 -3
- data/README +2 -2
- data/Rakefile +1 -1
- data/eeml.gemspec +7 -7
- data/example.rb +11 -6
- data/lib/eeml/constants.rb +4 -3
- data/lib/eeml/csv_parser.rb +0 -1
- data/lib/eeml/environment.rb +35 -23
- data/lib/eeml/exceptions.rb +58 -54
- data/lib/eeml/json_environment_parser_v005.rb +69 -0
- data/lib/eeml/json_output.rb +86 -0
- data/lib/eeml/libxml_eeml_parser_v005.rb +30 -5
- data/lib/eeml/output_registry.rb +2 -2
- data/lib/eeml/parser_registry.rb +3 -2
- data/lib/eeml.rb +7 -14
- data/test/data/doc_1.json +30 -2
- data/test/data/doc_2.xml +36 -0
- data/test/data/doc_2_expected.json +35 -0
- data/test/data/list.xml +38 -0
- data/test/data/no_namespace.xml +9 -0
- data/test/test_environment.rb +147 -9
- data/test/test_helper.rb +62 -2
- data/test/test_libxml_eeml_parser_v005.rb +3 -0
- data.tar.gz.sig +0 -0
- metadata +11 -9
- metadata.gz.sig +1 -3
- data/lib/eeml/feed_output.rb +0 -169
- data/lib/eeml/feed_retriever.rb +0 -103
- data/lib/eeml/json_environment_parser.rb +0 -11
data/CHANGELOG
CHANGED
@@ -0,0 +1,506 @@
|
|
1
|
+
commit db121ee6d59585932cc1222c556de689ca09490d
|
2
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
3
|
+
Date: Tue May 5 01:58:52 2009 +0100
|
4
|
+
|
5
|
+
Moved exceptions into their own module, which I've included where necessary.
|
6
|
+
|
7
|
+
commit b1ef59825336b19e25fe1f8f98763d17bc716f5e
|
8
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
9
|
+
Date: Tue May 5 01:57:51 2009 +0100
|
10
|
+
|
11
|
+
Added initialization parameters to location, environment and datastream so that it is easier to create instances from JSON.
|
12
|
+
|
13
|
+
commit 0c034391edd112f736a0497343048bbc69b2536b
|
14
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
15
|
+
Date: Tue May 5 01:40:16 2009 +0100
|
16
|
+
|
17
|
+
Implemented simple json parser for the current json output by pachube.com. Parses the couple of valid docs I've included, haven't
|
18
|
+
really gone into invalid docs, or docs with missing required attributes, etc. Left open the possibility for updates that parse
|
19
|
+
a new json format (i.e. EEML 0.6 compatible JSON).
|
20
|
+
|
21
|
+
Added some simple test cases for json parsing.
|
22
|
+
|
23
|
+
commit 797fb10303acbfab2c2d84f2dabc4375e2864a00
|
24
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
25
|
+
Date: Mon May 4 14:40:43 2009 +0100
|
26
|
+
|
27
|
+
Very minor comment change.
|
28
|
+
|
29
|
+
commit 3536d64dc45f26c76436b3b2acb68e52f8faabbe
|
30
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
31
|
+
Date: Mon May 4 14:39:25 2009 +0100
|
32
|
+
|
33
|
+
Added 'version' attribute to the json format we are outputting. Need to build this a) into pachube, and b) into the json parser
|
34
|
+
as we will need to update the json formt to correlate when EEML is revised.
|
35
|
+
|
36
|
+
commit e2cb1385e91f8f5d48159c082c9dba4831ec16b4
|
37
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
38
|
+
Date: Mon May 4 14:38:29 2009 +0100
|
39
|
+
|
40
|
+
Added nodoc comments to some internal classes.
|
41
|
+
|
42
|
+
commit 6024a6cf15e3db1583b767fc37ef08114ac70d13
|
43
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
44
|
+
Date: Mon May 4 14:37:02 2009 +0100
|
45
|
+
|
46
|
+
Rdoc change - make sure internal comment ommitted from generated output.
|
47
|
+
|
48
|
+
commit 1d5d6cd6f0f04f792d7cf54cf4d95db5261c464e
|
49
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
50
|
+
Date: Mon May 4 14:36:33 2009 +0100
|
51
|
+
|
52
|
+
Removed feed retrieval specific exceptions from our exception collection.
|
53
|
+
|
54
|
+
commit 24a010cbace826fc12d2ce5de008f57bb9c2a5fe
|
55
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
56
|
+
Date: Mon May 4 14:34:05 2009 +0100
|
57
|
+
|
58
|
+
Added few basic comments to the main Environment class.
|
59
|
+
|
60
|
+
commit 7c24ee92fc9f3e35834c0d97dc186dca6f7af270
|
61
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
62
|
+
Date: Mon May 4 14:33:35 2009 +0100
|
63
|
+
|
64
|
+
Removed constants that were only used in relation to feed retrieval/submission.
|
65
|
+
|
66
|
+
commit 36d624861f860bd6742025b8e7f10f15b159f298
|
67
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
68
|
+
Date: Mon May 4 14:31:58 2009 +0100
|
69
|
+
|
70
|
+
Updated README to make clear that this gem shouldn't be involved with fetching/sending to Pachube. That should be in a pachube specific gem.
|
71
|
+
|
72
|
+
commit c97a973e7f521732313e563823614cf0c9ed0989
|
73
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
74
|
+
Date: Mon May 4 12:11:41 2009 +0100
|
75
|
+
|
76
|
+
Renamed NamespaceMissing exception class to MissingNamespace to correlate with pre-existing NamespaceMissing.
|
77
|
+
|
78
|
+
commit a191d2a66517a9305e2a92f8f2d13aee2a4e3e04
|
79
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
80
|
+
Date: Sun May 3 23:31:37 2009 +0100
|
81
|
+
|
82
|
+
Updated version number to 0.0.2.
|
83
|
+
|
84
|
+
commit 53c3a57fb954cd96d86ca9e8c35e9358f3995fda
|
85
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
86
|
+
Date: Sun May 3 23:30:58 2009 +0100
|
87
|
+
|
88
|
+
Added extra files to the manifest.
|
89
|
+
|
90
|
+
commit b49ea4813b51637f204270491761184e3e588d67
|
91
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
92
|
+
Date: Sun May 3 23:28:59 2009 +0100
|
93
|
+
|
94
|
+
Added simple test with corresponding exception if we don't find any namespace on the root element of an EEML document that
|
95
|
+
we want to parse.
|
96
|
+
|
97
|
+
commit 1807d90298f2eab1bcbc001b97fc4a088cf7fd36
|
98
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
99
|
+
Date: Sun May 3 23:12:24 2009 +0100
|
100
|
+
|
101
|
+
Removed some old code that had also been ported across from the rails app. Don't need to include this state related snippet.
|
102
|
+
|
103
|
+
commit f44caa737f06454ea0109ec53c1b8072d4229aa5
|
104
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
105
|
+
Date: Sun May 3 23:05:45 2009 +0100
|
106
|
+
|
107
|
+
Removed old to_custom_json code that was ported across from the rails app.
|
108
|
+
Renamed json output method to just `to_json` rather than `to_public_json` - in the gem we should only be dealing with the public json format.
|
109
|
+
|
110
|
+
Renamed to_json method in example file.
|
111
|
+
|
112
|
+
commit 1e892b2969d0f4a301d5fccec71e9aabe19e8420
|
113
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
114
|
+
Date: Sun May 3 22:17:41 2009 +0100
|
115
|
+
|
116
|
+
Removed logger info from gem.
|
117
|
+
|
118
|
+
commit 99603bd5238f9c71f306b369e5902cfbe4aa7a6d
|
119
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
120
|
+
Date: Sun May 3 22:14:06 2009 +0100
|
121
|
+
|
122
|
+
Removed client config loading code. This wasn't really used at the moment, and I think if the gem is just concerned with EEML parsing
|
123
|
+
then it doesn't really need external config of this sort; this can be saved for the Pachube gem as and when we get round to writing it.
|
124
|
+
|
125
|
+
commit ae94a8a2b74d60db0fb0df026cfc10ecfe26f716
|
126
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
127
|
+
Date: Sun May 3 22:12:29 2009 +0100
|
128
|
+
|
129
|
+
Updated the version of the json gem we are referencing.
|
130
|
+
|
131
|
+
commit 5f97067b38defeea0e489045b951ffd1eee91396
|
132
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
133
|
+
Date: Sun May 3 23:14:20 2009 +0100
|
134
|
+
|
135
|
+
Removed exceptions that are to do with remote feed retrieval. Should be outwith the remit of this gem.
|
136
|
+
|
137
|
+
commit 80c1100d50a6caae100bafec62ca1ce2ed31c6fa
|
138
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
139
|
+
Date: Sun May 3 22:08:24 2009 +0100
|
140
|
+
|
141
|
+
Removed all feed fetching code from the gem. Think this would be better served in a specific Pachube gem for interacting with the
|
142
|
+
api. This library will be more useful focusing just on parsing/creating EEML docs, and their corresponding JSON format partners.
|
143
|
+
|
144
|
+
Last vestigal bit of feed fetching code that should have been removed previously. Removed now...
|
145
|
+
|
146
|
+
commit bbff4837be3ef96b59827e338c43286162b18f56
|
147
|
+
Author: Neill Bogie <neillbogie@googlemail.com>
|
148
|
+
Date: Sun Apr 26 20:38:30 2009 +0100
|
149
|
+
|
150
|
+
added ability to parse list of environments from a single xml doc.
|
151
|
+
|
152
|
+
commit d0045536183425ec28be390b65123026244f376d
|
153
|
+
Author: Neill Bogie <neillbogie@googlemail.com>
|
154
|
+
Date: Sat Apr 18 16:24:02 2009 +0100
|
155
|
+
|
156
|
+
Improved public json output with tests, added to example.rb
|
157
|
+
|
158
|
+
commit 456294351324a752f0c18cd82fc6c6d6fdbe0b7d
|
159
|
+
Author: Neill Bogie <neillbogie@googlemail.com>
|
160
|
+
Date: Sat Apr 18 16:23:06 2009 +0100
|
161
|
+
|
162
|
+
Added custom assertion "assert_json_hashes_equal" (used in json testing)
|
163
|
+
|
164
|
+
commit dce4e81d2d79947342db4d213dd1ba5ea8cf66a6
|
165
|
+
Author: Neill Bogie <neillbogie@googlemail.com>
|
166
|
+
Date: Sat Apr 18 02:20:36 2009 +0100
|
167
|
+
|
168
|
+
Ported basic json output from current system. (...)
|
169
|
+
|
170
|
+
Added custom assert_json_strings_equal(s1, s2) to compare json strings after they have been parsed into structures.
|
171
|
+
No test for custom json output yet.
|
172
|
+
Notice that current system has some quirks (lat lon are numeric but ele is string) which were exactly copied.
|
173
|
+
|
174
|
+
commit ea876d49f263116a28ce6033aeeefb39b710010b
|
175
|
+
Author: Neill Bogie <neillbogie@googlemail.com>
|
176
|
+
Date: Fri Apr 17 19:00:56 2009 +0100
|
177
|
+
|
178
|
+
complete removal of FeedOutput (a now-unused mixin module)
|
179
|
+
|
180
|
+
commit 494632d6ee286d4968b7c6746b749d8d94e20006
|
181
|
+
Author: Neill Bogie <neillbogie@googlemail.com>
|
182
|
+
Date: Fri Apr 17 18:45:51 2009 +0100
|
183
|
+
|
184
|
+
don't parse unobtained feed.
|
185
|
+
|
186
|
+
commit 160daf34d4889b42408847c37e405b6f6f8ebdf4
|
187
|
+
Merge: 5a2a372 049ed53
|
188
|
+
Author: Neill Bogie <neillbogie@googlemail.com>
|
189
|
+
Date: Fri Apr 17 18:31:51 2009 +0100
|
190
|
+
|
191
|
+
Merge branch 'master' of git@github.com:smulube/eeml.git
|
192
|
+
|
193
|
+
commit 5a2a372c176eec509ae4d31214161554619da78c
|
194
|
+
Author: Neill Bogie <neillbogie@googlemail.com>
|
195
|
+
Date: Fri Apr 17 18:20:08 2009 +0100
|
196
|
+
|
197
|
+
basic env.fetch_data impl. details...
|
198
|
+
|
199
|
+
now require fakeweb library for testing.
|
200
|
+
|
201
|
+
commit e4d653f335f897ab52c3c3922cdab5a42dd41915
|
202
|
+
Author: Neill Bogie <neillbogie@googlemail.com>
|
203
|
+
Date: Fri Apr 17 18:16:41 2009 +0100
|
204
|
+
|
205
|
+
The xml parser can now populate an existing environment object, if one is given.
|
206
|
+
|
207
|
+
this is necessary for env.fetch_data
|
208
|
+
|
209
|
+
commit ec1bded612260cbc73faad9326c181036047aabe
|
210
|
+
Author: Neill Bogie <neillbogie@googlemail.com>
|
211
|
+
Date: Fri Apr 17 18:10:50 2009 +0100
|
212
|
+
|
213
|
+
environment.fetch_data example now loads api key from (git-ignored) client-config.yml
|
214
|
+
|
215
|
+
commit 049ed5344cb0cacf8bdc13f3ab57fb8206cb4658
|
216
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
217
|
+
Date: Fri Apr 17 13:47:19 2009 +0100
|
218
|
+
|
219
|
+
Simple changelog generated from git log messages.
|
220
|
+
|
221
|
+
commit 8951ff79e521b9b0d869275dd8972446ec9b6bab
|
222
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
223
|
+
Date: Fri Apr 17 13:09:17 2009 +0100
|
224
|
+
|
225
|
+
Ignoring the generated gemspec file.
|
226
|
+
|
227
|
+
commit 3498076a60c41b6345badf6870f82caca1979bb9
|
228
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
229
|
+
Date: Fri Apr 17 13:07:37 2009 +0100
|
230
|
+
|
231
|
+
Loosened parser so that a feed with no datastreams will pass, and changed test case to reflect this.
|
232
|
+
|
233
|
+
commit 72d4f74bd365872553225ca3a619383d25bd4c7e
|
234
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
235
|
+
Date: Fri Apr 17 13:06:21 2009 +0100
|
236
|
+
|
237
|
+
Specific libxml parser for eeml marked as nodoc - users shouldn't really concern themselves with this implementation class, so have hidden it from the docs.
|
238
|
+
|
239
|
+
commit fafcd5767a6997c1fca42c0464fbcb6562773dfd
|
240
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
241
|
+
Date: Fri Apr 17 13:03:10 2009 +0100
|
242
|
+
|
243
|
+
The feed retriever module hasn't received any attention since being added in here. The module name was lower cased, so gave it a capital at the start - meh.
|
244
|
+
|
245
|
+
commit 56f8fa74dba1ec7324ffe79cbe19fc25f1fb6329
|
246
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
247
|
+
Date: Fri Apr 17 13:02:14 2009 +0100
|
248
|
+
|
249
|
+
Added nodoc statements to feed_output, as we'll be moving away from this soon, I don't think it should be included in the docs for the gem.
|
250
|
+
|
251
|
+
commit e895ad845929b71d1a05e8dbabda61c9498794b1
|
252
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
253
|
+
Date: Fri Apr 17 12:58:01 2009 +0100
|
254
|
+
|
255
|
+
Removed some unneccessary stuff from the feed_output module. Eventually this module will be removed, with the functionality instead coming from the eeml output
|
256
|
+
class specific to the version of eeml we are interested in.
|
257
|
+
|
258
|
+
commit 30a355a09004fa817539f29cf6629b9af9326a97
|
259
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
260
|
+
Date: Fri Apr 17 12:56:27 2009 +0100
|
261
|
+
|
262
|
+
Removed empty elements from the empty version of the eeml document, and added a title to the minimal doc. Ideally I'd like title to be required in the
|
263
|
+
xsd schema...
|
264
|
+
|
265
|
+
commit 9c29ddd37fcff6b7f1ae1755520d4b60e7fa7291
|
266
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
267
|
+
Date: Fri Apr 17 12:55:03 2009 +0100
|
268
|
+
|
269
|
+
Don't think this old csv_parser is used anywhere. No code changes, just tidyed text slightly.
|
270
|
+
|
271
|
+
commit 57048b82b08a78c296becf689df872e2e8a275e1
|
272
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
273
|
+
Date: Fri Apr 17 12:38:57 2009 +0100
|
274
|
+
|
275
|
+
Added separate eeml output class, and registry type class for creating output objects modelled after the parser implementation. This is with an
|
276
|
+
eye on the future version of eeml that is going to be introduced soon. Would like to be able to output either version as required.
|
277
|
+
|
278
|
+
commit 43f406bcf654a782031d507d0ade723ffdf5c63a
|
279
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
280
|
+
Date: Thu Apr 16 15:09:59 2009 +0100
|
281
|
+
|
282
|
+
Ignoring doc and pkg directory.
|
283
|
+
|
284
|
+
commit 497c11ec0b208eff25c41ec2e3c08cb8affb6689
|
285
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
286
|
+
Date: Thu Apr 9 02:24:55 2009 +0100
|
287
|
+
|
288
|
+
Ignore real data.
|
289
|
+
|
290
|
+
Added the real user data (in xml), to the ignore_pattern in echoe, so that they won't be included in the manifest, etc.
|
291
|
+
|
292
|
+
commit f6c6b947b861ff47df6ec659b7b30ed18200a586
|
293
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
294
|
+
Date: Thu Apr 9 02:24:09 2009 +0100
|
295
|
+
|
296
|
+
Updating manifest for new files.
|
297
|
+
|
298
|
+
Added extra new files written for the gem to the manifest.
|
299
|
+
|
300
|
+
commit 10cb7959c160ff5fb0bcdad655df17d5157c832e
|
301
|
+
Author: Neill Bogie <neillbogie@googlemail.com>
|
302
|
+
Date: Wed Apr 8 21:51:16 2009 +0100
|
303
|
+
|
304
|
+
misc minor changes around logger, exceptions. Details:
|
305
|
+
|
306
|
+
* Set up Environment.logger with standard ruby logger. Needs some config work, and needs silenced for testing.
|
307
|
+
* eeml exception defs moved to own file.
|
308
|
+
* added environment constructor options hash.
|
309
|
+
* corrected doc_1.xml value to be within its min and max vals.
|
310
|
+
|
311
|
+
commit be62ad8c8fcaedd16c33d375a05a53a06e01b067
|
312
|
+
Author: Neill Bogie <neillbogie@googlemail.com>
|
313
|
+
Date: Wed Apr 8 21:46:53 2009 +0100
|
314
|
+
|
315
|
+
added an executable example client.rb
|
316
|
+
|
317
|
+
this
|
318
|
+
1. serves as documentation, and also
|
319
|
+
2. pushes us to nail down exactly how the client will load the library (and consider how they might resolve other deps like libxml)
|
320
|
+
|
321
|
+
TODO: figure out best way to keep this auto-tested, so that it doesn't go stale. Perhaps use FakeWeb to stub its http?
|
322
|
+
|
323
|
+
commit 63efbdaaa85009232d1a147dc8b79bb53248af66
|
324
|
+
Author: Neill Bogie <neillbogie@googlemail.com>
|
325
|
+
Date: Wed Apr 8 20:30:11 2009 +0100
|
326
|
+
|
327
|
+
corrected exception type used when data node has multiple units.
|
328
|
+
|
329
|
+
commit ab35aaa1bd1ee101fbaede43a21f59d76c309134
|
330
|
+
Author: Neill Bogie <neillbogie@googlemail.com>
|
331
|
+
Date: Wed Apr 8 04:34:34 2009 +0100
|
332
|
+
|
333
|
+
removed file-write from eeml-gen unit test
|
334
|
+
|
335
|
+
(was just used during debugging)
|
336
|
+
|
337
|
+
commit 3a450ad90eada0434a4b48656ec1c10a8c16c843
|
338
|
+
Author: Neill Bogie <neillbogie@googlemail.com>
|
339
|
+
Date: Wed Apr 8 04:30:28 2009 +0100
|
340
|
+
|
341
|
+
First impl of eeml output (straight copy of sam's feed_output.rb)
|
342
|
+
|
343
|
+
For now, going with the mixin module to do this, though I'd prefer eventually to use a separate eeml-generator class.
|
344
|
+
env model's 'feed' becomes 'feed_url'
|
345
|
+
env xml node's 'updated' attr now reads from model's 'updated'. was 'retrieved_at'. TODO: clarify.
|
346
|
+
env no longer tries to assemble its own hosting url (env.feed). Rather, this will be set by publisher (controller?)
|
347
|
+
|
348
|
+
commit 2fe2466750ff41cd1ebbd76ac5edf0d5aa849076
|
349
|
+
Author: Neill Bogie <neillbogie@googlemail.com>
|
350
|
+
Date: Wed Apr 8 00:26:33 2009 +0100
|
351
|
+
|
352
|
+
started on eeml output, using previous feed_output.rb.
|
353
|
+
|
354
|
+
commit f4f52ba72513e0bf29ec66af51677741fa38db59
|
355
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
356
|
+
Date: Mon Apr 6 01:49:45 2009 +0100
|
357
|
+
|
358
|
+
Added parsing unit element to the libxml parser. Copied methodology and tests from the datastream value parser section.
|
359
|
+
|
360
|
+
commit 32b5c4354c11c841740557bbc1f39e2d88d0f261
|
361
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
362
|
+
Date: Sun Apr 5 01:21:47 2009 +0100
|
363
|
+
|
364
|
+
Experimental branch where I tried removing the DataValue class. Am not sure it adds to the api (particularly I don't like that
|
365
|
+
ds.value.value = 'value' you need to write. Rather than literally representing the EEML structure, have folded these attributes
|
366
|
+
back into datastream. Updated tests so this change passes.
|
367
|
+
|
368
|
+
commit b8422f5176ba78a7d43c40f30fbad3d28582502a
|
369
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
370
|
+
Date: Sun Apr 5 01:04:23 2009 +0100
|
371
|
+
|
372
|
+
Added another couple of dumb little tests (most minimal valid eeml file, and that parsing a feed with no location is valid).
|
373
|
+
|
374
|
+
commit fe0dc57780b4b0d1060e59f4cc4162e2db78ad30
|
375
|
+
Author: Neill Bogie <neillbogie@googlemail.com>
|
376
|
+
Date: Fri Apr 3 04:52:57 2009 +0100
|
377
|
+
|
378
|
+
ported old code to update ds values based on csv content. started feed retriever.
|
379
|
+
|
380
|
+
very basic - passes previous tests, but needs more thought, especially regarding ds identifiers.
|
381
|
+
|
382
|
+
also moved xml test help out into its own module and its own test.
|
383
|
+
|
384
|
+
commit ad66d1db38ee6b11ae03237af4444c2bbe2d3a04
|
385
|
+
Author: Neill Bogie <neillbogie@googlemail.com>
|
386
|
+
Date: Thu Apr 2 19:50:40 2009 +0100
|
387
|
+
|
388
|
+
started modification of feed retriever.
|
389
|
+
|
390
|
+
retriever module changed to a class, and now works with its own attrs. it will be delegated to by an owning environment, but is stand alone for ease of testing.
|
391
|
+
|
392
|
+
'feed' attr renamed to 'feed_url', for clarity.
|
393
|
+
|
394
|
+
commit bb29b362dc11646d70f9f9caf0d35e905fae0314
|
395
|
+
Author: Neill Bogie <neillbogie@googlemail.com>
|
396
|
+
Date: Thu Apr 2 19:46:26 2009 +0100
|
397
|
+
|
398
|
+
bring across feed_retriever from server app. initial before mods.
|
399
|
+
|
400
|
+
commit 1afd0e7826293e309414b9f8c30fcd37fbc55597
|
401
|
+
Author: n <n@guaguanco.config>
|
402
|
+
Date: Thu Apr 2 04:24:55 2009 +0100
|
403
|
+
|
404
|
+
support multiple tags.
|
405
|
+
parse env id, updated and creator.
|
406
|
+
bail if zero or multiple values in a datastream.
|
407
|
+
More specific exceptions.
|
408
|
+
Add line nums and node names to some exceptions.
|
409
|
+
|
410
|
+
commit 093f8edd4443381f7529054589c47a7ae8848ffa
|
411
|
+
Author: n <n@guaguanco.config>
|
412
|
+
Date: Thu Apr 2 01:16:31 2009 +0100
|
413
|
+
|
414
|
+
change to autotest config to try to have it retest everything on any change. no joy.
|
415
|
+
|
416
|
+
commit 31c74517a3afddeee112db34b19dd4b00beb7500
|
417
|
+
Author: n <n@guaguanco.config>
|
418
|
+
Date: Thu Apr 2 01:16:12 2009 +0100
|
419
|
+
|
420
|
+
misc changes. almost parsing v005 xml
|
421
|
+
|
422
|
+
commit 5076ec57ccc70ee28a4b9e67748bd126b6bceb10
|
423
|
+
Author: n <n@guaguanco.config>
|
424
|
+
Date: Thu Apr 2 01:14:25 2009 +0100
|
425
|
+
|
426
|
+
misc changes. almost complete parsing of 005.
|
427
|
+
|
428
|
+
commit 574e94e8b09fa28176d39c7d6cbd447d536bd259
|
429
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
430
|
+
Date: Mon Mar 30 00:39:52 2009 +0100
|
431
|
+
|
432
|
+
Added .autotest file which generates nice notifications on linux provided you have libnotify-bin installed.
|
433
|
+
|
434
|
+
commit c3f0df4ecbbde0ea0bbf78ab69cb2ff8aac09e07
|
435
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
436
|
+
Date: Mon Mar 30 00:37:50 2009 +0100
|
437
|
+
|
438
|
+
Removed all cruft that had accumulated today from my messing around idly here and there.
|
439
|
+
|
440
|
+
commit 78182595514e6f28c647c36b7d5d8a096603654e
|
441
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
442
|
+
Date: Fri Mar 27 17:08:41 2009 +0000
|
443
|
+
|
444
|
+
Am thinking that rather than keeping all the model classes in the parent base class, it might be better
|
445
|
+
to keep them separated into their own files.
|
446
|
+
|
447
|
+
commit e49448c1208f6fa717dd691db8efa93432301084
|
448
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
449
|
+
Date: Fri Mar 27 16:59:51 2009 +0000
|
450
|
+
|
451
|
+
Removed all the explicit attributes to use a scheme based on a nested hash object for storing all the object data. This means
|
452
|
+
we can use the same base class for our essentially empty datastream and location objects. That is at the moment I think they
|
453
|
+
will be behaviour free data objects essentially.
|
454
|
+
|
455
|
+
commit aff10229863ef455ff9ada98567542a95523cb35
|
456
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
457
|
+
Date: Fri Mar 27 16:45:04 2009 +0000
|
458
|
+
|
459
|
+
Added simple hash based object for storing datastream values.
|
460
|
+
|
461
|
+
commit dbe5fd388fca66a0336b53e069c74ebe806ae75c
|
462
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
463
|
+
Date: Fri Mar 27 16:42:03 2009 +0000
|
464
|
+
|
465
|
+
Main entry point doesn't seem to need rubygems required. This must get required automatically.
|
466
|
+
|
467
|
+
commit e9db7f76d6b4e93b1bd3d0e054b3cf68e81cfa58
|
468
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
469
|
+
Date: Fri Mar 27 16:35:40 2009 +0000
|
470
|
+
|
471
|
+
Added development dependency on mocha.
|
472
|
+
|
473
|
+
commit 049f47e4912cb850cb17f7f2db894e5f6ead14a2
|
474
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
475
|
+
Date: Fri Mar 27 13:20:38 2009 +0000
|
476
|
+
|
477
|
+
Added licensing info, and some basic info in the README file.
|
478
|
+
|
479
|
+
commit 56e1802bb272929fda3e41e91159708a56b91b09
|
480
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
481
|
+
Date: Fri Mar 27 12:34:25 2009 +0000
|
482
|
+
|
483
|
+
* Got basic test suite working with autotest in a way I'm happy with.
|
484
|
+
* Added some very basic tests.
|
485
|
+
* Added a little patch to Test::Unit::TestCase so we can write test names
|
486
|
+
in a slightly nicer DSL type way, without requiring overhead of other libraries.
|
487
|
+
|
488
|
+
commit 30133c2d5191fc640bdff774f8ec70d075c700d3
|
489
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
490
|
+
Date: Fri Mar 27 12:15:01 2009 +0000
|
491
|
+
|
492
|
+
Updated required version of libxml to latest stable.
|
493
|
+
|
494
|
+
commit f1ff4e51cfba69131819a9e2ea51b892c6102dbf
|
495
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
496
|
+
Date: Fri Mar 27 12:12:22 2009 +0000
|
497
|
+
|
498
|
+
Changed unshift to use File.join rather than hardcoding the dir separator
|
499
|
+
into the path.
|
500
|
+
|
501
|
+
commit 5fcf03df2e4f7c17713275715efc529d657229b0
|
502
|
+
Author: Sam Mulube <sam.mulube@gmail.com>
|
503
|
+
Date: Mon Mar 16 00:14:15 2009 +0000
|
504
|
+
|
505
|
+
Initial commit of little library to factor out EEML parsing into a single library that might a) be useful to other
|
506
|
+
users, and b) that can be used either by the rails app, or by axon for parsing received EEML content.
|
data/Manifest
CHANGED
@@ -9,20 +9,23 @@ test/libxml_test_helper.rb
|
|
9
9
|
test/test_libxml_eeml_parser_v005.rb
|
10
10
|
test/test_helper.rb
|
11
11
|
test/data/minimal.xml
|
12
|
+
test/data/doc_2_expected.json
|
13
|
+
test/data/list.xml
|
12
14
|
test/data/out_empty.xml
|
15
|
+
test/data/no_namespace.xml
|
13
16
|
test/data/doc_1.xml
|
14
17
|
test/data/doc_1.json
|
18
|
+
test/data/doc_2.xml
|
15
19
|
lib/eeml.rb
|
16
20
|
lib/eeml/constants.rb
|
17
|
-
lib/eeml/
|
18
|
-
lib/eeml/json_environment_parser.rb
|
21
|
+
lib/eeml/json_environment_parser_v005.rb
|
19
22
|
lib/eeml/output_registry.rb
|
20
23
|
lib/eeml/parser_registry.rb
|
21
24
|
lib/eeml/libxml_eeml_output_v005.rb
|
22
|
-
lib/eeml/feed_output.rb
|
23
25
|
lib/eeml/libxml_eeml_parser_v005.rb
|
24
26
|
lib/eeml/exceptions.rb
|
25
27
|
lib/eeml/csv_parser.rb
|
28
|
+
lib/eeml/json_output.rb
|
26
29
|
lib/eeml/environment.rb
|
27
30
|
lib/blank.rb
|
28
31
|
schemas/eeml/005.xsd
|
data/README
CHANGED
@@ -4,5 +4,5 @@
|
|
4
4
|
|
5
5
|
== DESCRIPTION:
|
6
6
|
|
7
|
-
Library for
|
8
|
-
|
7
|
+
Library for simplifying the creation and manipulation of EEML documents, primarily intended for use with pachube.com. Provides parsing of EEML documents into
|
8
|
+
ruby objects that can be used programmatically. Also provides parsing and output of the JSON format used by pachube.com.
|
data/Rakefile
CHANGED
data/eeml.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{eeml}
|
5
|
-
s.version = "0.0.
|
5
|
+
s.version = "0.0.2"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Neill Bogie, Sam Mulube"]
|
9
9
|
s.cert_chain = ["/home/sam/.gem/gem-public_cert.pem"]
|
10
|
-
s.date = %q{2009-
|
10
|
+
s.date = %q{2009-05-05}
|
11
11
|
s.description = %q{Simple little library for programmatically manipulating EEML documents, in particular this library is designed to work with the Pachube web service.}
|
12
12
|
s.email = %q{sam.mulube@gmail.com}
|
13
|
-
s.extra_rdoc_files = ["LICENSE", "CHANGELOG", "README", "lib/eeml.rb", "lib/eeml/constants.rb", "lib/eeml/
|
14
|
-
s.files = ["example.rb", "eeml.gemspec", "LICENSE", "CHANGELOG", "README", "test/test_environment.rb", "test/test_libxml_test_helper.rb", "test/libxml_test_helper.rb", "test/test_libxml_eeml_parser_v005.rb", "test/test_helper.rb", "test/data/minimal.xml", "test/data/out_empty.xml", "test/data/doc_1.xml", "test/data/doc_1.json", "
|
13
|
+
s.extra_rdoc_files = ["LICENSE", "CHANGELOG", "README", "lib/eeml.rb", "lib/eeml/constants.rb", "lib/eeml/json_environment_parser_v005.rb", "lib/eeml/output_registry.rb", "lib/eeml/parser_registry.rb", "lib/eeml/libxml_eeml_output_v005.rb", "lib/eeml/libxml_eeml_parser_v005.rb", "lib/eeml/exceptions.rb", "lib/eeml/csv_parser.rb", "lib/eeml/json_output.rb", "lib/eeml/environment.rb", "lib/blank.rb"]
|
14
|
+
s.files = ["example.rb", "eeml.gemspec", "LICENSE", "CHANGELOG", "README", "test/test_environment.rb", "test/test_libxml_test_helper.rb", "test/libxml_test_helper.rb", "test/test_libxml_eeml_parser_v005.rb", "test/test_helper.rb", "test/data/minimal.xml", "test/data/doc_2_expected.json", "test/data/list.xml", "test/data/out_empty.xml", "test/data/no_namespace.xml", "test/data/doc_1.xml", "test/data/doc_1.json", "test/data/doc_2.xml", "lib/eeml.rb", "lib/eeml/constants.rb", "lib/eeml/json_environment_parser_v005.rb", "lib/eeml/output_registry.rb", "lib/eeml/parser_registry.rb", "lib/eeml/libxml_eeml_output_v005.rb", "lib/eeml/libxml_eeml_parser_v005.rb", "lib/eeml/exceptions.rb", "lib/eeml/csv_parser.rb", "lib/eeml/json_output.rb", "lib/eeml/environment.rb", "lib/blank.rb", "schemas/eeml/005.xsd", "Rakefile", "Manifest"]
|
15
15
|
s.has_rdoc = true
|
16
16
|
s.homepage = %q{}
|
17
17
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Eeml", "--main", "README"]
|
@@ -28,18 +28,18 @@ Gem::Specification.new do |s|
|
|
28
28
|
|
29
29
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
30
30
|
s.add_runtime_dependency(%q<libxml-ruby>, [">= 0", "= 1.1.3"])
|
31
|
-
s.add_runtime_dependency(%q<json>, [">= 0", "= 1.1.
|
31
|
+
s.add_runtime_dependency(%q<json>, [">= 0", "= 1.1.4"])
|
32
32
|
s.add_development_dependency(%q<rake>, [">= 0", "= 0.8.4"])
|
33
33
|
s.add_development_dependency(%q<mocha>, [">= 0", "= 0.9.6"])
|
34
34
|
else
|
35
35
|
s.add_dependency(%q<libxml-ruby>, [">= 0", "= 1.1.3"])
|
36
|
-
s.add_dependency(%q<json>, [">= 0", "= 1.1.
|
36
|
+
s.add_dependency(%q<json>, [">= 0", "= 1.1.4"])
|
37
37
|
s.add_dependency(%q<rake>, [">= 0", "= 0.8.4"])
|
38
38
|
s.add_dependency(%q<mocha>, [">= 0", "= 0.9.6"])
|
39
39
|
end
|
40
40
|
else
|
41
41
|
s.add_dependency(%q<libxml-ruby>, [">= 0", "= 1.1.3"])
|
42
|
-
s.add_dependency(%q<json>, [">= 0", "= 1.1.
|
42
|
+
s.add_dependency(%q<json>, [">= 0", "= 1.1.4"])
|
43
43
|
s.add_dependency(%q<rake>, [">= 0", "= 0.8.4"])
|
44
44
|
s.add_dependency(%q<mocha>, [">= 0", "= 0.9.6"])
|
45
45
|
end
|
data/example.rb
CHANGED
@@ -4,30 +4,35 @@
|
|
4
4
|
|
5
5
|
require 'rubygems' #only if your libxml is installed under rubygems
|
6
6
|
require 'eeml'
|
7
|
+
require 'yaml'
|
7
8
|
|
8
9
|
include Eeml #allows you to refer to Environment rather than Eeml::Environment
|
9
10
|
|
10
11
|
#Example: make an environment from scratch
|
11
|
-
env = Environment.new(:creator => 'http://www.example.com/ourstudio/',
|
12
|
+
env = Environment.new(:creator => 'http://www.example.com/ourstudio/',
|
13
|
+
:feed_url => 'http://www.example.com/ourstudio/feeds/house.xml')
|
12
14
|
|
13
15
|
env.title = 'my example feed'
|
14
16
|
env.datastreams << DataStream.new(:value => 93.0, :identifier => 'room.1.humidity')
|
15
17
|
env.datastreams << DataStream.new(:value => 91.0, :identifier => 'room.2.humidity')
|
16
18
|
|
17
|
-
#print out its eeml representation
|
19
|
+
#Example: print out its eeml representation
|
20
|
+
puts "Output as EEML"
|
18
21
|
puts env.to_eeml
|
19
22
|
|
23
|
+
#Example: print out its json representation
|
24
|
+
puts "Output as JSON"
|
25
|
+
puts env.to_json
|
26
|
+
|
20
27
|
|
21
28
|
#Example: parse an environment from an eeml doc:
|
29
|
+
puts "\nParsing an environment from a local eeml doc:"
|
22
30
|
eeml_str = File.read('test/data/doc_1.xml')
|
23
31
|
env2 = Environment.new_from_eeml(eeml_str)
|
24
32
|
env2.datastreams.each do |ds|
|
25
|
-
puts "ds %8s value is %6s (min:%8s, max:%8s)" %[ds.identifier, ds.value, ds.min_value, ds.max_value]
|
33
|
+
puts "ds %8s value is %6s (min:%8s, max:%8s)" %[ds.identifier, ds.value, ds.min_value, ds.max_value]
|
26
34
|
end
|
27
35
|
|
28
|
-
#TODO: Example: http-fetch an environment
|
29
|
-
|
30
|
-
#TODO: Example: publish an environment to pachube
|
31
36
|
|
32
37
|
#TODO: Example: configure a different logger (to file; to stderr; different timestamp / format; use an existing rails logger)
|
33
38
|
|
data/lib/eeml/constants.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Eeml
|
2
2
|
module Constants
|
3
|
-
|
3
|
+
LOCAL_EEML_SCHEMA_LOCATION = "schemas/eeml/005.xsd" # :nodoc:
|
4
4
|
EEML_HREF = "http://www.eeml.org/xsd/005"
|
5
5
|
EEML_VERSION = "5"
|
6
6
|
EEML_SCHEMA_LOCATION = "http://www.eeml.org/xsd/005 http://www.eeml.org/xsd/005/005.xsd"
|
@@ -8,10 +8,11 @@ module Eeml
|
|
8
8
|
EEML_NAMESPACE = ":#{EEML_HREF}"
|
9
9
|
XSI_NAMESPACE = "http://www.w3.org/2001/XMLSchema-instance"
|
10
10
|
|
11
|
-
|
11
|
+
#--
|
12
|
+
# TODO: better encapsulated as a set of methods.
|
13
|
+
#++
|
12
14
|
XML_TIME_FORMAT_STRING = "%Y-%m-%dT%H:%M:%SZ"
|
13
15
|
|
14
|
-
DEFAULT_HOST = 'pachube.com'
|
15
16
|
end
|
16
17
|
end
|
17
18
|
|