amee-data-abstraction 2.1.1 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.txt +3 -0
- data/README.txt +26 -14
- data/VERSION +1 -1
- data/amee-data-abstraction.gemspec +7 -6
- data/lib/amee-data-abstraction/calculation.rb +1 -1
- data/lib/amee-data-abstraction/calculation_set.rb +152 -10
- data/lib/amee-data-abstraction/input.rb +10 -0
- data/lib/amee-data-abstraction/ongoing_calculation.rb +1 -1
- data/lib/amee-data-abstraction/term.rb +31 -13
- data/spec/amee-data-abstraction/calculation_set_spec.rb +247 -9
- data/spec/amee-data-abstraction/calculation_spec.rb +24 -19
- data/spec/amee-data-abstraction/drill_spec.rb +14 -9
- data/spec/amee-data-abstraction/input_spec.rb +113 -73
- data/spec/amee-data-abstraction/metadatum_spec.rb +1 -1
- data/spec/amee-data-abstraction/ongoing_calculation_spec.rb +38 -30
- data/spec/amee-data-abstraction/profile_spec.rb +4 -2
- data/spec/amee-data-abstraction/prototype_calculation_spec.rb +13 -8
- data/spec/amee-data-abstraction/term_spec.rb +45 -4
- data/spec/amee-data-abstraction/terms_list_spec.rb +23 -12
- data/spec/config/amee_units_spec.rb +1 -2
- data/spec/core-extensions/class_spec.rb +18 -18
- data/spec/core-extensions/hash_spec.rb +1 -2
- data/spec/core-extensions/ordered_hash_spec.rb +1 -2
- data/spec/core-extensions/proc_spec.rb +1 -1
- data/spec/fixtures/config/calculations/electricity.rb +35 -0
- data/spec/fixtures/config/calculations/electricity_and_transport.rb +53 -0
- data/spec/fixtures/{transport.rb → config/calculations/transport.rb} +2 -2
- data/spec/fixtures/{electricity.rb → config/electricity.rb} +1 -1
- data/spec/spec_helper.rb +30 -2
- metadata +28 -27
- data/spec/fixtures/electricity_and_transport.rb +0 -55
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: amee-data-abstraction
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 7
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 2.
|
8
|
+
- 2
|
9
|
+
- 0
|
10
|
+
version: 2.2.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- James Hetherington
|
@@ -18,13 +18,11 @@ autorequire:
|
|
18
18
|
bindir: bin
|
19
19
|
cert_chain: []
|
20
20
|
|
21
|
-
date: 2011-10-
|
21
|
+
date: 2011-10-18 00:00:00 +01:00
|
22
22
|
default_executable:
|
23
23
|
dependencies:
|
24
24
|
- !ruby/object:Gem::Dependency
|
25
|
-
prerelease: false
|
26
25
|
name: amee
|
27
|
-
type: :runtime
|
28
26
|
version_requirements: &id001 !ruby/object:Gem::Requirement
|
29
27
|
none: false
|
30
28
|
requirements:
|
@@ -36,11 +34,11 @@ dependencies:
|
|
36
34
|
- 1
|
37
35
|
- 5
|
38
36
|
version: 4.1.5
|
37
|
+
prerelease: false
|
38
|
+
type: :runtime
|
39
39
|
requirement: *id001
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
|
-
prerelease: false
|
42
41
|
name: uuidtools
|
43
|
-
type: :runtime
|
44
42
|
version_requirements: &id002 !ruby/object:Gem::Requirement
|
45
43
|
none: false
|
46
44
|
requirements:
|
@@ -52,11 +50,11 @@ dependencies:
|
|
52
50
|
- 1
|
53
51
|
- 2
|
54
52
|
version: 2.1.2
|
53
|
+
prerelease: false
|
54
|
+
type: :runtime
|
55
55
|
requirement: *id002
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
|
-
prerelease: false
|
58
57
|
name: quantify
|
59
|
-
type: :runtime
|
60
58
|
version_requirements: &id003 !ruby/object:Gem::Requirement
|
61
59
|
none: false
|
62
60
|
requirements:
|
@@ -68,11 +66,11 @@ dependencies:
|
|
68
66
|
- 0
|
69
67
|
- 0
|
70
68
|
version: 2.0.0
|
69
|
+
prerelease: false
|
70
|
+
type: :runtime
|
71
71
|
requirement: *id003
|
72
72
|
- !ruby/object:Gem::Dependency
|
73
|
-
prerelease: false
|
74
73
|
name: bundler
|
75
|
-
type: :development
|
76
74
|
version_requirements: &id004 !ruby/object:Gem::Requirement
|
77
75
|
none: false
|
78
76
|
requirements:
|
@@ -84,11 +82,11 @@ dependencies:
|
|
84
82
|
- 0
|
85
83
|
- 0
|
86
84
|
version: 1.0.0
|
85
|
+
prerelease: false
|
86
|
+
type: :development
|
87
87
|
requirement: *id004
|
88
88
|
- !ruby/object:Gem::Dependency
|
89
|
-
prerelease: false
|
90
89
|
name: jeweler
|
91
|
-
type: :development
|
92
90
|
version_requirements: &id005 !ruby/object:Gem::Requirement
|
93
91
|
none: false
|
94
92
|
requirements:
|
@@ -100,11 +98,11 @@ dependencies:
|
|
100
98
|
- 6
|
101
99
|
- 4
|
102
100
|
version: 1.6.4
|
101
|
+
prerelease: false
|
102
|
+
type: :development
|
103
103
|
requirement: *id005
|
104
104
|
- !ruby/object:Gem::Dependency
|
105
|
-
prerelease: false
|
106
105
|
name: rspec
|
107
|
-
type: :development
|
108
106
|
version_requirements: &id006 !ruby/object:Gem::Requirement
|
109
107
|
none: false
|
110
108
|
requirements:
|
@@ -116,11 +114,11 @@ dependencies:
|
|
116
114
|
- 6
|
117
115
|
- 0
|
118
116
|
version: 2.6.0
|
117
|
+
prerelease: false
|
118
|
+
type: :development
|
119
119
|
requirement: *id006
|
120
120
|
- !ruby/object:Gem::Dependency
|
121
|
-
prerelease: false
|
122
121
|
name: flexmock
|
123
|
-
type: :development
|
124
122
|
version_requirements: &id007 !ruby/object:Gem::Requirement
|
125
123
|
none: false
|
126
124
|
requirements:
|
@@ -132,11 +130,11 @@ dependencies:
|
|
132
130
|
- 8
|
133
131
|
- 6
|
134
132
|
version: 0.8.6
|
133
|
+
prerelease: false
|
134
|
+
type: :development
|
135
135
|
requirement: *id007
|
136
136
|
- !ruby/object:Gem::Dependency
|
137
|
-
prerelease: false
|
138
137
|
name: rcov
|
139
|
-
type: :development
|
140
138
|
version_requirements: &id008 !ruby/object:Gem::Requirement
|
141
139
|
none: false
|
142
140
|
requirements:
|
@@ -146,11 +144,11 @@ dependencies:
|
|
146
144
|
segments:
|
147
145
|
- 0
|
148
146
|
version: "0"
|
147
|
+
prerelease: false
|
148
|
+
type: :development
|
149
149
|
requirement: *id008
|
150
150
|
- !ruby/object:Gem::Dependency
|
151
|
-
prerelease: false
|
152
151
|
name: rdoc
|
153
|
-
type: :development
|
154
152
|
version_requirements: &id009 !ruby/object:Gem::Requirement
|
155
153
|
none: false
|
156
154
|
requirements:
|
@@ -160,6 +158,8 @@ dependencies:
|
|
160
158
|
segments:
|
161
159
|
- 0
|
162
160
|
version: "0"
|
161
|
+
prerelease: false
|
162
|
+
type: :development
|
163
163
|
requirement: *id009
|
164
164
|
description: Part of the AMEEappkit this gem provides a data abstraction layer, decreasing the amount and detail of development required
|
165
165
|
email: help@amee.com
|
@@ -216,9 +216,10 @@ files:
|
|
216
216
|
- spec/core-extensions/hash_spec.rb
|
217
217
|
- spec/core-extensions/ordered_hash_spec.rb
|
218
218
|
- spec/core-extensions/proc_spec.rb
|
219
|
-
- spec/fixtures/electricity.rb
|
220
|
-
- spec/fixtures/electricity_and_transport.rb
|
221
|
-
- spec/fixtures/transport.rb
|
219
|
+
- spec/fixtures/config/calculations/electricity.rb
|
220
|
+
- spec/fixtures/config/calculations/electricity_and_transport.rb
|
221
|
+
- spec/fixtures/config/calculations/transport.rb
|
222
|
+
- spec/fixtures/config/electricity.rb
|
222
223
|
- spec/spec.opts
|
223
224
|
- spec/spec_helper.rb
|
224
225
|
has_rdoc: true
|
@@ -251,7 +252,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
251
252
|
requirements: []
|
252
253
|
|
253
254
|
rubyforge_project:
|
254
|
-
rubygems_version: 1.
|
255
|
+
rubygems_version: 1.5.3
|
255
256
|
signing_key:
|
256
257
|
specification_version: 3
|
257
258
|
summary: Calculation and form building tool hiding details of AMEEconnect
|
@@ -1,55 +0,0 @@
|
|
1
|
-
ElectricityAndTransport=AMEE::DataAbstraction::CalculationSet.new {
|
2
|
-
all_calculations {
|
3
|
-
metadatum {
|
4
|
-
label :department
|
5
|
-
choices %w{stuff things more_stuff meta_things}
|
6
|
-
}
|
7
|
-
}
|
8
|
-
|
9
|
-
calculation{
|
10
|
-
name 'electricity'
|
11
|
-
label :electricity
|
12
|
-
path '/business/energy/electricity/grid'
|
13
|
-
profile {
|
14
|
-
label :usage
|
15
|
-
name 'Electricity Used'
|
16
|
-
path 'energyPerTime'
|
17
|
-
}
|
18
|
-
drill {
|
19
|
-
label :country
|
20
|
-
path 'country'
|
21
|
-
fixed 'Argentina'
|
22
|
-
}
|
23
|
-
output {
|
24
|
-
label :co2
|
25
|
-
path :default
|
26
|
-
}
|
27
|
-
}
|
28
|
-
|
29
|
-
calculation {
|
30
|
-
name 'transport'
|
31
|
-
label :transport
|
32
|
-
path '/transport/car/generic'
|
33
|
-
|
34
|
-
drill {
|
35
|
-
path 'fuel'
|
36
|
-
label :fuel
|
37
|
-
name 'Fuel Type'
|
38
|
-
}
|
39
|
-
drill {
|
40
|
-
path 'size'
|
41
|
-
label :size
|
42
|
-
name 'Vehicle Size'
|
43
|
-
}
|
44
|
-
profile {
|
45
|
-
path 'distance'
|
46
|
-
label :distance
|
47
|
-
name 'Distance Driven'
|
48
|
-
}
|
49
|
-
output {
|
50
|
-
label :co2
|
51
|
-
path :default
|
52
|
-
name 'Carbon Dioxide'
|
53
|
-
}
|
54
|
-
}
|
55
|
-
}
|