amee 4.1.7 → 4.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.txt CHANGED
@@ -1,5 +1,9 @@
1
1
  = Changelog
2
2
 
3
+ == 4.2.0 (also 3.2.0/3.2.1 for Rails 2)
4
+ * Add algorithm details to ItemDefinitions
5
+ * Bugfix when using AMEE::Rails.connection from locations other than Rails.root
6
+
3
7
  == 4.1.7
4
8
  * Compatibility with Ruby 1.9.2
5
9
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.1.7
1
+ 4.2.0
data/amee.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{amee}
8
- s.version = "4.1.7"
8
+ s.version = "4.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["James Smith", "James Hetherington", "Andrew Hill", "Andrew Berkeley"]
12
- s.date = %q{2011-10-28}
12
+ s.date = %q{2011-11-17}
13
13
  s.default_executable = %q{ameesh}
14
14
  s.email = %q{james@floppy.org.uk}
15
15
  s.executables = ["ameesh"]
@@ -116,6 +116,7 @@ Gem::Specification.new do |s|
116
116
  "spec/profile_spec.rb",
117
117
  "spec/rails_spec.rb",
118
118
  "spec/spec.opts",
119
+ "spec/spec_amee_config.rb",
119
120
  "spec/spec_helper.rb",
120
121
  "spec/user_spec.rb",
121
122
  "spec/v3/connection_spec.rb",
data/lib/amee.rb CHANGED
@@ -60,7 +60,7 @@ if defined?(Rails)
60
60
  require 'amee/rails'
61
61
  ActiveRecord::Base.send :include, AMEE::Rails
62
62
 
63
- amee_config = "config/amee.yml"
63
+ amee_config = "#{Rails.root}/config/amee.yml"
64
64
  if File.exist? amee_config
65
65
  $AMEE_CONFIG = AMEE::Config.setup(amee_config, Rails.env)
66
66
  else
data/lib/amee/v3.rb CHANGED
@@ -1,8 +1,6 @@
1
1
  # Copyright (C) 2008-2011 AMEE UK Ltd. - http://www.amee.com
2
2
  # Released as Open Source Software under the BSD 3-Clause license. See LICENSE.txt for details.
3
3
 
4
- AMEE_API_VERSION = '3.3'
5
-
6
4
  require 'amee/v3/meta_helper'
7
5
  require 'amee/v3/collection'
8
6
  require 'amee/v3/connection'
@@ -3,6 +3,11 @@
3
3
 
4
4
  module AMEE
5
5
  class Connection
6
+
7
+ def self.api_version
8
+ '3'
9
+ end
10
+
6
11
  def v3_connection
7
12
  @v3_http ||= begin
8
13
  @v3_http = Net::HTTP.new(v3_hostname, @port)
@@ -10,10 +10,11 @@ module AMEE
10
10
  alias_method :initialize_without_v3, :initialize
11
11
  def initialize(data = {})
12
12
  @usages = data[:usages] || []
13
+ @algorithms = data[:algorithms] || {}
13
14
  initialize_without_v3(data)
14
15
  end
15
16
 
16
- attr_accessor :usages
17
+ attr_accessor :usages, :algorithms
17
18
 
18
19
  def self.metaxmlpathpreamble
19
20
  '/Representation/ItemDefinition/'
@@ -25,7 +26,7 @@ module AMEE
25
26
 
26
27
  def self.v3_get(connection, uid, options={})
27
28
  # Load data from path
28
- response = connection.v3_get("/#{AMEE_API_VERSION}/definitions/#{uid};full", options)
29
+ response = connection.v3_get("/#{AMEE::Connection.api_version}/definitions/#{uid};full", options)
29
30
  # Parse response
30
31
  item_definition = ItemDefinition.parse(connection, response, false)
31
32
  # Done
@@ -48,6 +49,11 @@ module AMEE
48
49
  data[:name] = x 'Name', :doc => doc, :meta => true
49
50
  data[:drillDown] = x('DrillDown', :doc => doc, :meta => true).split(",") rescue nil
50
51
  data[:usages] = [(x 'Usages/Usage/Name', :doc => doc, :meta => true)].flatten.delete_if{|x| x.nil?}
52
+ data[:algorithms] = begin
53
+ names = [(x 'Algorithms/Algorithm/Name', :doc => doc, :meta => true)].flatten.delete_if{|x| x.nil?}
54
+ uids = [(x 'Algorithms/Algorithm/@uid', :doc => doc, :meta => true)].flatten.delete_if{|x| x.nil?}
55
+ Hash[names.zip(uids)]
56
+ end
51
57
  # Create object
52
58
  ItemDefinition.new(data)
53
59
  rescue
@@ -59,12 +65,12 @@ module AMEE
59
65
  :usages => @usages.join(','),
60
66
  :name => @name
61
67
  }
62
- @connection.v3_put("/#{AMEE_API_VERSION}/definitions/#{@uid}",save_options)
68
+ @connection.v3_put("/#{AMEE::Connection.api_version}/definitions/#{@uid}",save_options)
63
69
  end
64
70
 
65
71
  alias_method :expire_cache_without_v3, :expire_cache
66
72
  def expire_cache
67
- @connection.expire_matching("/#{AMEE_API_VERSION}/definitions/#{@uid}.*")
73
+ @connection.expire_matching("/#{AMEE::Connection.api_version}/definitions/#{@uid}.*")
68
74
  expire_cache_without_v3
69
75
  end
70
76
  end
@@ -13,7 +13,7 @@ module AMEE
13
13
  end
14
14
 
15
15
  def metapath
16
- "/#{AMEE_API_VERSION}/definitions/#{itemdefuid}/values/#{uid};wikiDoc;usages"
16
+ "/#{AMEE::Connection.api_version}/definitions/#{itemdefuid}/values/#{uid};wikiDoc;usages"
17
17
  end
18
18
  def metaxmlpathpreamble
19
19
  '/Representation/ItemValueDefinition/'
@@ -90,7 +90,7 @@ EOF
90
90
 
91
91
  alias_method :expire_cache_without_v3, :expire_cache
92
92
  def expire_cache
93
- @connection.expire_matching("/#{AMEE_API_VERSION}/definitions/#{itemdefuid}/values/#{uid}.*")
93
+ @connection.expire_matching("/#{AMEE::Connection.api_version}/definitions/#{itemdefuid}/values/#{uid}.*")
94
94
  expire_cache_without_v3
95
95
  end
96
96
  end
@@ -13,7 +13,7 @@ module AMEE
13
13
  end
14
14
 
15
15
  def collectionpath
16
- "/#{AMEE_API_VERSION}/definitions/#{@uid}/values;full"
16
+ "/#{AMEE::Connection.api_version}/definitions/#{@uid}/values;full"
17
17
  end
18
18
 
19
19
  def xmlcollectorpath
@@ -15,7 +15,7 @@ module AMEE
15
15
  ReturnValueDefinition
16
16
  end
17
17
  def collectionpath
18
- "/#{AMEE_API_VERSION}/definitions/#{@uid}/returnvalues;full"
18
+ "/#{AMEE::Connection.api_version}/definitions/#{@uid}/returnvalues;full"
19
19
  end
