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.
Files changed (33) hide show
  1. data/CHANGELOG.txt +3 -0
  2. data/README.txt +28 -15
  3. data/Rakefile +1 -16
  4. data/VERSION +1 -1
  5. data/amee-data-abstraction.gemspec +6 -5
  6. data/lib/amee-data-abstraction/calculation.rb +1 -1
  7. data/lib/amee-data-abstraction/calculation_set.rb +152 -10
  8. data/lib/amee-data-abstraction/drill.rb +8 -2
  9. data/lib/amee-data-abstraction/input.rb +24 -0
  10. data/lib/amee-data-abstraction/ongoing_calculation.rb +13 -9
  11. data/lib/amee-data-abstraction/term.rb +31 -13
  12. data/spec/amee-data-abstraction/calculation_set_spec.rb +244 -8
  13. data/spec/amee-data-abstraction/calculation_spec.rb +23 -18
  14. data/spec/amee-data-abstraction/drill_spec.rb +34 -7
  15. data/spec/amee-data-abstraction/input_spec.rb +113 -73
  16. data/spec/amee-data-abstraction/metadatum_spec.rb +1 -1
  17. data/spec/amee-data-abstraction/ongoing_calculation_spec.rb +45 -29
  18. data/spec/amee-data-abstraction/profile_spec.rb +2 -2
  19. data/spec/amee-data-abstraction/prototype_calculation_spec.rb +12 -8
  20. data/spec/amee-data-abstraction/term_spec.rb +49 -5
  21. data/spec/amee-data-abstraction/terms_list_spec.rb +16 -12
  22. data/spec/config/amee_units_spec.rb +1 -2
  23. data/spec/core-extensions/class_spec.rb +18 -18
  24. data/spec/core-extensions/hash_spec.rb +1 -2
  25. data/spec/core-extensions/ordered_hash_spec.rb +1 -2
  26. data/spec/core-extensions/proc_spec.rb +1 -1
  27. data/spec/fixtures/{electricity.rb → config/calculations/electricity.rb} +2 -2
  28. data/spec/fixtures/config/calculations/electricity_and_transport.rb +53 -0
  29. data/spec/fixtures/{transport.rb → config/calculations/transport.rb} +2 -2
  30. data/spec/fixtures/config/electricity.rb +35 -0
  31. data/spec/spec_helper.rb +38 -6
  32. metadata +8 -7
  33. 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: 31
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
- - 2
8
+ - 3
9
9
  - 0
10
- version: 1.2.0
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-10 00:00:00 +01:00
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
- }