<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,7 +1,7 @@
 Gem::Specification.new do |s|
   s.name = &quot;amee&quot;
-  s.version = &quot;2.0.25&quot;
-  s.date = &quot;2009-10-01&quot;
+  s.version = &quot;2.0.27&quot;
+  s.date = &quot;2009-10-16&quot;
   s.summary = &quot;Ruby interface to the AMEE carbon calculator&quot;
   s.email = &quot;james@floppy.org.uk&quot;
   s.homepage = &quot;http://github.com/Floppy/amee-ruby&quot;</diff>
      <filename>amee-ruby.gemspec</filename>
    </modified>
    <modified>
      <diff>@@ -7,11 +7,13 @@ module AMEE
       def initialize(data = {})
         @children = data ? data[:children] : []
         @items = data ? data[:items] : []
+        @pager = data ? data[:pager] : nil
         super
       end
 
       attr_reader :children
       attr_reader :items
+      attr_reader :pager
 
       def self.from_json(json)
         # Parse json
@@ -23,6 +25,7 @@ module AMEE
         data[:name] = doc['dataCategory']['name']
         data[:path] = doc['path']
         data[:children] = []
+        data[:pager] = AMEE::Pager.from_json(doc['children']['pager'])
         doc['children']['dataCategories'].each do |child|
           category_data = {}
           category_data[:name] = child['name']
@@ -55,6 +58,7 @@ module AMEE
         data[:modified] = DateTime.parse(REXML::XPath.first(doc, &quot;/Resources/DataCategoryResource/DataCategory/@modified&quot;).to_s)
         data[:name] = REXML::XPath.first(doc, '/Resources/DataCategoryResource/DataCategory/?ame').text
         data[:path] = REXML::XPath.first(doc, '/Resources/DataCategoryResource//?ath').text || &quot;&quot;
+        data[:pager] = AMEE::Pager.from_xml(REXML::XPath.first(doc, '//Pager'))
         data[:children] = []
         REXML::XPath.each(doc, '/Resources/DataCategoryResource//Children/DataCategories/DataCategory') do |child|
           category_data = {}</diff>
      <filename>lib/amee/data_category.rb</filename>
    </modified>
    <modified>
      <diff>@@ -28,6 +28,7 @@ module AMEE
     attr_reader :items_found
 
     def self.from_xml(node)