20
20
 
21
21
  def jsoncollector
@@ -138,7 +138,7 @@ module AMEE
138
138
 
139
139
 
140
140
  def self.load(connection,itemdefuid,ivduid,options={})
141
- ReturnValueDefinition.get(connection,"/#{AMEE_API_VERSION}/definitions/#{itemdefuid}/returnvalues/#{ivduid};full",options)
141
+ ReturnValueDefinition.get(connection,"/#{AMEE::Connection.api_version}/definitions/#{itemdefuid}/returnvalues/#{ivduid};full",options)
142
142
  end
143
143
 
144
144
  def reload(connection)
@@ -178,7 +178,7 @@ module AMEE
178
178
  end
179
179
 
180
180
  options.merge!(:returnobj=>true)
181
- response = connection.v3_post("/#{AMEE_API_VERSION}/definitions/#{itemdefuid}/returnvalues", options)
181
+ response = connection.v3_post("/#{AMEE::Connection.api_version}/definitions/#{itemdefuid}/returnvalues", options)
182
182
  return ReturnValueDefinition.load(connection,itemdefuid , response['Location'].split('/')[7])
183
183
  rescue
184
184
  raise AMEE::BadData.new("Couldn't create ReturnValueDefinition. Check that your information is correct.\n#{response}")
@@ -189,7 +189,7 @@ module AMEE
189
189
  # Deleting takes a while... up the timeout to 120 seconds temporarily
190
190
  t = connection.timeout
191
191
  connection.timeout = 120
192
- connection.v3_delete("/#{AMEE_API_VERSION}/definitions/#{itemdefuid}/returnvalues/" + return_value_definition.uid)
192
+ connection.v3_delete("/#{AMEE::Connection.api_version}/definitions/#{itemdefuid}/returnvalues/" + return_value_definition.uid)
193
193
  connection.timeout = t
194
194
  rescue
195
195
  raise AMEE::BadData.new("Couldn't delete ReturnValueDefinition. Check that your information is correct.")
@@ -127,7 +127,7 @@ describe AMEE::Data::Category, "with an authenticated XML connection" do
127
127
  connection = flexmock "connection"
128
128
  connection.should_receive(:retries).and_return(0)
129
129
  connection.should_receive(:get).with("/data/transport/plane/generic", {:itemsPerPage => 10}).and_return(flexmock(:body => '<?xml version="1.0" encoding="UTF-8"?><Resources><DataCategoryResource><Path>/transport/plane/generic</Path><DataCategory created="2007-08-01 09:00:23.0" modified="2007-08-01 09:00:23.0" uid="FBA97B70DBDF"><Name>Generic</Name><Path>generic</Path><Environment uid="5F5887BCF726"/><DataCategory uid="6F3692D81CD9"><Name>Plane</Name><Path>plane</Path></DataCategory><ItemDefinition uid="441BF4BEA15B"/></DataCategory><Children><DataCategories/><DataItems><DataItem created="2007-08-01 09:00:41.0" modified="2007-08-01 09:00:41.0" uid="AD63A83B4D41"><kgCO2PerPassengerJourney>0</kgCO2PerPassengerJourney><type>domestic</type><label>domestic</label><size>-</size><path>AD63A83B4D41</path><source>DfT INAS Division, 29 March 2007</source><kgCO2PerPassengerKm>0.158</kgCO2PerPassengerKm></DataItem><DataItem created="2007-08-01 09:00:41.0" modified="2007-08-01 09:00:41.0" uid="FFC7A05D54AD"><kgCO2PerPassengerJourney>73</kgCO2PerPassengerJourney><type>domestic</type><label>domestic, one way</label><size>one way</size><path>FFC7A05D54AD</path><source>DfT INAS Division, 29 March 2007</source><kgCO2PerPassengerKm>0</kgCO2PerPassengerKm></DataItem><DataItem created="2007-08-01 09:00:41.0" modified="2007-08-01 09:00:41.0" uid="F5498AD6FC75"><kgCO2PerPassengerJourney>146</kgCO2PerPassengerJourney><type>domestic</type><label>domestic, return</label><size>return</size><path>F5498AD6FC75</path><source>DfT INAS Division, 29 March 2007</source><kgCO2PerPassengerKm>0</kgCO2PerPassengerKm></DataItem><DataItem created="2007-08-01 09:00:41.0" modified="2007-08-01 09:00:41.0" uid="7D4220DF72F9"><kgCO2PerPassengerJourney>0</kgCO2PerPassengerJourney><type>long haul</type><label>long haul</label><size>-</size><path>7D4220DF72F9</path><source>DfT INAS Division, 29 March 2007</source><kgCO2PerPassengerKm>0.105</kgCO2PerPassengerKm></DataItem><DataItem created="2007-08-01 09:00:41.0" modified="2007-08-01 09:00:41.0" uid="46117F6C0B7E"><kgCO2PerPassengerJourney>801</kgCO2PerPassengerJourney><type>long haul</type><label>long haul, one way</label><size>one way</size><path>46117F6C0B7E</path><source>DfT INAS Division, 29 March 2007</source><kgCO2PerPassengerKm>0</kgCO2PerPassengerKm></DataItem><DataItem created="2007-08-01 09:00:41.0" modified="2007-08-01 09:00:41.0" uid="96D538B1B246"><kgCO2PerPassengerJourney>1602</kgCO2PerPassengerJourney><type>long haul</type><label>long haul, return</label><size>return</size><path>96D538B1B246</path><source>DfT INAS Division, 29 March 2007</source><kgCO2PerPassengerKm>0</kgCO2PerPassengerKm></DataItem><DataItem created="2007-08-01 09:00:41.0" modified="2007-08-01 09:00:41.0" uid="9DA419052FDF"><kgCO2PerPassengerJourney>0</kgCO2PerPassengerJourney><type>short haul</type><label>short haul</label><size>-</size><path>9DA419052FDF</path><source>DfT INAS Division, 29 March 2007</source><kgCO2PerPassengerKm>0.13</kgCO2PerPassengerKm></DataItem><DataItem created="2007-08-01 09:00:41.0" modified="2007-08-01 09:00:41.0" uid="84B4A14C7424"><kgCO2PerPassengerJourney>170</kgCO2PerPassengerJourney><type>short haul</type><label>short haul, one way</label><size>one way</size><path>84B4A14C7424</path><source>DfT INAS Division, 29 March 2007</source><kgCO2PerPassengerKm>0</kgCO2PerPassengerKm></DataItem><DataItem created="2007-08-01 09:00:41.0" modified="2007-08-01 09:00:41.0" uid="8DA1BEAA1013"><kgCO2PerPassengerJourney>340</kgCO2PerPassengerJourney><type>short haul</type><label>short haul, return</label><size>return</size><path>8DA1BEAA1013</path><source>DfT INAS Division, 29 March 2007</source><kgCO2PerPassengerKm>0</kgCO2PerPassengerKm></DataItem></DataItems><Pager><Start>0</Start><From>1</From><To>9</To><Items>9</Items><CurrentPage>1</CurrentPage><RequestedPage>1</RequestedPage><NextPage>-1</NextPage><PreviousPage>-1</PreviousPage><LastPage>1</LastPage><ItemsPerPage>10</ItemsPerPage><ItemsFound>9</ItemsFound></Pager></Children></DataCategoryResource></Resources>'))
