<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,6 +1,7 @@
 require 'rubygems'
 require 'builder'
 require 'rexml/document'
+require 'time'
 
 module EEML
 
@@ -43,7 +44,11 @@ module EEML
                         :'xsi:schemaLocation' =&gt; &quot;http://www.eeml.org/xsd/005 http://www.eeml.org/xsd/005/005.xsd&quot;}
         eeml_options[:version] = version if version
         eeml.eeml(eeml_options) do
-          eeml.environment do |env|
+          env_options = {}
+          env_options[:updated] = @updated_at.xmlschema if @updated_at
+          env_options[:creator] = @creator if @creator
+          env_options[:id] = @id if @id
+          eeml.environment(env_options) do |env|
             env.title @title if @title
             env.feed @feed if @feed
             env.status @status.to_s if @status
@@ -51,6 +56,18 @@ module EEML
             env.icon @icon if @icon
             env.website @website if @website
             env.email @email if @email
+            if @location
+              loc_options = {}
+              loc_options[:domain] = @location.domain
+              loc_options[:exposure] = @location.exposure if @location.exposure
+              loc_options[:disposition] = @location.disposition if @location.disposition
+              env.location(loc_options) do |loc|
+                loc.name @location.name if @location.name
+                loc.lat @location.lat if @location.lat
+                loc.lon @location.lon if @location.lon
+                loc.ele @location.ele if @location.ele
+              end
+            end
             @data_items.each_index do |i|
               env.data(:id =&gt; i) do |data|
                 @data_items[i].tags.each do |tag|</diff>
      <filename>lib/eeml/environment.rb</filename>
    </modified>
    <modified>
      <diff>@@ -148,7 +148,7 @@ describe EEML::Environment do
     end
 
     it &quot;generates the 'minimal' EEML example document&quot; do
-      @env.to_eeml.should == '&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;eeml xmlns=&quot;http://www.eeml.org/xsd/005&quot; xsi:schemaLocation=&quot;http://www.eeml.org/xsd/005 http://www.eeml.org/xsd/005/005.xsd&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&gt;&lt;environment&gt;&lt;data id=&quot;0&quot;&gt;&lt;value&gt;36.2&lt;/value&gt;&lt;/data&gt;&lt;/environment&gt;&lt;/eeml&gt;'
+      @env.to_eeml.should == '&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;eeml xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns=&quot;http://www.eeml.org/xsd/005&quot; xsi:schemaLocation=&quot;http://www.eeml.org/xsd/005 http://www.eeml.org/xsd/005/005.xsd&quot;&gt;&lt;environment&gt;&lt;data id=&quot;0&quot;&gt;&lt;value&gt;36.2&lt;/value&gt;&lt;/data&gt;&lt;/environment&gt;&lt;/eeml&gt;'
     end
 
     it &quot;should allow access to the data item&quot; do
@@ -160,7 +160,7 @@ describe EEML::Environment do
   describe &quot;being created from XML&quot; do
     
     it &quot;parses the 'minimal' EEML example document&quot; do
-      eeml = '&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;eeml xmlns=&quot;http://www.eeml.org/xsd/005&quot; xsi:schemaLocation=&quot;http://www.eeml.org/xsd/005 http://www.eeml.org/xsd/005/005.xsd&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&gt;&lt;environment&gt;&lt;data id=&quot;0&quot;&gt;&lt;value&gt;36.2&lt;/value&gt;&lt;/data&gt;&lt;/environment&gt;&lt;/eeml&gt;'
+      eeml = '&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;eeml xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns=&quot;http://www.eeml.org/xsd/005&quot; xsi:schemaLocation=&quot;http://www.eeml.org/xsd/005 http://www.eeml.org/xsd/005/005.xsd&quot;&gt;&lt;environment&gt;&lt;data id=&quot;0&quot;&gt;&lt;value&gt;36.2&lt;/value&gt;&lt;/data&gt;&lt;/environment&gt;&lt;/eeml&gt;'
       env = EEML::Environment.from_eeml(eeml)
       env.size.should be(1)
       env[0].value.should be_close(36.2, 1e-9)
