amee 2.0.32 → 2.0.33

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -85,7 +85,7 @@ AMEE when your model is saved.
85
85
  == CACHING
86
86
 
87
87
  The AMEE::Connection object implements an optional cache for GET requests. This is
88
- currently a versy simple implementation which caches the result of all GET requests
88
+ currently a very simple implementation which caches the result of all GET requests
89
89
  until a POST, PUT, or DELETE is executed, at which point the cache is cleared. To
90
90
  enable caching, set the enable_caching parameter of AMEE::Connection.new to true.
91
91
  Caching is disabled by default.
@@ -8,12 +8,14 @@ module AMEE
8
8
  @children = data ? data[:children] : []
9
9
  @items = data ? data[:items] : []
10
10
  @pager = data ? data[:pager] : nil
11
+ @itemdef = data ? data[:itemdef] : nil
11
12
  super
12
13
  end
13
14
 
14
15
  attr_reader :children
15
16
  attr_reader :items
16
17
  attr_reader :pager
18
+ attr_reader :itemdef
17
19
 
18
20
  def self.from_json(json)
19
21
  # Parse json
@@ -26,6 +28,8 @@ module AMEE
26
28
  data[:path] = doc['path']
27
29
  data[:children] = []
28
30
  data[:pager] = AMEE::Pager.from_json(doc['children']['pager'])
31
+ itemdef=doc['dataCategory']['itemDefinition']
32
+ data[:itemdef] = itemdef ? itemdef['uid'] : nil
29
33
  doc['children']['dataCategories'].each do |child|
30
34
  category_data = {}
31
35
  category_data[:name] = child['name']
@@ -59,6 +63,8 @@ module AMEE
59
63
  data[:name] = REXML::XPath.first(doc, '/Resources/DataCategoryResource/DataCategory/?ame').text
60
64
  data[:path] = REXML::XPath.first(doc, '/Resources/DataCategoryResource//?ath').text || ""
61
65
  data[:pager] = AMEE::Pager.from_xml(REXML::XPath.first(doc, '//Pager'))
66
+ itemdefattrib=REXML::XPath.first(doc, '/Resources/DataCategoryResource//ItemDefinition/@uid')
67
+ data[:itemdef] = itemdefattrib ? itemdefattrib.to_s : nil
62
68
  data[:children] = []
63
69
  REXML::XPath.each(doc, '/Resources/DataCategoryResource//Children/DataCategories/DataCategory') do |child|
64
70
  category_data = {}
@@ -16,7 +16,7 @@ module AMEE
16
16
 
17
17
  def value
18
18
  case type
19
- when "DECIMAL"
19
+ when "DECIMAL", "DOUBLE"
20
20
  @value.to_f
21
21
  else
22
22
  @value
@@ -18,7 +18,7 @@ module AMEE
18
18
 
19
19
  def value
20
20
  case type
21
- when "DECIMAL"
21
+ when "DECIMAL", "DOUBLE"
22
22
  @value.to_f
23
23
  else
24
24
  @value
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amee
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.32
4
+ prerelease: false
5
+ segments:
6
+ - 2
7
+ - 0
8
+ - 33
9
+ version: 2.0.33
5
10
  platform: ruby
6
11
  authors:
7
12
  - James Smith
@@ -9,39 +14,47 @@ autorequire:
9
14
  bindir: bin
10
15
  cert_chain: []
11
16
 
12
- date: 2010-02-26 00:00:00 +00:00
17
+ date: 2010-05-06 00:00:00 +01:00
13
18
  default_executable:
14
19
  dependencies:
15
20
  - !ruby/object:Gem::Dependency
16
21
  name: activesupport
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
20
24
  requirements:
21
25
  - - ~>
22
26
  - !ruby/object:Gem::Version
27
+ segments:
28
+ - 2
29
+ - 3
30
+ - 5
23
31
  version: 2.3.5
24
- version:
32
+ type: :runtime
33
+ version_requirements: *id001
25
34
  - !ruby/object:Gem::Dependency
26
35
  name: json
27
- type: :runtime
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
36
+ prerelease: false
37
+ requirement: &id002 !ruby/object:Gem::Requirement
30
38
  requirements:
31
39
  - - ">="
32
40
  - !ruby/object:Gem::Version
41
+ segments:
42
+ - 0
33
43
  version: "0"
34
- version:
44
+ type: :runtime
45
+ version_requirements: *id002
35
46
  - !ruby/object:Gem::Dependency
36
47
  name: rspec_spinner
37
- type: :runtime
38
- version_requirement:
39
- version_requirements: !ruby/object:Gem::Requirement
48
+ prerelease: false
49
+ requirement: &id003 !ruby/object:Gem::Requirement
40
50
  requirements:
41
51
  - - ">="
42
52
  - !ruby/object:Gem::Version
53
+ segments:
54
+ - 0
43
55
  version: "0"
44
- version:
56
+ type: :runtime
57
+ version_requirements: *id003
45
58
  description:
46
59
  email: james@floppy.org.uk
47
60
  executables:
@@ -96,18 +109,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
96
109
  requirements:
97
110
  - - ">="
98
111
  - !ruby/object:Gem::Version
112
+ segments:
113
+ - 0
99
114
  version: "0"
100
- version:
101
115
  required_rubygems_version: !ruby/object:Gem::Requirement
102
116
  requirements:
103
117
  - - ">="
104
118
  - !ruby/object:Gem::Version
119
+ segments:
120
+ - 0
105
121
  version: "0"
106
- version:
107
122
  requirements: []
108
123
 
109
124
  rubyforge_project:
110
- rubygems_version: 1.3.5
125
+ rubygems_version: 1.3.6
111
126
  signing_key:
112
127
  specification_version: 3
113
128
  summary: Ruby interface to the AMEE carbon calculator