130
- connection.should_receive(:v3_get).with("/3.3/definitions/441BF4BEA15B;full",{}).and_return(fixture('itemdef_441BF4BEA15B.xml')).once
130
+ connection.should_receive(:v3_get).with("/#{AMEE::Connection.api_version}/definitions/441BF4BEA15B;full",{}).and_return(fixture('itemdef_441BF4BEA15B.xml')).once
131
131
  @data = AMEE::Data::Category.get(connection, "/data/transport/plane/generic")
132
132
  @data.uid.should == "FBA97B70DBDF"
133
133
  @data.itemdef.should == "441BF4BEA15B"
@@ -14,7 +14,12 @@
14
14
  <Name>usageOther</Name>
15
15
  </Usage>
16
16
  </Usages>
17
+ <Algorithms>
18
+ <Algorithm uid="D4E4779CA7AB">
19
+ <Name>default</Name>
20
+ </Algorithm>
21
+ </Algorithms>
17
22
  </ItemDefinition>
18
23
  <Status>OK</Status>
19
- <Version>3.1.0</Version>
24
+ <Version>3.6.0</Version>
20
25
  </Representation>
@@ -1,14 +1,22 @@
1
1
  <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
2
  <Representation>
3
- <ItemDefinition created="2007-07-27T07:30:44Z" modified="2010-08-24T17:17:01Z" status="ACTIVE" uid="441BF4BEA15B">
4
- <Name>Plane Generic</Name>
5
- <DrillDown>type,size</DrillDown>
6
- <Usages>
7
- <Usage present="true">
8
- <Name>default</Name>
9
- </Usage>
10
- </Usages>
11
- </ItemDefinition>
12
- <Status>OK</Status>
13
- <Version>3.1.0</Version>
14
- </Representation>
3
+ <ItemDefinition created="2007-07-27T07:30:44Z" modified="2011-08-17T08:09:06Z" status="ACTIVE" uid="441BF4BEA15B">
4
+ <Name>Plane Generic</Name>
5
+ <DrillDown>type,size</DrillDown>
6
+ <Usages>
7
+ <Usage present="true">
8
+ <Name>default</Name>
9
+ </Usage>
10
+ </Usages>
11
+ <Algorithms>
12
+ <Algorithm uid="EC4B78451B43">
13
+ <Name>default</Name>
14
+ </Algorithm>
15
+ <Algorithm uid="595AF9E4E1E5">
16
+ <Name>perMonth</Name>
17
+ </Algorithm>
18
+ </Algorithms>
19
+ </ItemDefinition>
20
+ <Status>OK</Status>
21
+ <Version>3.6.0</Version>
22
+ </Representation>
@@ -35,7 +35,7 @@ describe AMEE::Admin::ItemDefinition, "with an authenticated connection" do
35
35
 
36
36
  it "should parse XML correctly" do
37
37
  connection = flexmock "connection"
38
- connection.should_receive(:v3_get).with("/3.3/definitions/BD88D30D1214;full", {}).and_return(fixture('BD88D30D1214.xml'))
38
+ connection.should_receive(:v3_get).with("/#{AMEE::Connection.api_version}/definitions/BD88D30D1214;full", {}).and_return(fixture('BD88D30D1214.xml'))
39
39
  @data = AMEE::Admin::ItemDefinition.load(connection,"BD88D30D1214")
40
40
  @data.uid.should == "BD88D30D1214"
41
41
  @data.created.should == DateTime.new(2007,7,27,7,30,44)
@@ -47,7 +47,7 @@ describe AMEE::Admin::ItemDefinition, "with an authenticated connection" do
47
47
 
48
48
  it "should parse JSON correctly" do
49
49
  connection = flexmock "connection"
50
- connection.should_receive(:v3_get).with("/3.3/definitions/BD88D30D1214;full", {}).and_return(fixture('BD88D30D1214.xml'))
50
+ connection.should_receive(:v3_get).with("/#{AMEE::Connection.api_version}/definitions/BD88D30D1214;full", {}).and_return(fixture('BD88D30D1214.xml'))
51
51
  @data = AMEE::Admin::ItemDefinition.load(connection,"BD88D30D1214")
52
52
  @data.uid.should == "BD88D30D1214"
53
53
  @data.created.should == DateTime.new(2007,7,27,7,30,44)
@@ -59,9 +59,9 @@ describe AMEE::Admin::ItemDefinition, "with an authenticated connection" do
59
59
 
60
60
  it "should be able to load an item value definition list" do
61
61
  connection = flexmock "connection"
62
- connection.should_receive(:v3_get).with("/3.3/definitions/BD88D30D1214;full", {}).and_return(fixture('BD88D30D1214.xml'))
62
+ connection.should_receive(:v3_get).with("/#{AMEE::Connection.api_version}/definitions/BD88D30D1214;full", {}).and_return(fixture('BD88D30D1214.xml'))
63
63
  connection.should_receive(:retries).and_return(0).once
64
- connection.should_receive(:v3_get).with("/3.3/definitions/BD88D30D1214/values;full", {:resultStart=>0, :resultLimit=>10}).and_return(fixture('ivdlist_BD88D30D1214.xml')).once
64
+ connection.should_receive(:v3_get).with("/#{AMEE::Connection.api_version}/definitions/BD88D30D1214/values;full", {:resultStart=>0, :resultLimit=>10}).and_return(fixture('ivdlist_BD88D30D1214.xml')).once
65
65
  @data = AMEE::Admin::ItemDefinition.load(connection,"BD88D30D1214")
66
66
  @data.uid.should == "BD88D30D1214"
67
67
  @list=@data.item_value_definition_list
@@ -35,7 +35,7 @@ describe AMEE::Admin::ItemValueDefinitionList, "with an authenticated connection
35
35
  it "should parse XML correctly" do
36
36
  connection = flexmock "connection"
37
37
  connection.should_receive(:retries).and_return(0).once
38
- connection.should_receive(:v3_get).with("/3.3/definitions/BD88D30D1214/values;full", {:resultStart=>0, :resultLimit=>10}).and_return(fixture('ivdlist_BD88D30D1214.xml')).once
38
+ connection.should_receive(:v3_get).with("/#{AMEE::Connection.api_version}/definitions/BD88D30D1214/values;full", {:resultStart=>0, :resultLimit=>10}).and_return(fixture('ivdlist_BD88D30D1214.xml')).once
39
39
  @data = AMEE::Admin::ItemValueDefinitionList.new(connection,"BD88D30D1214")
40
40
  @data.length.should==15
41
41
  @data.first.uid.should=='9813267B616E'
@@ -51,7 +51,7 @@ describe AMEE::Admin::ItemValueDefinitionList, "with an authenticated connection
51
51
  it "should apply block filter correctly" do
52
52
  connection = flexmock "connection"
