automobile_trip 0.0.9 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.document +5 -0
- data/.gitignore +21 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +200 -0
- data/LICENSE-PREAMBLE +52 -0
- data/Rakefile +71 -0
- data/VERSION +1 -0
- data/automobile_trip.gemspec +27 -0
- data/dot.rvmrc +9 -0
- data/features/automobile_trip_committees.feature +415 -16
- data/features/automobile_trip_emissions.feature +142 -12
- data/features/step_definitions/automobile_trip_steps.rb +15 -0
- data/features/step_definitions/mapquest_steps.rb +5 -0
- data/features/support/env.rb +7 -1
- data/lib/automobile_trip.rb +1 -0
- data/lib/automobile_trip/carbon_model.rb +570 -13
- data/lib/automobile_trip/characterization.rb +20 -1
- data/lib/automobile_trip/data.rb +21 -4
- data/lib/automobile_trip/fallback.rb +6 -2
- data/lib/automobile_trip/relationships.rb +7 -1
- data/lib/automobile_trip/version.rb +5 -0
- data/lib/test_support/db/fixtures/automobile_fuels.csv +4 -0
- data/lib/test_support/db/fixtures/automobile_make_model_year_variants.csv +2 -0
- data/lib/test_support/db/fixtures/automobile_make_model_years.csv +2 -0
- data/lib/test_support/db/fixtures/automobile_make_models.csv +2 -0
- data/lib/test_support/db/fixtures/automobile_make_years.csv +2 -0
- data/lib/test_support/db/fixtures/automobile_makes.csv +2 -0
- data/lib/test_support/db/fixtures/automobile_size_classes.csv +3 -0
- data/lib/test_support/db/fixtures/automobile_type_fuel_years.csv +5 -0
- data/lib/test_support/db/fixtures/automobile_type_years.csv +3 -0
- data/lib/test_support/db/fixtures/fuel_years.csv +2 -0
- data/lib/test_support/db/fixtures/fuels.csv +4 -0
- data/lib/test_support/db/fixtures/greenhouse_gases.csv +3 -0
- data/vendor/plugin/mapquest/README.textile +70 -0
- data/vendor/plugin/mapquest/Rakefile +15 -0
- data/vendor/plugin/mapquest/init.rb +1 -0
- data/vendor/plugin/mapquest/lib/mapquest_directions.rb +56 -0
- data/vendor/plugin/mapquest/spec/lib/mapquest_directions.xml +2 -0
- data/vendor/plugin/mapquest/spec/lib/mapquest_directions_fail.xml +2 -0
- data/vendor/plugin/mapquest/spec/lib/mapquest_directions_spec.rb +58 -0
- data/vendor/plugin/mapquest/spec/spec_helper.rb +13 -0
- metadata +55 -121
- data/lib/automobile_trip/committee_structure.rb +0 -65
@@ -1,65 +0,0 @@
|
|
1
|
-
committee :emission_factor do
|
2
|
-
quorum 'from fuel type', :needs => :fuel_type do |characteristics|
|
3
|
-
# characteristics[:fuel_type].emission_factor
|
4
|
-
end
|
5
|
-
|
6
|
-
quorum 'default' do
|
7
|
-
# AutomobileTrip.fallback.emission_factor
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
committee :fuel_consumed do
|
12
|
-
quorum 'from fuel cost and fuel price' do
|
13
|
-
# fuel_cost / fuel_price
|
14
|
-
end
|
15
|
-
|
16
|
-
quorum 'from distance and fuel efficiency', :needs => [:distance, :average_fuel_efficiency] do |characteristics|
|
17
|
-
# characteristics[:distance] / characteristics[:average_fuel_efficiency]
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
committee :fuel_price do
|
22
|
-
# quorum 'from location'
|
23
|
-
#
|
24
|
-
# end
|
25
|
-
|
26
|
-
quorum 'from fuel type' do
|
27
|
-
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
committee :distance do
|
32
|
-
quorum 'from duration and speed' do
|
33
|
-
# duration * speed
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
committee :average_fuel_efficiency do
|
38
|
-
quorum 'from variant' do # variant includes make, year, and model
|
39
|
-
end
|
40
|
-
|
41
|
-
quorum 'from model' do # model includes make and year
|
42
|
-
end
|
43
|
-
|
44
|
-
quorum 'from year' do # year includes make
|
45
|
-
end
|
46
|
-
|
47
|
-
quorum 'from make' do
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
committee :fuel_type do
|
52
|
-
quorum 'from variant' do
|
53
|
-
end
|
54
|
-
|
55
|
-
quorum 'from model' do
|
56
|
-
end
|
57
|
-
|
58
|
-
quorum 'from make' do
|
59
|
-
end
|
60
|
-
|
61
|
-
quorum 'default' do
|
62
|
-
# AutomobileTrip.fallback.fuel_type
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|