fuel_purchase 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +20 -20
- data/README.rdoc +17 -17
- data/features/fuel_purchase_committees.feature +20 -0
- data/features/fuel_purchase_emissions.feature +12 -0
- data/features/support/env.rb +8 -0
- data/lib/fuel_purchase.rb +25 -80
- data/lib/fuel_purchase/carbon_model.rb +89 -0
- data/lib/fuel_purchase/characterization.rb +22 -0
- data/lib/fuel_purchase/data.rb +33 -0
- data/lib/fuel_purchase/summarization.rb +12 -0
- data/lib/test_support/db/schema.rb +19 -0
- data/lib/test_support/fuel_purchase_record.rb +11 -0
- metadata +265 -20
- data/.document +0 -5
- data/.gitignore +0 -21
- data/Rakefile +0 -54
- data/VERSION +0 -1
- data/test/helper.rb +0 -10
- data/test/test_fuel_purchase.rb +0 -7
data/LICENSE
CHANGED
@@ -1,20 +1,20 @@
|
|
1
|
-
Copyright (c) 2009 Andy Rossmeissl
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
-
a copy of this software and associated documentation files (the
|
5
|
-
"Software"), to deal in the Software without restriction, including
|
6
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
-
permit persons to whom the Software is furnished to do so, subject to
|
9
|
-
the following conditions:
|
10
|
-
|
11
|
-
The above copyright notice and this permission notice shall be
|
12
|
-
included in all copies or substantial portions of the Software.
|
13
|
-
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
1
|
+
Copyright (c) 2009 Andy Rossmeissl
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
CHANGED
@@ -1,17 +1,17 @@
|
|
1
|
-
= fuel_purchase
|
2
|
-
|
3
|
-
Description goes here.
|
4
|
-
|
5
|
-
== Note on Patches/Pull Requests
|
6
|
-
|
7
|
-
* Fork the project.
|
8
|
-
* Make your feature addition or bug fix.
|
9
|
-
* Add tests for it. This is important so I don't break it in a
|
10
|
-
future version unintentionally.
|
11
|
-
* Commit, do not mess with rakefile, version, or history.
|
12
|
-
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
13
|
-
* Send me a pull request. Bonus points for topic branches.
|
14
|
-
|
15
|
-
== Copyright
|
16
|
-
|
17
|
-
Copyright (c) 2010 Andy Rossmeissl. See LICENSE for details.
|
1
|
+
= fuel_purchase
|
2
|
+
|
3
|
+
Description goes here.
|
4
|
+
|
5
|
+
== Note on Patches/Pull Requests
|
6
|
+
|
7
|
+
* Fork the project.
|
8
|
+
* Make your feature addition or bug fix.
|
9
|
+
* Add tests for it. This is important so I don't break it in a
|
10
|
+
future version unintentionally.
|
11
|
+
* Commit, do not mess with rakefile, version, or history.
|
12
|
+
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
13
|
+
* Send me a pull request. Bonus points for topic branches.
|
14
|
+
|
15
|
+
== Copyright
|
16
|
+
|
17
|
+
Copyright (c) 2010 Andy Rossmeissl. See LICENSE for details.
|
@@ -0,0 +1,20 @@
|
|
1
|
+
Feature: Fuel Purchase Committee Calculations
|
2
|
+
The fuel purchase model should generate correct committee calculations
|
3
|
+
|
4
|
+
Scenario Outline: Standard Calculations for TODO
|
5
|
+
Given a fuel purchase has "origin_airport.iata_code" of "<source>"
|
6
|
+
And it has "destination_airport.iata_code" of "<dest>"
|
7
|
+
And it has "airline.iata_code" of "<airline>"
|
8
|
+
And it has "date" of "<date>"
|
9
|
+
And it used "aircraft.icao_code" "<aircraft>"
|
10
|
+
When emissions are calculated
|
11
|
+
Then the fuel committee should be close to <fuel>, +/-1
|
12
|
+
And the fuel_per_segment committee should be close to <fuel_per_segment>, +/-10
|
13
|
+
And the adjusted_distance_per_segment committee should be close to <adjusted_distance_per_segment>, +/-1
|
14
|
+
And the load_factor committee should be close to <load_factor>, +/-0.001
|
15
|
+
And the passengers committee should be exactly <passengers>
|
16
|
+
And the adjusted_distance committee should be close to <adjusted_distance>, +/-1
|
17
|
+
Examples:
|
18
|
+
| source | dest | airline | date | aircraft | fuel | fuel_per_segment | adjusted_distance_per_segment | load_factor | passengers | adjusted_distance |
|
19
|
+
| DTW | SFO | UA | 2010-06-25 | A320 | 24676 | 7612 | 1341 | 0.801 | 120 | 2241 |
|
20
|
+
| IAD | CDG | AF | 2010-06-25 | A320 | 43477 | 13413 | 2492 | 0.800 | 120 | 4161 |
|
@@ -0,0 +1,12 @@
|
|
1
|
+
Feature: Fuel Purchase Emissions Calculations
|
2
|
+
The fuel purchase model should generate correct emission calculations
|
3
|
+
|
4
|
+
Scenario Outline: Standard Calculations for fuel purchase classes
|
5
|
+
Given a fuel purchase has "zip_code.name" of "<zip_code>"
|
6
|
+
And it has "fuel_type.name" of "<fuel_type>"
|
7
|
+
When emissions are calculated
|
8
|
+
Then the emission value should be within 0.1 kgs of <emission>
|
9
|
+
Examples:
|
10
|
+
| zip_code | fuel_type | emission |
|
11
|
+
| 48915 | Conventional Motor Gasoline | 1234 |
|
12
|
+
| 22406 | Residential Natural Gas | 11964.8 |
|
data/lib/fuel_purchase.rb
CHANGED
@@ -1,85 +1,30 @@
|
|
1
1
|
module BrighterPlanet
|
2
2
|
module FuelPurchase
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
committee :volume do
|
28
|
-
quorum 'from cost and price', :needs => [:cost, :price] do |characteristics|
|
29
|
-
# dollars dollars / variable unit FIXME TODO should we make prices $ / kJ to avoid unit mismatches?
|
30
|
-
characteristics[:cost] * characteristics[:price]
|
31
|
-
end
|
32
|
-
|
33
|
-
quorum 'from fuel type', :needs => :fuel_type do |characteristics|
|
34
|
-
# variable units
|
35
|
-
characteristics[:fuel_type].average_purchase_volume
|
36
|
-
end
|
37
|
-
|
38
|
-
quorum 'default' do # FIXME TODO get rid of this if we ever make a fallback fuel_type
|
39
|
-
# variable units
|
40
|
-
FuelType.fallback.average_purchase_volume
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
committee :price do
|
45
|
-
# FIXME TODO fill in location- and date-based quorums
|
46
|
-
# quorum :from_fuel_type_and_state_and_date, :needs => [:fuel_type, :state, :date] do |characteristics, timeframe|
|
47
|
-
# end
|
48
|
-
#
|
49
|
-
# quorum :from_fuel_type_and_petroleum_administration_for_defense_district_and_date, :needs => [:fuel_type, :petroleum_administration_for_defense_district, :date] do |characteristics, timeframe|
|
50
|
-
# end
|
51
|
-
#
|
52
|
-
# quorum :from_fuel_type_and_state, :needs => [:fuel_type, :state] do |characteristics, timeframe|
|
53
|
-
# end
|
54
|
-
#
|
55
|
-
# quorum :from_fuel_type_and_petroleum_administration_for_defense_district, :needs => [:fuel_type, :petroleum_administration_for_defense_district] do |characteristics, timeframe|
|
56
|
-
# end
|
57
|
-
#
|
58
|
-
# quorum :from_fuel_type_and_date, :needs [:fuel_type, :date] do |characteristics, timeframe|
|
59
|
-
# end
|
60
|
-
quorum 'from fuel type', :needs => :fuel_type do |characteristics|
|
61
|
-
# dollars / variable unit
|
62
|
-
characteristics[:fuel_type].price
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
committee :petroleum_administration_for_defense_district do
|
67
|
-
quorum 'from state', :needs => :state do |characteristics|
|
68
|
-
characteristics[:state].petroleum_administration_for_defense_district
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
committee :state do
|
73
|
-
quorum 'from zip code', :needs => :zip_code do |characteristics|
|
74
|
-
characteristics[:zip_code].state
|
75
|
-
end
|
76
|
-
end
|
77
|
-
|
78
|
-
# FIXME TODO should this be only user-supplied, or should we specify a fallback?
|
79
|
-
# committee :fuel_type do |characteristics, timeframe|
|
80
|
-
# FuelType.fallback.fuel_type
|
81
|
-
# end
|
3
|
+
extend self
|
4
|
+
|
5
|
+
def included(base)
|
6
|
+
require 'cohort_scope'
|
7
|
+
require 'falls_back_on'
|
8
|
+
require 'falls_back_on/active_record_ext'
|
9
|
+
|
10
|
+
require 'fuel_purchase/carbon_model'
|
11
|
+
require 'fuel_purchase/characterization'
|
12
|
+
require 'fuel_purchase/data'
|
13
|
+
require 'fuel_purchase/summarization'
|
14
|
+
|
15
|
+
base.send :include, BrighterPlanet::FuelPurchase::CarbonModel
|
16
|
+
base.send :include, BrighterPlanet::FuelPurchase::Characterization
|
17
|
+
base.send :include, BrighterPlanet::FuelPurchase::Data
|
18
|
+
base.send :include, BrighterPlanet::FuelPurchase::Summarization
|
19
|
+
end
|
20
|
+
def fuel_purchase_model
|
21
|
+
if Object.const_defined? 'FuelPurchase'
|
22
|
+
::FuelPurchase
|
23
|
+
elsif Object.const_defined? 'FuelPurchaseRecord'
|
24
|
+
FuelPurchaseRecord
|
25
|
+
else
|
26
|
+
raise 'There is no fuel_purchase model'
|
82
27
|
end
|
83
28
|
end
|
84
29
|
end
|
85
|
-
end
|
30
|
+
end
|
@@ -0,0 +1,89 @@
|
|
1
|
+
require 'leap'
|
2
|
+
|
3
|
+
module BrighterPlanet
|
4
|
+
module FuelPurchase
|
5
|
+
module CarbonModel
|
6
|
+
def self.included(base)
|
7
|
+
base.extend ::Leap::Subject
|
8
|
+
base.decide :emission, :with => :characteristics do
|
9
|
+
committee :emission do
|
10
|
+
quorum 'from volume and emission factor', :needs => [:volume, :emission_factor] do |characteristics|
|
11
|
+
# variable units variable units FIXME TODO should we make volumes energy contents to avoid unit mismatches?
|
12
|
+
characteristics[:volume] * characteristics[:emission_factor]
|
13
|
+
end
|
14
|
+
|
15
|
+
quorum 'default' do
|
16
|
+
raise "The fuel purchase's default emission quorum should never be called"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
committee :emission_factor do # FIXME TODO add date-based lookup once we have timeseries of emission factors
|
21
|
+
quorum 'from fuel type', :needs => :fuel_type do |characteristics|
|
22
|
+
characteristics[:fuel_type].emission_factor
|
23
|
+
end
|
24
|
+
|
25
|
+
quorum 'default' do
|
26
|
+
::FuelType.fallback.emission_factor
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
committee :volume do
|
31
|
+
quorum 'from cost and price', :needs => [:cost, :price] do |characteristics|
|
32
|
+
# dollars dollars / variable unit FIXME TODO should we make prices $ / kJ to avoid unit mismatches?
|
33
|
+
characteristics[:cost] * characteristics[:price]
|
34
|
+
end
|
35
|
+
|
36
|
+
quorum 'from fuel type', :needs => :fuel_type do |characteristics|
|
37
|
+
# variable units
|
38
|
+
characteristics[:fuel_type].average_purchase_volume
|
39
|
+
end
|
40
|
+
|
41
|
+
quorum 'default' do # FIXME TODO get rid of this if we ever make a fallback fuel_type
|
42
|
+
# variable units
|
43
|
+
FuelType.fallback.average_purchase_volume
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
committee :price do
|
48
|
+
# FIXME TODO fill in location- and date-based quorums
|
49
|
+
# quorum :from_fuel_type_and_state_and_date, :needs => [:fuel_type, :state, :date] do |characteristics, timeframe|
|
50
|
+
# end
|
51
|
+
#
|
52
|
+
# quorum :from_fuel_type_and_petroleum_administration_for_defense_district_and_date, :needs => [:fuel_type, :petroleum_administration_for_defense_district, :date] do |characteristics, timeframe|
|
53
|
+
# end
|
54
|
+
#
|
55
|
+
# quorum :from_fuel_type_and_state, :needs => [:fuel_type, :state] do |characteristics, timeframe|
|
56
|
+
# end
|
57
|
+
#
|
58
|
+
# quorum :from_fuel_type_and_petroleum_administration_for_defense_district, :needs => [:fuel_type, :petroleum_administration_for_defense_district] do |characteristics, timeframe|
|
59
|
+
# end
|
60
|
+
#
|
61
|
+
# quorum :from_fuel_type_and_date, :needs [:fuel_type, :date] do |characteristics, timeframe|
|
62
|
+
# end
|
63
|
+
quorum 'from fuel type', :needs => :fuel_type do |characteristics|
|
64
|
+
# dollars / variable unit
|
65
|
+
characteristics[:fuel_type].price
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
committee :petroleum_administration_for_defense_district do
|
70
|
+
quorum 'from state', :needs => :state do |characteristics|
|
71
|
+
characteristics[:state].petroleum_administration_for_defense_district
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
committee :state do
|
76
|
+
quorum 'from zip code', :needs => :zip_code do |characteristics|
|
77
|
+
characteristics[:zip_code].state
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
# FIXME TODO should this be only user-supplied, or should we specify a fallback?
|
82
|
+
# committee :fuel_type do |characteristics, timeframe|
|
83
|
+
# FuelType.fallback.fuel_type
|
84
|
+
# end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'characterizable'
|
2
|
+
|
3
|
+
module BrighterPlanet
|
4
|
+
module FuelPurchase
|
5
|
+
module Characterization
|
6
|
+
def self.included(base)
|
7
|
+
base.send :include, Characterizable
|
8
|
+
base.characterize do
|
9
|
+
has :fuel_type
|
10
|
+
has :volume
|
11
|
+
has :cost
|
12
|
+
has :price
|
13
|
+
has :emission_factor
|
14
|
+
has :zip_code
|
15
|
+
has :state
|
16
|
+
has :petroleum_administration_for_defense_district
|
17
|
+
has :date
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'data_miner'
|
2
|
+
|
3
|
+
module BrighterPlanet
|
4
|
+
module FuelPurchase
|
5
|
+
module Data
|
6
|
+
def self.included(base)
|
7
|
+
base.data_miner do
|
8
|
+
schema do
|
9
|
+
string 'fuel_type_id'
|
10
|
+
float 'volume'
|
11
|
+
string 'volume_units'
|
12
|
+
float 'cost'
|
13
|
+
string 'cost_units'
|
14
|
+
float 'price'
|
15
|
+
string 'price_units'
|
16
|
+
string 'zip_code_id'
|
17
|
+
string 'state_id'
|
18
|
+
string 'petroleum_administration_for_defense_district_id'
|
19
|
+
date 'date'
|
20
|
+
end
|
21
|
+
|
22
|
+
process "Pull orphans" do
|
23
|
+
FuelPrice.run_data_miner!
|
24
|
+
end
|
25
|
+
|
26
|
+
process "Pull dependencies" do
|
27
|
+
run_data_miner_on_belongs_to_associations
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'sniff/database'
|
2
|
+
|
3
|
+
Sniff::Database.define_schema do
|
4
|
+
create_table "fuel_purchase_records", :force => true do |t|
|
5
|
+
t.string "fuel_type_id"
|
6
|
+
t.float "volume"
|
7
|
+
t.string "volume_units"
|
8
|
+
t.float "cost"
|
9
|
+
t.string "cost_units"
|
10
|
+
t.float "price"
|
11
|
+
t.string "price_units"
|
12
|
+
t.string "zip_code_id"
|
13
|
+
t.string "state_id"
|
14
|
+
t.string "petroleum_administration_for_defense_district_id"
|
15
|
+
t.date "date"
|
16
|
+
t.datetime "updated_at"
|
17
|
+
t.datetime "created_at"
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'fuel_purchase'
|
2
|
+
|
3
|
+
class FuelPurchaseRecord < ActiveRecord::Base
|
4
|
+
include Sniff::Emitter
|
5
|
+
include ::BrighterPlanet::FuelPurchase
|
6
|
+
|
7
|
+
belongs_to :fuel_type
|
8
|
+
belongs_to :zip_code
|
9
|
+
belongs_to :state
|
10
|
+
belongs_to :petroleum_administration_for_defense_district
|
11
|
+
end
|
metadata
CHANGED
@@ -1,49 +1,284 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fuel_purchase
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 0
|
7
8
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Andy Rossmeissl
|
13
|
-
- Ian Hough
|
14
14
|
- Seamus Abshere
|
15
|
+
- Ian Hough
|
15
16
|
- Matt Kling
|
17
|
+
- Derek Kastner
|
16
18
|
autorequire:
|
17
19
|
bindir: bin
|
18
20
|
cert_chain: []
|
19
21
|
|
20
|
-
date: 2010-07-
|
22
|
+
date: 2010-07-23 00:00:00 -04:00
|
21
23
|
default_executable:
|
22
24
|
dependencies:
|
23
25
|
- !ruby/object:Gem::Dependency
|
24
|
-
|
26
|
+
type: :development
|
27
|
+
prerelease: false
|
28
|
+
name: activerecord
|
29
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
30
|
+
none: false
|
31
|
+
requirements:
|
32
|
+
- - "="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
hash: -1848230024
|
35
|
+
segments:
|
36
|
+
- 3
|
37
|
+
- 0
|
38
|
+
- 0
|
39
|
+
- beta4
|
40
|
+
version: 3.0.0.beta4
|
41
|
+
requirement: *id001
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
type: :development
|
25
44
|
prerelease: false
|
26
|
-
|
45
|
+
name: bundler
|
46
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
47
|
+
none: false
|
27
48
|
requirements:
|
28
49
|
- - ">="
|
29
50
|
- !ruby/object:Gem::Version
|
51
|
+
hash: 62196359
|
30
52
|
segments:
|
53
|
+
- 1
|
31
54
|
- 0
|
32
|
-
|
55
|
+
- 0
|
56
|
+
- beta
|
57
|
+
- 2
|
58
|
+
version: 1.0.0.beta.2
|
59
|
+
requirement: *id002
|
60
|
+
- !ruby/object:Gem::Dependency
|
33
61
|
type: :development
|
34
|
-
|
62
|
+
prerelease: false
|
63
|
+
name: cucumber
|
64
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - "="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
hash: 57
|
70
|
+
segments:
|
71
|
+
- 0
|
72
|
+
- 8
|
73
|
+
- 3
|
74
|
+
version: 0.8.3
|
75
|
+
requirement: *id003
|
35
76
|
- !ruby/object:Gem::Dependency
|
36
|
-
|
77
|
+
type: :development
|
37
78
|
prerelease: false
|
38
|
-
|
79
|
+
name: jeweler
|
80
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - "="
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
hash: 7
|
86
|
+
segments:
|
87
|
+
- 1
|
88
|
+
- 4
|
89
|
+
- 0
|
90
|
+
version: 1.4.0
|
91
|
+
requirement: *id004
|
92
|
+
- !ruby/object:Gem::Dependency
|
93
|
+
type: :development
|
94
|
+
prerelease: false
|
95
|
+
name: rake
|
96
|
+
version_requirements: &id005 !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
39
98
|
requirements:
|
40
99
|
- - ">="
|
41
100
|
- !ruby/object:Gem::Version
|
101
|
+
hash: 3
|
42
102
|
segments:
|
43
103
|
- 0
|
44
104
|
version: "0"
|
105
|
+
requirement: *id005
|
106
|
+
- !ruby/object:Gem::Dependency
|
107
|
+
type: :development
|
108
|
+
prerelease: false
|
109
|
+
name: rdoc
|
110
|
+
version_requirements: &id006 !ruby/object:Gem::Requirement
|
111
|
+
none: false
|
112
|
+
requirements:
|
113
|
+
- - ">="
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
hash: 3
|
116
|
+
segments:
|
117
|
+
- 0
|
118
|
+
version: "0"
|
119
|
+
requirement: *id006
|
120
|
+
- !ruby/object:Gem::Dependency
|
121
|
+
type: :development
|
122
|
+
prerelease: false
|
123
|
+
name: rspec
|
124
|
+
version_requirements: &id007 !ruby/object:Gem::Requirement
|
125
|
+
none: false
|
126
|
+
requirements:
|
127
|
+
- - "="
|
128
|
+
- !ruby/object:Gem::Version
|
129
|
+
hash: 62196417
|
130
|
+
segments:
|
131
|
+
- 2
|
132
|
+
- 0
|
133
|
+
- 0
|
134
|
+
- beta
|
135
|
+
- 17
|
136
|
+
version: 2.0.0.beta.17
|
137
|
+
requirement: *id007
|
138
|
+
- !ruby/object:Gem::Dependency
|
45
139
|
type: :development
|
46
|
-
|
140
|
+
prerelease: false
|
141
|
+
name: sniff
|
142
|
+
version_requirements: &id008 !ruby/object:Gem::Requirement
|
143
|
+
none: false
|
144
|
+
requirements:
|
145
|
+
- - "="
|
146
|
+
- !ruby/object:Gem::Version
|
147
|
+
hash: 3
|
148
|
+
segments:
|
149
|
+
- 0
|
150
|
+
- 0
|
151
|
+
- 14
|
152
|
+
version: 0.0.14
|
153
|
+
requirement: *id008
|
154
|
+
- !ruby/object:Gem::Dependency
|
155
|
+
type: :runtime
|
156
|
+
prerelease: false
|
157
|
+
name: characterizable
|
158
|
+
version_requirements: &id009 !ruby/object:Gem::Requirement
|
159
|
+
none: false
|
160
|
+
requirements:
|
161
|
+
- - "="
|
162
|
+
- !ruby/object:Gem::Version
|
163
|
+
hash: 7
|
164
|
+
segments:
|
165
|
+
- 0
|
166
|
+
- 0
|
167
|
+
- 12
|
168
|
+
version: 0.0.12
|
169
|
+
requirement: *id009
|
170
|
+
- !ruby/object:Gem::Dependency
|
171
|
+
type: :runtime
|
172
|
+
prerelease: false
|
173
|
+
name: data_miner
|
174
|
+
version_requirements: &id010 !ruby/object:Gem::Requirement
|
175
|
+
none: false
|
176
|
+
requirements:
|
177
|
+
- - "="
|
178
|
+
- !ruby/object:Gem::Version
|
179
|
+
hash: 15
|
180
|
+
segments:
|
181
|
+
- 0
|
182
|
+
- 5
|
183
|
+
- 2
|
184
|
+
version: 0.5.2
|
185
|
+
requirement: *id010
|
186
|
+
- !ruby/object:Gem::Dependency
|
187
|
+
type: :runtime
|
188
|
+
prerelease: false
|
189
|
+
name: falls_back_on
|
190
|
+
version_requirements: &id011 !ruby/object:Gem::Requirement
|
191
|
+
none: false
|
192
|
+
requirements:
|
193
|
+
- - "="
|
194
|
+
- !ruby/object:Gem::Version
|
195
|
+
hash: 27
|
196
|
+
segments:
|
197
|
+
- 0
|
198
|
+
- 0
|
199
|
+
- 2
|
200
|
+
version: 0.0.2
|
201
|
+
requirement: *id011
|
202
|
+
- !ruby/object:Gem::Dependency
|
203
|
+
type: :runtime
|
204
|
+
prerelease: false
|
205
|
+
name: fast_timestamp
|
206
|
+
version_requirements: &id012 !ruby/object:Gem::Requirement
|
207
|
+
none: false
|
208
|
+
requirements:
|
209
|
+
- - "="
|
210
|
+
- !ruby/object:Gem::Version
|
211
|
+
hash: 23
|
212
|
+
segments:
|
213
|
+
- 0
|
214
|
+
- 0
|
215
|
+
- 4
|
216
|
+
version: 0.0.4
|
217
|
+
requirement: *id012
|
218
|
+
- !ruby/object:Gem::Dependency
|
219
|
+
type: :runtime
|
220
|
+
prerelease: false
|
221
|
+
name: leap
|
222
|
+
version_requirements: &id013 !ruby/object:Gem::Requirement
|
223
|
+
none: false
|
224
|
+
requirements:
|
225
|
+
- - "="
|
226
|
+
- !ruby/object:Gem::Version
|
227
|
+
hash: 13
|
228
|
+
segments:
|
229
|
+
- 0
|
230
|
+
- 4
|
231
|
+
- 1
|
232
|
+
version: 0.4.1
|
233
|
+
requirement: *id013
|
234
|
+
- !ruby/object:Gem::Dependency
|
235
|
+
type: :runtime
|
236
|
+
prerelease: false
|
237
|
+
name: summary_judgement
|
238
|
+
version_requirements: &id014 !ruby/object:Gem::Requirement
|
239
|
+
none: false
|
240
|
+
requirements:
|
241
|
+
- - "="
|
242
|
+
- !ruby/object:Gem::Version
|
243
|
+
hash: 11
|
244
|
+
segments:
|
245
|
+
- 1
|
246
|
+
- 3
|
247
|
+
- 8
|
248
|
+
version: 1.3.8
|
249
|
+
requirement: *id014
|
250
|
+
- !ruby/object:Gem::Dependency
|
251
|
+
type: :runtime
|
252
|
+
prerelease: false
|
253
|
+
name: timeframe
|
254
|
+
version_requirements: &id015 !ruby/object:Gem::Requirement
|
255
|
+
none: false
|
256
|
+
requirements:
|
257
|
+
- - "="
|
258
|
+
- !ruby/object:Gem::Version
|
259
|
+
hash: 15
|
260
|
+
segments:
|
261
|
+
- 0
|
262
|
+
- 0
|
263
|
+
- 8
|
264
|
+
version: 0.0.8
|
265
|
+
requirement: *id015
|
266
|
+
- !ruby/object:Gem::Dependency
|
267
|
+
type: :runtime
|
268
|
+
prerelease: false
|
269
|
+
name: weighted_average
|
270
|
+
version_requirements: &id016 !ruby/object:Gem::Requirement
|
271
|
+
none: false
|
272
|
+
requirements:
|
273
|
+
- - "="
|
274
|
+
- !ruby/object:Gem::Version
|
275
|
+
hash: 23
|
276
|
+
segments:
|
277
|
+
- 0
|
278
|
+
- 0
|
279
|
+
- 4
|
280
|
+
version: 0.0.4
|
281
|
+
requirement: *id016
|
47
282
|
description: A software model in Ruby for the greenhouse gas emissions of a fuel purchase
|
48
283
|
email: andy@rossmeissl.net
|
49
284
|
executables: []
|
@@ -54,15 +289,18 @@ extra_rdoc_files:
|
|
54
289
|
- LICENSE
|
55
290
|
- README.rdoc
|
56
291
|
files:
|
57
|
-
- .document
|
58
|
-
- .gitignore
|
59
292
|
- LICENSE
|
60
293
|
- README.rdoc
|
61
|
-
- Rakefile
|
62
|
-
- VERSION
|
63
294
|
- lib/fuel_purchase.rb
|
64
|
-
-
|
65
|
-
-
|
295
|
+
- lib/fuel_purchase/carbon_model.rb
|
296
|
+
- lib/fuel_purchase/characterization.rb
|
297
|
+
- lib/fuel_purchase/data.rb
|
298
|
+
- lib/fuel_purchase/summarization.rb
|
299
|
+
- lib/test_support/db/schema.rb
|
300
|
+
- lib/test_support/fuel_purchase_record.rb
|
301
|
+
- features/support/env.rb
|
302
|
+
- features/fuel_purchase_committees.feature
|
303
|
+
- features/fuel_purchase_emissions.feature
|
66
304
|
has_rdoc: true
|
67
305
|
homepage: http://github.com/brighterplanet/fuel_purchase
|
68
306
|
licenses: []
|
@@ -73,26 +311,33 @@ rdoc_options:
|
|
73
311
|
require_paths:
|
74
312
|
- lib
|
75
313
|
required_ruby_version: !ruby/object:Gem::Requirement
|
314
|
+
none: false
|
76
315
|
requirements:
|
77
316
|
- - ">="
|
78
317
|
- !ruby/object:Gem::Version
|
318
|
+
hash: 3
|
79
319
|
segments:
|
80
320
|
- 0
|
81
321
|
version: "0"
|
82
322
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
323
|
+
none: false
|
83
324
|
requirements:
|
84
325
|
- - ">="
|
85
326
|
- !ruby/object:Gem::Version
|
327
|
+
hash: 3
|
86
328
|
segments:
|
87
329
|
- 0
|
88
330
|
version: "0"
|
89
331
|
requirements: []
|
90
332
|
|
91
333
|
rubyforge_project:
|
92
|
-
rubygems_version: 1.3.
|
334
|
+
rubygems_version: 1.3.7
|
93
335
|
signing_key:
|
94
336
|
specification_version: 3
|
95
337
|
summary: A carbon model
|
96
338
|
test_files:
|
97
|
-
-
|
98
|
-
-
|
339
|
+
- features/support/env.rb
|
340
|
+
- features/fuel_purchase_committees.feature
|
341
|
+
- features/fuel_purchase_emissions.feature
|
342
|
+
- lib/test_support/db/schema.rb
|
343
|
+
- lib/test_support/fuel_purchase_record.rb
|
data/.document
DELETED
data/.gitignore
DELETED
data/Rakefile
DELETED
@@ -1,54 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'rake'
|
3
|
-
|
4
|
-
begin
|
5
|
-
require 'jeweler'
|
6
|
-
Jeweler::Tasks.new do |gem|
|
7
|
-
gem.name = "fuel_purchase"
|
8
|
-
gem.summary = %Q{A carbon model}
|
9
|
-
gem.description = %Q{A software model in Ruby for the greenhouse gas emissions of a fuel purchase}
|
10
|
-
gem.email = "andy@rossmeissl.net"
|
11
|
-
gem.homepage = "http://github.com/brighterplanet/fuel_purchase"
|
12
|
-
gem.authors = ["Andy Rossmeissl", "Ian Hough", "Seamus Abshere", "Matt Kling"]
|
13
|
-
gem.add_development_dependency "leap"
|
14
|
-
gem.add_development_dependency "thoughtbot-shoulda", ">= 0"
|
15
|
-
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
16
|
-
end
|
17
|
-
Jeweler::GemcutterTasks.new
|
18
|
-
rescue LoadError
|
19
|
-
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
20
|
-
end
|
21
|
-
|
22
|
-
require 'rake/testtask'
|
23
|
-
Rake::TestTask.new(:test) do |test|
|
24
|
-
test.libs << 'lib' << 'test'
|
25
|
-
test.pattern = 'test/**/test_*.rb'
|
26
|
-
test.verbose = true
|
27
|
-
end
|
28
|
-
|
29
|
-
begin
|
30
|
-
require 'rcov/rcovtask'
|
31
|
-
Rcov::RcovTask.new do |test|
|
32
|
-
test.libs << 'test'
|
33
|
-
test.pattern = 'test/**/test_*.rb'
|
34
|
-
test.verbose = true
|
35
|
-
end
|
36
|
-
rescue LoadError
|
37
|
-
task :rcov do
|
38
|
-
abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
task :test => :check_dependencies
|
43
|
-
|
44
|
-
task :default => :test
|
45
|
-
|
46
|
-
require 'rake/rdoctask'
|
47
|
-
Rake::RDocTask.new do |rdoc|
|
48
|
-
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
49
|
-
|
50
|
-
rdoc.rdoc_dir = 'rdoc'
|
51
|
-
rdoc.title = "fuel_purchase #{version}"
|
52
|
-
rdoc.rdoc_files.include('README*')
|
53
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
54
|
-
end
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.0.1
|
data/test/helper.rb
DELETED
data/test/test_fuel_purchase.rb
DELETED