53
53
  connection.should_receive(:retries).and_return(0).once
54
- connection.should_receive(:v3_get).with("/3.3/definitions/BD88D30D1214/values;full", {:resultStart=>0, :resultLimit=>10}).and_return(fixture('ivdlist_BD88D30D1214.xml')).once
54
+ connection.should_receive(:v3_get).with("/#{AMEE::Connection.api_version}/definitions/BD88D30D1214/values;full", {:resultStart=>0, :resultLimit=>10}).and_return(fixture('ivdlist_BD88D30D1214.xml')).once
55
55
  @data = AMEE::Admin::ItemValueDefinitionList.new(connection,"BD88D30D1214") do |x|
56
56
  x.uid == 'A8A212610A57' ? x : nil
57
57
  end
@@ -69,7 +69,7 @@ describe AMEE::Admin::ItemValueDefinitionList, "with an authenticated connection
69
69
  it "should parse JSON correctly" do
70
70
  connection = flexmock "connection"
71
71
  connection.should_receive(:retries).and_return(0).once
72
- connection.should_receive(:v3_get).with("/3.3/definitions/BD88D30D1214/values;full", {:resultStart=>0, :resultLimit=>10}).and_return(fixture('ivdlist_BD88D30D1214.xml')).once
72
+ connection.should_receive(:v3_get).with("/#{AMEE::Connection.api_version}/definitions/BD88D30D1214/values;full", {:resultStart=>0, :resultLimit=>10}).and_return(fixture('ivdlist_BD88D30D1214.xml')).once
73
73
  @data = AMEE::Admin::ItemValueDefinitionList.new(connection,"BD88D30D1214")
74
74
  @data.length.should==15
75
75
  @data.first.uid.should=='9813267B616E'
@@ -86,8 +86,8 @@ describe AMEE::Admin::ItemValueDefinitionList, "with an authenticated connection
86
86
  connection = flexmock "connection"
87
87
  connection.should_receive(:retries).and_return(0).once
88
88
  xml = '<?xml version="1.0" encoding="UTF-8"?><Resources></Resources>'
89
- connection.should_receive(:v3_get).with("/3.3/definitions/BD88D30D1214/values;full", {:resultStart=>0, :resultLimit=>10}).and_return(xml)
90
- connection.should_receive(:expire).with("/3.3/definitions/BD88D30D1214/values;full").once
89
+ connection.should_receive(:v3_get).with("/#{AMEE::Connection.api_version}/definitions/BD88D30D1214/values;full", {:resultStart=>0, :resultLimit=>10}).and_return(xml)
90
+ connection.should_receive(:expire).with("/#{AMEE::Connection.api_version}/definitions/BD88D30D1214/values;full").once
91
91
  lambda{AMEE::Admin::ItemValueDefinitionList.new(connection, "BD88D30D1214")}.should raise_error(AMEE::BadData)
92
92
  end
93
93
 
@@ -95,15 +95,15 @@ describe AMEE::Admin::ItemValueDefinitionList, "with an authenticated connection
95
95
  connection = flexmock "connection"
96
96
  connection.should_receive(:retries).and_return(0).once
97
97
  json = '{}'
98
- connection.should_receive(:v3_get).with("/3.3/definitions/BD88D30D1214/values;full", {:resultStart=>0, :resultLimit=>10}).and_return(json)
99
- connection.should_receive(:expire).with("/3.3/definitions/BD88D30D1214/values;full").once
98
+ connection.should_receive(:v3_get).with("/#{AMEE::Connection.api_version}/definitions/BD88D30D1214/values;full", {:resultStart=>0, :resultLimit=>10}).and_return(json)
99
+ connection.should_receive(:expire).with("/#{AMEE::Connection.api_version}/definitions/BD88D30D1214/values;full").once
100
100
  lambda{AMEE::Admin::ItemValueDefinitionList.new(connection, "BD88D30D1214")}.should raise_error(AMEE::BadData)
101
101
  end
102
102
 
103
103
  it "should fail gracefully on other errors" do
104
104
  connection = flexmock "connection"
105
105
  connection.should_receive(:retries).and_return(0).once
106
- connection.should_receive(:v3_get).with("/3.3/definitions/BD88D30D1214/values;full", {:resultStart=>0, :resultLimit=>10}).and_raise(Timeout::Error)
106
+ connection.should_receive(:v3_get).with("/#{AMEE::Connection.api_version}/definitions/BD88D30D1214/values;full", {:resultStart=>0, :resultLimit=>10}).and_raise(Timeout::Error)
107
107
  lambda{AMEE::Admin::ItemValueDefinitionList.new(connection, "BD88D30D1214")}.should raise_error(Timeout::Error)
108
108
  end
109
109
  end
@@ -0,0 +1,46 @@
1
+ # Copyright (C) 2008-2011 AMEE UK Ltd. - http://www.amee.com
2
+ # Released as Open Source Software under the BSD 3-Clause license. See LICENSE.txt for details.
3
+ require 'spec_helper.rb'
4
+
5
+ describe AMEE::Config do
6
+
7
+ # make sure environment variables are clear for each test
8
+ before(:each) do
9
+ ENV['AMEE_SERVER'] = nil
10
+ ENV['AMEE_USERNAME'] = nil
11
+ ENV['AMEE_PASSWORD'] = nil
12
+ end
13
+
14
+ context "loading config details from the environment"
15
+
16
+ it "should let us use ENV variables so we can use heroku" do
17
+ # fake the ENV variables setting
18
+ ENV['AMEE_SERVER'] = "stage.amee.com"
19
+ ENV['AMEE_USERNAME'] = "joe_shmoe"
20
+ ENV['AMEE_PASSWORD'] = "top_sekrit123"
21
+
22
+ amee_config = AMEE::Config.setup()
23
+
24
+ amee_config[:username].should eq "joe_shmoe"
25
+ amee_config[:server].should eq "stage.amee.com"
26
+ amee_config[:password].should eq "top_sekrit123"
27
+
28
+ end
29
+
30
+ context "loading config details from a yaml file" do
31
+
32
+ it "so we don't rely on heroku ALL the time" do
33
+
34
+ config_path = File.dirname(__FILE__)+'/fixtures/rails_config.yml'
35
+
36
+ amee_config = AMEE::Config.setup(config_path, 'test')
37
+
38
+ amee_config[:username].should eq "joe_shmoe"
39
+ amee_config[:server].should eq "stage.amee.com"
40
+ amee_config[:password].should eq "top_sekrit123"
41
+
42
+ end
43
+ end
44
+
45
+
46
+ end
@@ -26,7 +26,7 @@ describe AMEE::Connection do
26
26
  mock.should_receive(:finish => nil)
27
27
  mock
28
28
  }
29
- @c.v3_get("/#{AMEE_API_VERSION}/categories/SomeCategory").should == "OK"
29
+ @c.v3_get("/#{AMEE::Connection.api_version}/categories/SomeCategory").should == "OK"
30
30
  end
31
31
 
32
32
  it "should be able to get from meta server" do
@@ -35,7 +35,7 @@ describe AMEE::Connection do
35
35
  mock.should_receive(:request).and_return(flexmock(:code => '200', :body => "OK"))