+      return nil if node.nil? || node.elements.empty?
       return Pager.new({:start =&gt; node.elements[&quot;Start&quot;].text.to_i,
                         :from =&gt; node.elements[&quot;From&quot;].text.to_i,
                         :to =&gt; node.elements[&quot;To&quot;].text.to_i,
@@ -42,6 +43,7 @@ module AMEE
     end
 
     def self.from_json(node)
+      return nil if node.nil? || node.empty?
       return Pager.new({:start =&gt; node[&quot;start&quot;],
                         :from =&gt; node[&quot;from&quot;],
                         :to =&gt; node[&quot;to&quot;],
@@ -56,4 +58,4 @@ module AMEE
     end
 
   end
-end
\ No newline at end of file
+end</diff>
      <filename>lib/amee/pager.rb</filename>
    </modified>
    <modified>
      <diff>@@ -11,6 +11,7 @@ module AMEE
         @total_amount_unit = data[:total_amount_unit]
         @start_date = data[:start_date]
         @end_date = data[:end_date]
+        @pager = data[:pager]
         super
       end
 
@@ -18,6 +19,7 @@ module AMEE
       attr_reader :items
       attr_reader :total_amount
       attr_reader :total_amount_unit
+      attr_reader :pager
 
       def start_date
         @start_date || profile_date
@@ -109,6 +111,7 @@ module AMEE
         data[:path] = doc['path']
         data[:total_amount] = doc['totalAmountPerMonth']
         data[:total_amount_unit] = &quot;kg/month&quot;
+        data[:pager] = AMEE::Pager.from_json(doc['children']['pager']) rescue nil
         data[:children] = []
         if doc['children'] &amp;&amp; doc['children']['dataCategories']
           doc['children']['dataCategories'].each do |child|
@@ -139,6 +142,7 @@ module AMEE
         data[:path] = doc['path']
         data[:total_amount] = doc['totalAmount']['value'].to_f rescue nil
         data[:total_amount_unit] = doc['totalAmount']['unit'] rescue nil
+        data[:pager] = AMEE::Pager.from_json(doc['pager']) rescue nil
         data[:children] = []
         if doc['profileCategories']
           doc['profileCategories'].each do |child|
@@ -238,6 +242,7 @@ module AMEE
         data[:path] = &quot;/#{data[:path]}&quot; if data[:path].slice(0,1) != '/'
         data[:total_amount] = REXML::XPath.first(doc, '/Resources/ProfileCategoryResource/TotalAmountPerMonth').text.to_f rescue nil
         data[:total_amount_unit] = &quot;kg/month&quot;
+        data[:pager] = AMEE::Pager.from_xml(REXML::XPath.first(doc, '//Pager'))
         data[:children] = []
         REXML::XPath.each(doc, '/Resources/ProfileCategoryResource/Children/ProfileCategories/DataCategory | /Resources/ProfileCategoryResource/Children/DataCategories/DataCategory') do |child|
           category_data = {}
@@ -318,6 +323,7 @@ module AMEE
         data[:path] = REXML::XPath.first(doc, '/Resources/ProfileCategoryResource/Path').text || &quot;&quot;
         data[:total_amount] = REXML::XPath.first(doc, '/Resources/ProfileCategoryResource/TotalAmount').text.to_f rescue nil
         data[:total_amount_unit] = REXML::XPath.first(doc, '/Resources/ProfileCategoryResource/TotalAmount/@unit').to_s rescue nil
+        data[:pager] = AMEE::Pager.from_xml(REXML::XPath.first(doc, '//Pager'))
         data[:children] = []
         REXML::XPath.each(doc, '/Resources/ProfileCategoryResource/ProfileCategories/DataCategory') do |child|
           category_data = {}</diff>
      <filename>lib/amee/profile_category.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,7 +7,8 @@ module AMEE
 
     class Connection
       def self.global(options = {})
-        unless @connection          
+        unless @connection
+          $AMEE_CONFIG ||= {} # Make default values nil
           @connection = self.connect($AMEE_CONFIG['server'], $AMEE_CONFIG['username'], $AMEE_CONFIG['password'], options)
           # Also store as $amee for backwards compatibility, though this is now deprecated
           $amee = @connection</diff>
      <filename>lib/amee/rails.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,7 @@ module AMEE
   module VERSION #:nodoc:
     MAJOR = 2
     MINOR = 0
-    TINY  = 22
+    TINY  = 27
     STRING = [MAJOR, MINOR, TINY].join('.')
   end
   </diff>
      <filename>lib/amee/version.rb</filename>
    </modified>
    <modified>
      <diff>@@ -46,6 +46,7 @@ describe AMEE::Data::Category, &quot;accessing AMEE V0&quot; do
     @root.uid.should == &quot;63EA08D29C63&quot;
     @root.created.should == DateTime.new(2007,4,16,17,50,43)
     @root.modified.should == DateTime.new(2007,4,16,17,50,43)
+    @root.pager.should be_nil
     @root.children.size.should be(3)
     @root.children[0][:uid].should == &quot;5376F191D80E&quot;
     @root.children[0][:name].should == &quot;Metadata&quot;
@@ -62,6 +63,7 @@ describe AMEE::Data::Category, &quot;accessing AMEE V0&quot; do
     @data.items[0][:label].should == &quot;Biodiesel&quot;
     @data.items[0][:path].should == &quot;9DC114F06AB2&quot;
     @data.items[0][:fuelKgCO2PerLitre].should == &quot;2.5&quot;
+    @data.pager.should be_nil
   end
 
 end
@@ -82,6 +84,7 @@ describe AMEE::Data::Category, &quot;with an authenticated XML connection&quot; do
     @root.children[0][:uid].should == &quot;BBA3AC3E795E&quot;
     @root.children[0][:name].should == &quot;Home&quot;
     @root.children[0][:path].should == &quot;home&quot;
+    @root.pager.should be_nil
   end
 
   it &quot;should provide access to child objects&quot; do
@@ -94,6 +97,7 @@ describe AMEE::Data::Category, &quot;with an authenticated XML connection&quot; do
     @transport.full_path.should == &quot;/data/transport&quot;
     @transport.uid.should == &quot;263FC0186834&quot;
     @transport.children.size.should be(7)
+    @transport.pager.should be_nil
   end
 
   it &quot;should parse data items&quot; do
@@ -106,6 +110,7 @@ describe AMEE::Data::Category, &quot;with an authenticated XML connection&quot; do
     @data.items[0][:label].should == &quot;domestic&quot;
     @data.items[0][:path].should == &quot;AD63A83B4D41&quot;
     @data.items[0][:source].should == &quot;DfT INAS Division, 29 March 2007&quot;
+    @data.pager.should_not be_nil
   end
 
   it &quot;should fail gracefully with incorrect data&quot; do
@@ -143,6 +148,7 @@ describe AMEE::Data::Category, &quot;with an authenticated JSON connection&quot; do
     @root.children[0][:uid].should == &quot;BBA3AC3E795E&quot;
     @root.children[0][:name].should == &quot;Home&quot;
     @root.children[0][:path].should == &quot;home&quot;
+    @root.pager.should be_nil
   end
 
   it &quot;should provide access to child objects&quot; do
@@ -155,6 +161,7 @@ describe AMEE::Data::Category, &quot;with an authenticated JSON connection&quot; do
     @transport.full_path.should == &quot;/data/transport&quot;
     @transport.uid.should == &quot;263FC0186834&quot;
     @transport.children.size.should be(7)
+    @transport.pager.should be_nil
   end
 
   it &quot;should parse data items&quot; do
@@ -167,6 +174,7 @@ describe AMEE::Data::Category, &quot;with an authenticated JSON connection&quot; do
     @data.items[0][:label].should == &quot;domestic&quot;
     @data.items[0][:path].should == &quot;AD63A83B4D41&quot;    
     @data.items[0][:source].should == &quot;DfT INAS Division, 29 March 2007&quot;
+    @data.pager.should_not be_nil
   end
 
   it &quot;should fail gracefully with incorrect data&quot; do
@@ -186,4 +194,4 @@ describe AMEE::Data::Category, &quot;with an authenticated connection&quot; do
     lambda{AMEE::Data::Category.get(connection, &quot;/data&quot;)}.should raise_error(AMEE::BadData, &quot;Couldn't load DataCategory. Check that your URL is correct.\n&quot;)
   end
 
-end
\ No newline at end of file
+end</diff>
      <filename>spec/data_category_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -55,6 +55,7 @@ describe AMEE::Profile::Category, &quot;accessing AMEE V0&quot; do
     @cat.children[0][:uid].should == &quot;3A72CC3F2AC9&quot;
     @cat.children[0][:name].should == &quot;Television&quot;
     @cat.children[0][:path].should == &quot;television&quot;
+    @cat.pager.should be_nil
   end
 
   it &quot;should parse data items&quot; do
@@ -76,6 +77,7 @@ describe AMEE::Profile::Category, &quot;accessing AMEE V0&quot; do
     @cat.items[0][:values].size.should be(8)
     @cat.items[0][:values][:transportNumberOfJourneys].should == &quot;0.0833333333333333&quot;
     @cat.items[0][:values][:transportEcoDriving].should == &quot;false&quot;
+    @cat.pager.should be_nil
   end
 
 end
@@ -96,6 +98,7 @@ describe AMEE::Profile::Category, &quot;with an authenticated XML connection&quot; do
     @cat.children[0][:uid].should == &quot;427DFCC65E52&quot;
     @cat.children[0][:name].should == &quot;Appliances&quot;
     @cat.children[0][:path].should == &quot;appliances&quot;
+    @cat.pager.should be_nil
   end
 
   it &quot;should provide access to child objects&quot; do
@@ -108,6 +111,7 @@ describe AMEE::Profile::Category, &quot;with an authenticated XML connection&quot; do
     @child.path.should == &quot;/home/appliances&quot;
     @child.full_path.should == &quot;/profiles/E54C5525AA3E/home/appliances&quot;
     @child.children.size.should be(5)
+    @child.pager.should be_nil
   end
 
   it &quot;should parse data items&quot; do
@@ -130,6 +134,7 @@ describe AMEE::Profile::Category, &quot;with an authenticated XML connection&quot; do
     @cat.items[0][:values][:kWhPerMonth].should == &quot;12&quot;
     @cat.items[0][:values][:kgPerMonth].should == &quot;0&quot;
     @cat.items[0][:values][:litresPerMonth].should == &quot;0&quot;
+    @cat.pager.should_not be_nil
   end
 
   it &quot;should fail gracefully with incorrect data&quot; do
@@ -161,6 +166,7 @@ describe AMEE::Profile::Category, &quot;with an authenticated XML connection&quot; do
     cat.children[1][:items][0][:dataItemUid].should == &quot;4F6CBCEE95F7&quot;
     cat.children[1][:items][0][:values][:airconTypical].should == &quot;true&quot;
     cat.children[1][:items][0][:uid].should == &quot;8450D6D97D2D&quot;
+    cat.pager.should be_nil
   end
 
 end
@@ -180,6 +186,7 @@ describe AMEE::Profile::Category, &quot;with an authenticated version 2 XML connectio
     @cat.children[0][:uid].should == &quot;427DFCC65E52&quot;
     @cat.children[0][:name].should == &quot;Appliances&quot;
     @cat.children[0][:path].should == &quot;appliances&quot;
+    @cat.pager.should be_nil
   end
 
   it &quot;should parse data items&quot; do
@@ -205,6 +212,7 @@ describe AMEE::Profile::Category, &quot;with an authenticated version 2 XML connectio
     @cat.items[0][:values][:energyConsumption][:per_unit].should == &quot;month&quot;
     @cat.items[0][:values][:massPerTime][:value].should == &quot;0&quot;
     @cat.items[0][:values][:volumePerTime][:value].should == &quot;0&quot;
+    @cat.pager.should_not be_nil
   end
 
   it &quot;should fail gracefully with incorrect data&quot; do
@@ -331,6 +339,7 @@ describe AMEE::Profile::Category, &quot;with an authenticated JSON connection&quot; do
     @cat.children[0][:uid].should == &quot;427DFCC65E52&quot;
     @cat.children[0][:name].should == &quot;Appliances&quot;
     @cat.children[0][:path].should == &quot;appliances&quot;
+    @cat.pager.should be_nil
   end
 
   it &quot;should provide access to child objects&quot; do
@@ -343,6 +352,7 @@ describe AMEE::Profile::Category, &quot;with an authenticated JSON connection&quot; do
     @child.path.should == &quot;/home/appliances&quot;
     @child.full_path.should == &quot;/profiles/E54C5525AA3E/home/appliances&quot;
     @child.children.size.should be(5)
+    @child.pager.should be_nil
   end
 
   it &quot;should parse data items&quot; do
@@ -365,7 +375,8 @@ describe AMEE::Profile::Category, &quot;with an authenticated JSON connection&quot; do
     @cat.items[0][:values][:kWhPerMonth].should == &quot;12&quot;
     @cat.items[0][:values][:kgPerMonth].should == &quot;0&quot;
     @cat.items[0][:values][:litresPerMonth].should == &quot;0&quot;
-  end
+    @cat.pager.should_not be_nil
+ end
 
   it &quot;should fail gracefully with incorrect data&quot; do
     connection = flexmock &quot;connection&quot;
@@ -395,6 +406,7 @@ describe AMEE::Profile::Category, &quot;with an authenticated JSON connection&quot; do
     cat.children[1][:items][0][:dataItemUid].should == &quot;4F6CBCEE95F7&quot;
     cat.children[1][:items][0][:values][:airconTypical].should == &quot;true&quot;
     cat.children[1][:items][0][:uid].should == &quot;8450D6D97D2D&quot;
+    cat.pager.should be_nil
   end
 
 end
@@ -414,6 +426,7 @@ describe AMEE::Profile::Category, &quot;with an authenticated V2 JSON connection&quot; do
     @cat.children[0][:uid].should == &quot;427DFCC65E52&quot;
     @cat.children[0][:name].should == &quot;Appliances&quot;
     @cat.children[0][:path].should == &quot;appliances&quot;
+    @cat.pager.should be_nil
   end
 
   it &quot;should provide access to child objects&quot; do
@@ -426,6 +439,7 @@ describe AMEE::Profile::Category, &quot;with an authenticated V2 JSON connection&quot; do
     @child.path.should == &quot;/home/appliances&quot;
     @child.full_path.should == &quot;/profiles/447C40EB29FB/home/appliances&quot;
     @child.children.size.should be(5)
+    @child.pager.should be_nil
   end
 
   it &quot;should parse data items&quot; do
@@ -451,6 +465,7 @@ describe AMEE::Profile::Category, &quot;with an authenticated V2 JSON connection&quot; do
     @cat.items[0][:values][:energyConsumption][:per_unit].should == &quot;month&quot;
     @cat.items[0][:values][:massPerTime][:value].should == &quot;0&quot;
     @cat.items[0][:values][:volumePerTime][:value].should == &quot;0&quot;
+    @cat.pager.should_not be_nil
   end
   
 #</diff>
      <filename>spec/profile_category_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>d7b36e6f0243eda881d758ece4588fe92307a192</id>
    </parent>
    <parent>
      <id>3fe9067613a949c71798c7d11a4a2828c4b31b48</id>
    </parent>
  </parents>
  <author>
    <name>steve matthew</name>
    <email>steve@steve-mbp.local</email>
  </author>
  <url>http://github.com/Floppy/amee-ruby/commit/66e361b76f5bfe61fdcb940835ba3fdb40d3e4cc</url>
  <id>66e361b76f5bfe61fdcb940835ba3fdb40d3e4cc</id>
  <committed-date>2009-10-23T08:31:57-07:00</committed-date>
  <authored-date>2009-10-23T08:31:57-07:00</authored-date>
  <message>Merge branch 'master' of git@github.com:Floppy/amee-ruby</message>
  <tree>2d5e2266ad63fbe36d10e557cace046f0a77df11</tree>
  <committer>
    <name>steve matthew</name>
    <email>steve@steve-mbp.local</email>
  </committer>
</commit>
