amee-data-abstraction 1.2.0 → 1.3.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 +28 -15
- data/Rakefile +1 -16
- data/VERSION +1 -1
- data/amee-data-abstraction.gemspec +6 -5
- data/lib/amee-data-abstraction/calculation.rb +1 -1
- data/lib/amee-data-abstraction/calculation_set.rb +152 -10
- data/lib/amee-data-abstraction/drill.rb +8 -2
- data/lib/amee-data-abstraction/input.rb +24 -0
- data/lib/amee-data-abstraction/ongoing_calculation.rb +13 -9
- data/lib/amee-data-abstraction/term.rb +31 -13
- data/spec/amee-data-abstraction/calculation_set_spec.rb +244 -8
- data/spec/amee-data-abstraction/calculation_spec.rb +23 -18
- data/spec/amee-data-abstraction/drill_spec.rb +34 -7
- 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 +45 -29
- data/spec/amee-data-abstraction/profile_spec.rb +2 -2
- data/spec/amee-data-abstraction/prototype_calculation_spec.rb +12 -8
- data/spec/amee-data-abstraction/term_spec.rb +49 -5
- data/spec/amee-data-abstraction/terms_list_spec.rb +16 -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/{electricity.rb → config/calculations/electricity.rb} +2 -2
- 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/config/electricity.rb +35 -0
- data/spec/spec_helper.rb +38 -6
- metadata +8 -7
- 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: 27
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
-
-
|
8
|
+
- 3
|
9
9
|
- 0
|
10
|
-
version: 1.
|
10
|
+
version: 1.3.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- James Hetherington
|
@@ -18,7 +18,7 @@ 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
|
@@ -219,9 +219,10 @@ files:
|
|
219
219
|
- spec/core-extensions/hash_spec.rb
|
220
220
|
- spec/core-extensions/ordered_hash_spec.rb
|
221
221
|
- spec/core-extensions/proc_spec.rb
|
222
|
-
- spec/fixtures/electricity.rb
|
223
|
-
- spec/fixtures/electricity_and_transport.rb
|
224
|
-
- spec/fixtures/transport.rb
|
222
|
+
- spec/fixtures/config/calculations/electricity.rb
|
223
|
+
- spec/fixtures/config/calculations/electricity_and_transport.rb
|
224
|
+
- spec/fixtures/config/calculations/transport.rb
|
225
|
+
- spec/fixtures/config/electricity.rb
|
225
226
|
- spec/spec.opts
|
226
227
|
- spec/spec_helper.rb
|
227
228
|
has_rdoc: true
|
@@ -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
|
-
}
|