36
36
  mock.should_receive(:finish => nil)
37
37
  end
38
- @c.v3_get("/#{AMEE_API_VERSION}/categories/SomeCategory").should == "OK"
38
+ @c.v3_get("/#{AMEE::Connection.api_version}/categories/SomeCategory").should == "OK"
39
39
  end
40
40
 
41
41
  it "should be able to handle failed gets from meta server" do
@@ -45,8 +45,8 @@ describe AMEE::Connection do
45
45
  mock.should_receive(:finish => nil)
46
46
  end
47
47
  lambda {
48
- @c.v3_get("/#{AMEE_API_VERSION}/categories/SomeCategory").should == nil
49
- }.should raise_error(AMEE::NotFound, "The URL was not found on the server.\nRequest: GET /#{AMEE_API_VERSION}/categories/SomeCategory")
48
+ @c.v3_get("/#{AMEE::Connection.api_version}/categories/SomeCategory").should == nil
49
+ }.should raise_error(AMEE::NotFound, "The URL was not found on the server.\nRequest: GET /#{AMEE::Connection.api_version}/categories/SomeCategory")
50
50
  end
51
51
 
52
52
  it "should be able to post to meta server" do
@@ -55,7 +55,7 @@ describe AMEE::Connection do
55
55
  mock.should_receive(:request).and_return(flexmock(:code => '200', :body => "OK"))
56
56
  mock.should_receive(:finish => nil)
57
57
  end
58
- @c.v3_put("/#{AMEE_API_VERSION}/categories/SomeCategory", {:arg => "test"}).should == "OK"
58
+ @c.v3_put("/#{AMEE::Connection.api_version}/categories/SomeCategory", {:arg => "test"}).should == "OK"
59
59
  end
60
60
 
61
61
  it "should be able to handle failed gets from meta server" do
@@ -65,7 +65,7 @@ describe AMEE::Connection do
65
65
  mock.should_receive(:finish => nil)
66
66
  end
67
67
  lambda {
68
- @c.v3_put("/#{AMEE_API_VERSION}/categories/SomeCategory", {:arg => "test"}).should == "OK"
68
+ @c.v3_put("/#{AMEE::Connection.api_version}/categories/SomeCategory", {:arg => "test"}).should == "OK"
69
69
  }.should raise_error
70
70
  end
71
71
 
@@ -120,7 +120,7 @@ describe AMEE::Connection, "with retry enabled" do
120
120
  mock.should_receive(:finish => nil)
121
121
  end
122
122
  lambda {
123
- @c.v3_get("/#{AMEE_API_VERSION}/categories/SomeCategory")
123
+ @c.v3_get("/#{AMEE::Connection.api_version}/categories/SomeCategory")
124
124
  }.should_not raise_error
125
125
  end
126
126
 
@@ -131,7 +131,7 @@ describe AMEE::Connection, "with retry enabled" do
131
131
  mock.should_receive(:finish => nil)
132
132
  end
133
133
  lambda {
134
- @c.v3_get("/#{AMEE_API_VERSION}/categories/SomeCategory")
134
+ @c.v3_get("/#{AMEE::Connection.api_version}/categories/SomeCategory")
135
135
  }.should raise_error(e)
136
136
  end
137
137
  end
@@ -150,7 +150,7 @@ describe AMEE::Connection, "with retry enabled" do
150
150
  mock.should_receive(:finish => nil)
151
151
  end
152
152
  lambda {
153
- @c.v3_get("/#{AMEE_API_VERSION}/categories/SomeCategory")
153
+ @c.v3_get("/#{AMEE::Connection.api_version}/categories/SomeCategory")
154
154
  }.should_not raise_error
155
155
  end
156
156
 
@@ -161,7 +161,7 @@ describe AMEE::Connection, "with retry enabled" do
161
161
  mock.should_receive(:finish => nil)
162
162
  end
163
163
  lambda {
164
- @c.v3_get("/#{AMEE_API_VERSION}/categories/SomeCategory")
164
+ @c.v3_get("/#{AMEE::Connection.api_version}/categories/SomeCategory")
165
165
  }.should raise_error(AMEE::ConnectionFailed)
166
166
  end
167
167
  end
@@ -19,7 +19,7 @@ describe AMEE::Admin::ItemDefinition, "with an authenticated v3 connection" do
19
19
 
20
20
  it "should parse XML correctly" do
21
21
  connection = flexmock "connection"
22
- connection.should_receive(:v3_get).with("/#{AMEE_API_VERSION}/definitions/472D78F6584E;full", {}).and_return(fixture('itemdef.xml'))
22
+ connection.should_receive(:v3_get).with("/#{AMEE::Connection.api_version}/definitions/472D78F6584E;full", {}).and_return(fixture('itemdef.xml'))
23
23
  @data = AMEE::Admin::ItemDefinition.load(connection,"472D78F6584E")
24
24
  @data.uid.should == "472D78F6584E"
25
25
  @data.created.should == DateTime.new(2009,8,31,12,41,18)
@@ -27,27 +27,29 @@ describe AMEE::Admin::ItemDefinition, "with an authenticated v3 connection" do
27
27
  @data.name.should == "Power Stations And Stuff"
28
28
  @data.drill_downs.should == %w{state county metroArea city zipCode plantName powWowWow}
29
29
  @data.usages.should == ['usageOne', 'usageThree', 'usageOther']
30
+ @data.algorithms['default'].should eql "D4E4779CA7AB"
30
31
  end
31
32
 
32
- it "should parse XML correctly if there are no usages" do
33
+ it "should parse XML correctly if there are no usages or algorithms" do
33
34
  connection = flexmock "connection"
34
- connection.should_receive(:v3_get).with("/#{AMEE_API_VERSION}/definitions/472D78F6584E;full", {}).and_return(fixture('itemdef_no_usages.xml'))
35
+ connection.should_receive(:v3_get).with("/#{AMEE::Connection.api_version}/definitions/472D78F6584E;full", {}).and_return(fixture('itemdef_no_usages.xml'))
35
36
  @data = AMEE::Admin::ItemDefinition.load(connection,"472D78F6584E")
36
37
  @data.usages.should == []
38
+ @data.algorithms.should == {}
37
39
  end
38
40
 
39
41
  it "should parse XML correctly if there is just one usage" do
40
42
  connection = flexmock "connection"
41
- connection.should_receive(:v3_get).with("/#{AMEE_API_VERSION}/definitions/472D78F6584E;full", {}).and_return(fixture('itemdef_one_usage.xml'))
43
+ connection.should_receive(:v3_get).with("/#{AMEE::Connection.api_version}/definitions/472D78F6584E;full", {}).and_return(fixture('itemdef_one_usage.xml'))
42
44
  @data = AMEE::Admin::ItemDefinition.load(connection,"472D78F6584E")
43
45
  @data.usages.should == ['usageOne']
44
46
  end
45
47
 
46
48
  it "should be able to load an item value definition list" do
47
49
  connection = flexmock "connection"