@@ -179,6 +179,10 @@ describe EEML::Environment do
       @env.icon = &quot;http://www.roomsomewhere/icon.png&quot;
       @env.website = &quot;http://www.roomsomewhere/&quot;
       @env.email = &quot;myemail@roomsomewhere&quot;
+      @env.updated_at = Time.utc(2007, 05, 04, 18, 13, 51)
+      @env.creator = &quot;http://www.haque.co.uk&quot;
+      @env.id = 1
+      @env.location = EEML::Location.new(:physical, :exposure =&gt; :indoor, :disposition =&gt; :fixed, :name =&gt; &quot;My Room&quot;, :lat =&gt; 32.4, :lon =&gt; 22.7, :ele =&gt; 0.2)
       @data0 = EEML::Data.new(36.2)
       @data0.tags &lt;&lt; &quot;temperature&quot;
       @data0.max_value = 48.0
@@ -189,8 +193,8 @@ describe EEML::Environment do
       @data1.tags &lt;&lt; &quot;blush&quot;
       @data1.tags &lt;&lt; &quot;redness&quot;
       @data1.tags &lt;&lt; &quot;embarrassment&quot;      
-      @data1.max_value = 0.0
-      @data1.min_value = 100.0
+      @data1.max_value = 100.0
+      @data1.min_value = 0.0
       @data1.unit = EEML::Unit.new(&quot;blushesPerHour&quot;, :type =&gt; :contextDependentUnits)
       @env &lt;&lt; @data1
       @data2 = EEML::Data.new(12.3)
@@ -203,7 +207,7 @@ describe EEML::Environment do
     end
 
     it &quot;generates the 'complete' EEML example document&quot; do