48
- connection.should_receive(:v3_get).with("/#{AMEE_API_VERSION}/definitions/472D78F6584E;full", {}).and_return(fixture('itemdef.xml')).once
50
+ connection.should_receive(:v3_get).with("/#{AMEE::Connection.api_version}/definitions/472D78F6584E;full", {}).and_return(fixture('itemdef.xml')).once
49
51
  connection.should_receive(:retries).and_return(0).once
50
- connection.should_receive(:v3_get).with("/#{AMEE_API_VERSION}/definitions/472D78F6584E/values;full", {:resultStart => 0, :resultLimit => 10}).and_return(fixture('ivdlist.xml')).once
52
+ connection.should_receive(:v3_get).with("/#{AMEE::Connection.api_version}/definitions/472D78F6584E/values;full", {:resultStart => 0, :resultLimit => 10}).and_return(fixture('ivdlist.xml')).once
51
53
  @data = AMEE::Admin::ItemDefinition.load(connection,"472D78F6584E")
52
54
  @data.uid.should == "472D78F6584E"
53
55
  @list=@data.item_value_definition_list
@@ -77,20 +79,20 @@ describe AMEE::Admin::ItemDefinition, "with an authenticated v3 connection" do
77
79
  it "should fail gracefully with incorrect data" do
78
80
  connection = flexmock "connection"
79
81
  xml = '<?xml version="1.0" encoding="UTF-8"?><Resources>'
80
- connection.should_receive(:v3_get).with("/#{AMEE_API_VERSION}/definitions/472D78F6584E;full", {}).and_return(xml)
82
+ connection.should_receive(:v3_get).with("/#{AMEE::Connection.api_version}/definitions/472D78F6584E;full", {}).and_return(xml)
81
83
  lambda{AMEE::Admin::ItemDefinition.load(connection, "472D78F6584E")}.should raise_error(AMEE::BadData)
82
84
  end
83
85
 
84
86
  it "should fail gracefully on other errors" do
85
87
  connection = flexmock "connection"
86
- connection.should_receive(:v3_get).with("/#{AMEE_API_VERSION}/definitions/472D78F6584E;full", {}).and_raise("unidentified error")
88
+ connection.should_receive(:v3_get).with("/#{AMEE::Connection.api_version}/definitions/472D78F6584E;full", {}).and_raise("unidentified error")
87
89
  lambda{AMEE::Admin::ItemDefinition.load(connection, "472D78F6584E")}.should raise_error(AMEE::BadData)
88
90
  end
89
91
 
90
92
  it "should support updating" do
91
93
  connection = flexmock "connection"
92
- connection.should_receive(:v3_get).with("/#{AMEE_API_VERSION}/definitions/472D78F6584E;full", {}).and_return('<?xml version="1.0" encoding="UTF-8" standalone="no"?><Representation><ItemDefinition created="2009-08-31T12:41:18Z" modified="2010-08-13T14:54:33Z" status="ACTIVE" uid="472D78F6584E"><Name>Power Stations And Stuff</Name><DrillDown>state,county,metroArea,city,zipCode,plantName,powWowWow</DrillDown><Usages><Usage present="true"><Name>usageOne</Name></Usage><Usage present="true"><Name>usageThree</Name></Usage><Usage present="false"><Name>usageOther</Name></Usage></Usages></ItemDefinition><Status>OK</Status><Version>#{AMEE_API_VERSION}.0</Version></Representation>').once
93
- connection.should_receive(:v3_put).with("/#{AMEE_API_VERSION}/definitions/472D78F6584E", :usages => 'usageOther,usageThree,usageOne', :name => 'Power Stations And Stuff').once
94
+ connection.should_receive(:v3_get).with("/#{AMEE::Connection.api_version}/definitions/472D78F6584E;full", {}).and_return('<?xml version="1.0" encoding="UTF-8" standalone="no"?><Representation><ItemDefinition created="2009-08-31T12:41:18Z" modified="2010-08-13T14:54:33Z" status="ACTIVE" uid="472D78F6584E"><Name>Power Stations And Stuff</Name><DrillDown>state,county,metroArea,city,zipCode,plantName,powWowWow</DrillDown><Usages><Usage present="true"><Name>usageOne</Name></Usage><Usage present="true"><Name>usageThree</Name></Usage><Usage present="false"><Name>usageOther</Name></Usage></Usages></ItemDefinition><Status>OK</Status><Version>#{AMEE::Connection.api_version}.0</Version></Representation>').once
95
+ connection.should_receive(:v3_put).with("/#{AMEE::Connection.api_version}/definitions/472D78F6584E", :usages => 'usageOther,usageThree,usageOne', :name => 'Power Stations And Stuff').once
94
96
  @data = AMEE::Admin::ItemDefinition.load(connection,"472D78F6584E")
95
97
  @data.usages.should == ['usageOne', 'usageThree', 'usageOther']
96
98
  @data.usages.reverse!
@@ -12,32 +12,32 @@ describe AMEE::Admin::ItemValueDefinition, "with an authenticated XML connection
12
12
  end
13
13
 
14
14
  it "should set metadata" do
15
- @connection.should_receive(:v3_get).with("/#{AMEE_API_VERSION}/definitions/PQR/values/ABC;wikiDoc;usages").
15
+ @connection.should_receive(:v3_get).with("/#{AMEE::Connection.api_version}/definitions/PQR/values/ABC;wikiDoc;usages").
16
16
  and_return(<<HERE
17
17
  #{XMLPreamble}
18
18
  <Representation>
19
19
  </Representation>
20
20
  HERE
21
21
  ).once
22
- @connection.should_receive(:v3_put).with("/#{AMEE_API_VERSION}/definitions/PQR/values/ABC;wikiDoc;usages",
22
+ @connection.should_receive(:v3_put).with("/#{AMEE::Connection.api_version}/definitions/PQR/values/ABC;wikiDoc;usages",
23
23
  :body => <<EOF
24
24
  #{XMLPreamble}
25
25
  <ItemValueDefinition>
26
26
  <WikiDoc>Mass of carbon per distance</WikiDoc>
27
27
  <Usages>
28
- <Usage>
29
- <Name>usageOne</Name>
30
- <Type>FORBIDDEN</Type>
31
- </Usage>
32
28
  <Usage>
33
29
  <Name>usageTwo</Name>
34
30
  <Type>IGNORED</Type>
35
31
  </Usage>
32
+ <Usage>
33
+ <Name>usageOne</Name>
34
+ <Type>FORBIDDEN</Type>
35
+ </Usage>
36
36
  </Usages>
37
37
  </ItemValueDefinition>
38
38
  EOF
39
39
  ).once
40
- @connection.should_receive(:v3_get).with("/#{AMEE_API_VERSION}/definitions/PQR/values/ABC;wikiDoc;usages").
40
+ @connection.should_receive(:v3_get).with("/#{AMEE::Connection.api_version}/definitions/PQR/values/ABC;wikiDoc;usages").
41
41
  and_return(<<HERE
42
42
  #{XMLPreamble}
43
43
  <Representation>
@@ -51,7 +51,7 @@ HERE
51
51
  end
52
52
 
53
53
  it "should get metadata" do
54
- @connection.should_receive(:v3_get).with("/#{AMEE_API_VERSION}/definitions/PQR/values/ABC;wikiDoc;usages").
54
+ @connection.should_receive(:v3_get).with("/#{AMEE::Connection.api_version}/definitions/PQR/values/ABC;wikiDoc;usages").
55
55
  and_return(<<HERE
56
56
  #{XMLPreamble}
57
57
  <Representation>
@@ -87,7 +87,7 @@ HERE
87
87
  <FromProfile>false</FromProfile>
88
88
  </ItemValueDefinition>
89
89
  <Status>OK</Status>
90
- <Version>#{AMEE_API_VERSION}.0</Version>
90
+ <Version>#{AMEE::Connection.api_version}.0</Version>
91
91
  </Representation>
92
92
  HERE
93
93
  ).once
@@ -32,7 +32,7 @@ describe AMEE::Admin::ReturnValueDefinition, "with an authenticated XML connecti
32
32
  connection = flexmock "connection"
33
33
  connection.should_receive(:retries).and_return(0).once
34
34
  connection.should_receive(:v3_get).
35
- with("/#{AMEE_API_VERSION}/definitions/#{Testcativduid}/returnvalues;full", {:resultLimit=>10, :resultStart=>0}).
35
+ with("/#{AMEE::Connection.api_version}/definitions/#{Testcativduid}/returnvalues;full", {:resultLimit=>10, :resultStart=>0}).
36
36
  and_return(fixture('return_value_definition_list.xml')).once
37
37
  list=AMEE::Admin::ReturnValueDefinitionList.new(connection,Testcativduid)
38
38
  list.should have(3).items
@@ -41,7 +41,7 @@ describe AMEE::Admin::ReturnValueDefinition, "with an authenticated XML connecti
41
41
  connection = flexmock "connection"
42
42
  connection.should_receive(:retries).and_return(0).once
43
43
  connection.should_receive(:v3_get).
44
- with("/#{AMEE_API_VERSION}/definitions/#{Testcativduid}/returnvalues;full", {:resultLimit=>10, :resultStart=>0}).
44
+ with("/#{AMEE::Connection.api_version}/definitions/#{Testcativduid}/returnvalues;full", {:resultLimit=>10, :resultStart=>0}).
45
45
  and_return(fixture('empty_return_value_definition_list.xml')).once
46
46
  list=AMEE::Admin::ReturnValueDefinitionList.new(connection,Testcativduid)
47
47
  list.should have(0).items
@@ -49,13 +49,13 @@ describe AMEE::Admin::ReturnValueDefinition, "with an authenticated XML connecti
49
49
  it "should create a return value definition" do
50
50
  connection = flexmock "connection"
51
51
  connection.should_receive(:v3_get).
52
- with("/#{AMEE_API_VERSION}/definitions/#{Testcativduid}/returnvalues/#{Testrvduid};full", {}).
52
+ with("/#{AMEE::Connection.api_version}/definitions/#{Testcativduid}/returnvalues/#{Testrvduid};full", {}).
53
53
  and_return(fixture('return_value_definition.xml')).once
54
54
  connection.should_receive(:v3_post).
55
- with("/#{AMEE_API_VERSION}/definitions/#{Testcativduid}/returnvalues",
55
+ with("/#{AMEE::Connection.api_version}/definitions/#{Testcativduid}/returnvalues",
56
56
  {:type=>"CO2", :valueDefinition=>"45433E48B39F",
57
57
  :returnobj=>true, :unit=>"kg", :perUnit=>"month"}).
58
- and_return({'Location'=>"///#{AMEE_API_VERSION}/definitions/#{Testcativduid}/returnvalues/#{Testrvduid}"}).once
58
+ and_return({'Location'=>"///#{AMEE::Connection.api_version}/definitions/#{Testcativduid}/returnvalues/#{Testrvduid}"}).once
59
59
  rvd=AMEE::Admin::ReturnValueDefinition.create(connection,Testcativduid,
60
60
  :type=>'CO2',:unit=>'kg',:perUnit=>'month')
61
61
 
@@ -67,7 +67,7 @@ describe AMEE::Admin::ReturnValueDefinition, "with an authenticated XML connecti
67
67
  it "should read a return value definition" do
68
68
  connection = flexmock "connection"
69
69
  connection.should_receive(:v3_get).
70
- with("/#{AMEE_API_VERSION}/definitions/#{Testcativduid}/returnvalues/#{Testrvduid};full", {}).
70
+ with("/#{AMEE::Connection.api_version}/definitions/#{Testcativduid}/returnvalues/#{Testrvduid};full", {}).
71
71
  and_return(fixture('return_value_definition.xml')).once
72
72
  rvd=AMEE::Admin::ReturnValueDefinition.load(connection,Testcativduid,Testrvduid)
73
73
 
@@ -79,10 +79,10 @@ describe AMEE::Admin::ReturnValueDefinition, "with an authenticated XML connecti
79
79
  it "should delete a return value definition" do
80
80
  connection = flexmock "connection"
81
81
  connection.should_receive(:v3_get).
82
- with("/#{AMEE_API_VERSION}/definitions/#{Testcativduid}/returnvalues/#{Testrvduid};full", {}).
82
+ with("/#{AMEE::Connection.api_version}/definitions/#{Testcativduid}/returnvalues/#{Testrvduid};full", {}).
83
83
  and_return(fixture('return_value_definition.xml')).once
84
84
  connection.should_receive(:v3_delete).
85
- with("/#{AMEE_API_VERSION}/definitions/#{Testcativduid}/returnvalues/#{Testrvduid}").once
85
+ with("/#{AMEE::Connection.api_version}/definitions/#{Testcativduid}/returnvalues/#{Testrvduid}").once
86
86
  connection.should_receive(:timeout=)
87
87
  connection.should_receive(:timeout)
88
88
  rvd=AMEE::Admin::ReturnValueDefinition.load(connection,Testcativduid,Testrvduid)
metadata CHANGED
@@ -1,8 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amee
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 55
4
5
  prerelease:
5
- version: 4.1.7
6
+ segments:
7
+ - 4
8
+ - 2
9
+ - 0
10
+ version: 4.2.0
6
11
  platform: ruby
7
12
  authors:
8
13
  - James Smith
@@ -13,140 +18,188 @@ autorequire:
13
18
  bindir: bin
14
19
  cert_chain: []
15
20
 
16
- date: 2011-10-28 00:00:00 +01:00
21
+ date: 2011-11-17 00:00:00 +00:00
17
22
  default_executable: ameesh
18
23
  dependencies:
19
24
  - !ruby/object:Gem::Dependency
20
- name: activesupport
25
+ prerelease: false
26
+ type: :runtime
21
27
  requirement: &id001 !ruby/object:Gem::Requirement
22
28
  none: false
23
29
  requirements:
24
30
  - - ~>
25
31
  - !ruby/object:Gem::Version
32
+ hash: 7
33
+ segments:
34
+ - 3
35
+ - 0
26
36
  version: "3.0"
27
- type: :runtime
28
- prerelease: false
37
+ name: activesupport
29
38
  version_requirements: *id001
30
39
  - !ruby/object:Gem::Dependency
31
- name: json
40
+ prerelease: false
41
+ type: :runtime
32
42
  requirement: &id002 !ruby/object:Gem::Requirement
33
43
  none: false
34
44
  requirements:
35
45
  - - ">="
36
46
  - !ruby/object:Gem::Version
47
+ hash: 3
48
+ segments:
49
+ - 0
37
50
  version: "0"
38
- type: :runtime
39
- prerelease: false
51
+ name: json
40
52
  version_requirements: *id002
41
53
  - !ruby/object:Gem::Dependency
42
- name: log4r
54
+ prerelease: false
55
+ type: :runtime
43
56
  requirement: &id003 !ruby/object:Gem::Requirement
44
57
  none: false
45
58
  requirements:
46
59
  - - ">="
47
60
  - !ruby/object:Gem::Version
61
+ hash: 3
62
+ segments:
63
+ - 0
48
64
  version: "0"
49
- type: :runtime
50
- prerelease: false
65
+ name: log4r
51
66
  version_requirements: *id003
52
67
  - !ruby/object:Gem::Dependency
53
- name: nokogiri
68
+ prerelease: false
69
+ type: :runtime
54
70
  requirement: &id004 !ruby/object:Gem::Requirement
55
71
  none: false
56
72
  requirements:
57
73
  - - ~>
58
74
  - !ruby/object:Gem::Version
75
+ hash: 15
76
+ segments:
77
+ - 1
78
+ - 4
79
+ - 4
59
80
  version: 1.4.4
60
- type: :runtime
61
- prerelease: false
81
+ name: nokogiri
62
82
  version_requirements: *id004
63
83
  - !ruby/object:Gem::Dependency
64
- name: bundler
84
+ prerelease: false
85
+ type: :development
65
86
  requirement: &id005 !ruby/object:Gem::Requirement
66
87
  none: false
67
88
  requirements:
68
89
  - - ~>
69
90
  - !ruby/object:Gem::Version
91
+ hash: 23
92
+ segments:
93
+ - 1
94
+ - 0
95
+ - 0
70
96
  version: 1.0.0
71
- type: :development
72
- prerelease: false
97
+ name: bundler
73
98
  version_requirements: *id005
74
99
  - !ruby/object:Gem::Dependency
75
- name: jeweler
100
+ prerelease: false
101
+ type: :development
76
102
  requirement: &id006 !ruby/object:Gem::Requirement
77
103
  none: false
78
104
  requirements:
79
105
  - - ~>
80
106
  - !ruby/object:Gem::Version
107
+ hash: 7
108
+ segments:
109
+ - 1
110
+ - 6
111
+ - 4
81
112
  version: 1.6.4
82
- type: :development
83
- prerelease: false
113
+ name: jeweler
84
114
  version_requirements: *id006
85
115
  - !ruby/object:Gem::Dependency
86
- name: rspec
116
+ prerelease: false
117
+ type: :development
87
118
  requirement: &id007 !ruby/object:Gem::Requirement
88
119
  none: false
89
120
  requirements:
90
121
  - - "="
91
122
  - !ruby/object:Gem::Version
123
+ hash: 23
124
+ segments:
125
+ - 2
126
+ - 6
127
+ - 0
92
128
  version: 2.6.0
93
- type: :development
94
- prerelease: false
129
+ name: rspec
95
130
  version_requirements: *id007
96
131
  - !ruby/object:Gem::Dependency
97
- name: flexmock
132
+ prerelease: false
133
+ type: :development
98
134
  requirement: &id008 !ruby/object:Gem::Requirement
99
135
  none: false
100
136
  requirements:
101
137
  - - ">"
102
138
  - !ruby/object:Gem::Version
139
+ hash: 51
140
+ segments:
141
+ - 0
142
+ - 8
143
+ - 6
103
144
  version: 0.8.6
104
- type: :development
105
- prerelease: false
145
+ name: flexmock
106
146
  version_requirements: *id008
107
147
  - !ruby/object:Gem::Dependency
108
- name: memcache-client
148
+ prerelease: false
149
+ type: :development
109
150
  requirement: &id009 !ruby/object:Gem::Requirement
110
151
  none: false
111
152
  requirements:
112
153
  - - ">="
113
154
  - !ruby/object:Gem::Version
155
+ hash: 3
156
+ segments:
157
+ - 0
114
158
  version: "0"
115
- type: :development
116
- prerelease: false
159
+ name: memcache-client
117
160
  version_requirements: *id009
118
161
  - !ruby/object:Gem::Dependency
119
- name: rcov
162
+ prerelease: false
163
+ type: :development
120
164
  requirement: &id010 !ruby/object:Gem::Requirement
121
165
  none: false
122
166
  requirements:
123
167
  - - ">="
124
168
  - !ruby/object:Gem::Version
169
+ hash: 3
170
+ segments:
171
+ - 0
125
172
  version: "0"
126
- type: :development
127
- prerelease: false
173
+ name: rcov
128
174
  version_requirements: *id010
129
175
  - !ruby/object:Gem::Dependency
130
- name: rdoc
176
+ prerelease: false
177
+ type: :development
131
178
  requirement: &id011 !ruby/object:Gem::Requirement
132
179
  none: false
133
180
  requirements:
134
181
  - - ">="
135
182
  - !ruby/object:Gem::Version
183
+ hash: 3
184
+ segments:
185
+ - 0
136
186
  version: "0"
137
- type: :development
138
- prerelease: false
187
+ name: rdoc
139
188
  version_requirements: *id011
140
189
  - !ruby/object:Gem::Dependency
141
- name: activerecord
190
+ prerelease: false
191
+ type: :development
142
192
  requirement: &id012 !ruby/object:Gem::Requirement
143
193
  none: false
144
194
  requirements:
145
195
  - - ~>
146
196
  - !ruby/object:Gem::Version
197
+ hash: 7
198
+ segments:
199
+ - 3
200
+ - 0
147
201
  version: "3.0"
148
- type: :development
149
- prerelease: false
202
+ name: activerecord
150
203
  version_requirements: *id012
151
204
  description:
152
205
  email: james@floppy.org.uk
@@ -256,6 +309,7 @@ files:
256
309
  - spec/profile_spec.rb
257
310
  - spec/rails_spec.rb
258
311
  - spec/spec.opts
312
+ - spec/spec_amee_config.rb
259
313
  - spec/spec_helper.rb
260
314
  - spec/user_spec.rb
261
315
  - spec/v3/connection_spec.rb
@@ -276,7 +330,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
276
330
  requirements:
277
331
  - - ">="
278
332
  - !ruby/object:Gem::Version
279
- hash: -2334678358035228211
333
+ hash: 3
280
334
  segments:
281
335
  - 0
282
336
  version: "0"
@@ -285,6 +339,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
285
339
  requirements:
286
340
  - - ">="
287
341
  - !ruby/object:Gem::Version
342
+ hash: 3
343
+ segments:
344
+ - 0
288
345
  version: "0"
289
346
  requirements: []
290
347