-      @env.to_eeml.should == '&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;eeml xmlns=&quot;http://www.eeml.org/xsd/005&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://www.eeml.org/xsd/005 http://www.eeml.org/xsd/005/005.xsd&quot; version=&quot;5&quot;&gt;&lt;environment updated=&quot;2007-05-04T18:13:51.0Z&quot; creator=&quot;http://www.haque.co.uk&quot; id=&quot;1&quot;&gt;&lt;title&gt;A Room Somewhere&lt;/title&gt;&lt;feed&gt;http://www.pachube.com/feeds/1.xml&lt;/feed&gt;&lt;status&gt;frozen&lt;/status&gt;&lt;description&gt;This is a room somewhere&lt;/description&gt;&lt;icon&gt;http://www.roomsomewhere/icon.png&lt;/icon&gt;&lt;website&gt;http://www.roomsomewhere/&lt;/website&gt;&lt;email&gt;myemail@roomsomewhere&lt;/email&gt;&lt;location exposure=&quot;indoor&quot; domain=&quot;physical&quot; disposition=&quot;fixed&quot;&gt;&lt;name&gt;My Room&lt;/name&gt;&lt;lat&gt;32.4&lt;/lat&gt;&lt;lon&gt;22.7&lt;/lon&gt;&lt;ele&gt;0.2&lt;/ele&gt;&lt;/location&gt;&lt;data id=&quot;0&quot;&gt;&lt;tag&gt;temperature&lt;/tag&gt;&lt;value minValue=&quot;23.0&quot; maxValue=&quot;48.0&quot;&gt;36.2&lt;/value&gt;&lt;unit symbol=&quot;C&quot; type=&quot;derivedSI&quot;&gt;Celsius&lt;/unit&gt;&lt;/data&gt;&lt;data id=&quot;1&quot;&gt;&lt;tag&gt;blush&lt;/tag&gt;&lt;tag&gt;redness&lt;/tag&gt;&lt;tag&gt;embarrassment&lt;/tag&gt;&lt;value minValue=&quot;0.0&quot; maxValue=&quot;100.0&quot;&gt;84.0&lt;/value&gt;&lt;unit type=&quot;contextDependentUnits&quot;&gt;blushesPerHour&lt;/unit&gt;&lt;/data&gt;&lt;data id=&quot;2&quot;&gt;&lt;tag&gt;length&lt;/tag&gt;&lt;tag&gt;distance&lt;/tag&gt;&lt;tag&gt;extension&lt;/tag&gt;&lt;value minValue=&quot;0.0&quot;&gt;12.3&lt;/value&gt;&lt;unit symbol=&quot;m&quot; type=&quot;basicSI&quot;&gt;meter&lt;/unit&gt;&lt;/data&gt;&lt;/environment&gt;&lt;/eeml&gt;'
+      @env.to_eeml(5).should == '&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;eeml xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; version=&quot;5&quot; xmlns=&quot;http://www.eeml.org/xsd/005&quot; xsi:schemaLocation=&quot;http://www.eeml.org/xsd/005 http://www.eeml.org/xsd/005/005.xsd&quot;&gt;&lt;environment updated=&quot;2007-05-04T18:13:51Z&quot; creator=&quot;http://www.haque.co.uk&quot; id=&quot;1&quot;&gt;&lt;title&gt;A Room Somewhere&lt;/title&gt;&lt;feed&gt;http://www.pachube.com/feeds/1.xml&lt;/feed&gt;&lt;status&gt;frozen&lt;/status&gt;&lt;description&gt;This is a room somewhere&lt;/description&gt;&lt;icon&gt;http://www.roomsomewhere/icon.png&lt;/icon&gt;&lt;website&gt;http://www.roomsomewhere/&lt;/website&gt;&lt;email&gt;myemail@roomsomewhere&lt;/email&gt;&lt;location domain=&quot;physical&quot; exposure=&quot;indoor&quot; disposition=&quot;fixed&quot;&gt;&lt;name&gt;My Room&lt;/name&gt;&lt;lat&gt;32.4&lt;/lat&gt;&lt;lon&gt;22.7&lt;/lon&gt;&lt;ele&gt;0.2&lt;/ele&gt;&lt;/location&gt;&lt;data id=&quot;0&quot;&gt;&lt;tag&gt;temperature&lt;/tag&gt;&lt;value minValue=&quot;23.0&quot; maxValue=&quot;48.0&quot;&gt;36.2&lt;/value&gt;&lt;unit type=&quot;derivedSI&quot; symbol=&quot;C&quot;&gt;Celsius&lt;/unit&gt;&lt;/data&gt;&lt;data id=&quot;1&quot;&gt;&lt;tag&gt;blush&lt;/tag&gt;&lt;tag&gt;redness&lt;/tag&gt;&lt;tag&gt;embarrassment&lt;/tag&gt;&lt;value minValue=&quot;0.0&quot; maxValue=&quot;100.0&quot;&gt;84.0&lt;/value&gt;&lt;unit type=&quot;contextDependentUnits&quot;&gt;blushesPerHour&lt;/unit&gt;&lt;/data&gt;&lt;data id=&quot;2&quot;&gt;&lt;tag&gt;length&lt;/tag&gt;&lt;tag&gt;distance&lt;/tag&gt;&lt;tag&gt;extension&lt;/tag&gt;&lt;value minValue=&quot;0.0&quot;&gt;12.3&lt;/value&gt;&lt;unit type=&quot;basicSI&quot; symbol=&quot;m&quot;&gt;meter&lt;/unit&gt;&lt;/data&gt;&lt;/environment&gt;&lt;/eeml&gt;'
     end
 
   end</diff>
      <filename>spec/environment_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>4c8db5c7c6b32656e2fabf6d766c6c4244631443</id>
    </parent>
  </parents>
  <author>
    <name>James Smith</name>
    <email>james@floppy.org.uk</email>
  </author>
  <url>http://github.com/Floppy/eeml-ruby/commit/a7cf98d929d528f92e58ceff15c16b0165b99d76</url>
  <id>a7cf98d929d528f92e58ceff15c16b0165b99d76</id>
  <committed-date>2008-08-26T16:08:15-07:00</committed-date>
  <authored-date>2008-08-26T16:08:15-07:00</authored-date>
  <message>Add Location and new Environment options to EEML output. Implements &quot;complete&quot; example.</message>
  <tree>7995260fcb4a840d7c1be428a517256e8d5171bc</tree>
  <committer>
    <name>James Smith</name>
    <email>james@floppy.org.uk</email>
  </committer>
</commit>
