bus_trip 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/bus_trip_committees.feature +15 -0
- data/features/bus_trip_emissions.feature +19 -0
- data/features/support/env.rb +8 -0
- data/lib/bus_trip/carbon_model.rb +92 -0
- data/lib/bus_trip/characterization.rb +16 -0
- data/lib/bus_trip/data.rb +22 -0
- data/lib/bus_trip/summarization.rb +18 -0
- data/lib/bus_trip.rb +25 -82
- data/lib/test_support/bus_trip_record.rb +28 -0
- data/lib/test_support/db/schema.rb +14 -0
- metadata +280 -20
- data/.document +0 -5
- data/.gitignore +0 -21
- data/Rakefile +0 -54
- data/VERSION +0 -1
- data/bus_trip.gemspec +0 -57
- data/test/helper.rb +0 -10
- data/test/test_bus_trip.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
|
-
= bus_trip
|
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
|
+
= bus_trip
|
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,15 @@
|
|
1
|
+
Feature: Bus Trip Committee Calculations
|
2
|
+
The bus trip model should generate correct committee calculations
|
3
|
+
|
4
|
+
Scenario Outline: Standard Calculations for bus trip
|
5
|
+
Given a bus trip has "distance" of "<distance_estimate>"
|
6
|
+
And it used "duration" "<duration>"
|
7
|
+
And it used "bus_class.name" "<bus_class>"
|
8
|
+
When emissions are calculated
|
9
|
+
Then the distance committee should be close to <distance>, +/-1
|
10
|
+
Examples:
|
11
|
+
| duration | distance_estimate | bus_class | distance |
|
12
|
+
| 40 | | | 21 |
|
13
|
+
| | 60 | | 8 |
|
14
|
+
| | | regional coach | 21 |
|
15
|
+
| | | city transit | 8 |
|
@@ -0,0 +1,19 @@
|
|
1
|
+
Feature: Bus Trip Emissions Calculations
|
2
|
+
The bus trip model should generate correct emission calculations
|
3
|
+
|
4
|
+
Scenario Outline: Standard Calculations for bus trips
|
5
|
+
Given a bus trip has "distance" of "<source>"
|
6
|
+
And it used "bus_class.gasoline_intensity" "<gasoline>"
|
7
|
+
And it used "bus_class.diesel_intensity" "<diesel>"
|
8
|
+
And it used "bus_class.alternative_fuels_intensity" "<alternative>"
|
9
|
+
And it has "bus_class.passengers" "<passengers>"
|
10
|
+
And it has "distance_estimate" of "<distance>"
|
11
|
+
And it has "bus_class.name" "<bus_class>"
|
12
|
+
When emissions are calculated
|
13
|
+
Then the emission value should be within 0.1 kgs of <emission>
|
14
|
+
Examples:
|
15
|
+
| gasoline | diesel | alternative | passengers | distance | bus_class | emission |
|
16
|
+
| 40 | | | 25 | 328 | regional coach | 41.8 |
|
17
|
+
| | 60 | | 85 | 623 | regional coach | 79.5 |
|
18
|
+
| | 10 | 10 | 120 | 11 | city transit | 1.4 |
|
19
|
+
| | 20 | | 20 | 11 | city transit | 1.4 |
|
@@ -0,0 +1,92 @@
|
|
1
|
+
require 'leap'
|
2
|
+
|
3
|
+
module BrighterPlanet
|
4
|
+
module BusTrip
|
5
|
+
module CarbonModel
|
6
|
+
def self.included(base)
|
7
|
+
base.extend ::Leap::Subject
|
8
|
+
base.extend FastTimestamp
|
9
|
+
base.decide :emission, :with => :characteristics do
|
10
|
+
committee :emission do # returns kg CO2
|
11
|
+
quorum 'from fuel and passengers', :needs => [:diesel_consumed, :gasoline_consumed, :alternative_fuels_consumed, :passengers, :distance, :bus_class] do |characteristics|
|
12
|
+
#(( litres diesel ) * ( kilograms CO2 / litre diesel ) + ( litres gasoline ) * ( kilograms CO2 / kWh ) + ( litre-equivs alternative fuel ) * (kilograms CO2 / litre-equiv alternative fuel))
|
13
|
+
(characteristics[:diesel_consumed] * BusTrip.bus_trip_model.research(:diesel_emission_factor) + characteristics[:gasoline_consumed] * BusTrip.bus_trip_model.research(:gasoline_emission_factor) + characteristics[:alternative_fuels_consumed] * BusTrip.bus_trip_model.research(:alternative_fuels_emission_factor) + characteristics[:distance] * characteristics[:bus_class].fugitive_air_conditioning_emission) / characteristics[:passengers]
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
committee :diesel_consumed do # returns litres diesel
|
18
|
+
quorum 'from distance and diesel intensity', :needs => [:distance, :diesel_intensity] do |characteristics|
|
19
|
+
#( kilometres ) * ( litres diesel / kilometre )
|
20
|
+
characteristics[:distance] * characteristics[:diesel_intensity]
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
committee :gasoline_consumed do # returns litres gasoline
|
25
|
+
quorum 'from distance and gasoline intensity', :needs => [:distance, :gasoline_intensity] do |characteristics|
|
26
|
+
#( kilometres ) * ( litres gasoline / kilometre )
|
27
|
+
characteristics[:distance] * characteristics[:gasoline_intensity]
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
committee :alternative_fuels_consumed do # returns litres alternative_fuels
|
32
|
+
quorum 'from distance and alternative fuels intensity', :needs => [:distance, :alternative_fuels_intensity] do |characteristics|
|
33
|
+
#( kilometres ) * ( litres alternative_fuels / kilometre )
|
34
|
+
characteristics[:distance] * characteristics[:alternative_fuels_intensity]
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
committee :distance do # returns kilometres
|
39
|
+
quorum 'from distance estimate', :needs => :distance_estimate do |characteristics|
|
40
|
+
characteristics[:distance_estimate]
|
41
|
+
end
|
42
|
+
|
43
|
+
quorum 'from duration', :needs => [:duration, :speed] do |characteristics|
|
44
|
+
#( minutes ) * ( kph )
|
45
|
+
characteristics[:duration] * characteristics[:speed] / 60
|
46
|
+
end
|
47
|
+
|
48
|
+
quorum 'from bus class', :needs => :bus_class do |characteristics|
|
49
|
+
characteristics[:bus_class].distance
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
committee :diesel_intensity do # returns litres diesel / vehicle kilometre
|
54
|
+
quorum 'from bus class', :needs => :bus_class do |characteristics|
|
55
|
+
characteristics[:bus_class].diesel_intensity
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
committee :gasoline_intensity do # returns litres gasoline / vehicle kilometre
|
60
|
+
quorum 'from bus class', :needs => :bus_class do |characteristics|
|
61
|
+
characteristics[:bus_class].gasoline_intensity
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
committee :alternative_fuels_intensity do # returns litres alternative_fuels / vehicle kilometre
|
66
|
+
quorum 'from bus class', :needs => :bus_class do |characteristics|
|
67
|
+
characteristics[:bus_class].alternative_fuels_intensity
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
committee :speed do # returns kph
|
72
|
+
quorum 'from bus class', :needs => :bus_class do |characteristics|
|
73
|
+
characteristics[:bus_class].speed
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
committee :passengers do
|
78
|
+
quorum 'from bus class', :needs => :bus_class do |characteristics|
|
79
|
+
characteristics[:bus_class].passengers
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
committee :bus_class do
|
84
|
+
quorum 'default' do
|
85
|
+
BusClass.fallback
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'characterizable'
|
2
|
+
|
3
|
+
module BrighterPlanet
|
4
|
+
module BusTrip
|
5
|
+
module Characterization
|
6
|
+
def self.included(base)
|
7
|
+
base.send :include, Characterizable
|
8
|
+
base.characterize do
|
9
|
+
has :bus_class
|
10
|
+
has :duration # measures time in minutes
|
11
|
+
has :distance_estimate, :trumps => :duration, :measures => :length
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'data_miner'
|
2
|
+
|
3
|
+
module BrighterPlanet
|
4
|
+
module BusTrip
|
5
|
+
module Data
|
6
|
+
def self.included(base)
|
7
|
+
base.data_miner do
|
8
|
+
schema do
|
9
|
+
string 'bus_class_id'
|
10
|
+
float 'duration'
|
11
|
+
float 'distance_estimate'
|
12
|
+
date 'date'
|
13
|
+
end
|
14
|
+
|
15
|
+
process "pull dependencies" do
|
16
|
+
run_data_miner_on_belongs_to_associations
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'summary_judgement'
|
2
|
+
|
3
|
+
module BrighterPlanet
|
4
|
+
module BusTrip
|
5
|
+
module Summarization
|
6
|
+
def self.included(base)
|
7
|
+
base.extend SummaryJudgement
|
8
|
+
base.summarize do |has|
|
9
|
+
has.adjective lambda { |bus_trip| "#{bus_trip.distance_estimate_in_miles.adaptive_round(1)}-mile" }, :if => :distance_estimate
|
10
|
+
has.adjective lambda { |bus_trip| "#{bus_trip.duration}-minute" }, :if => :duration
|
11
|
+
has.identity 'bus trip'
|
12
|
+
has.verb :take
|
13
|
+
has.aspect :perfect
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/lib/bus_trip.rb
CHANGED
@@ -1,87 +1,30 @@
|
|
1
1
|
module BrighterPlanet
|
2
2
|
module BusTrip
|
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 :alternative_fuels_consumed do # returns litres alternative_fuels
|
28
|
-
quorum 'from distance and alternative fuels intensity', :needs => [:distance, :alternative_fuels_intensity] do |characteristics|
|
29
|
-
#( kilometres ) * ( litres alternative_fuels / kilometre )
|
30
|
-
characteristics[:distance] * characteristics[:alternative_fuels_intensity]
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
committee :distance do # returns kilometres
|
35
|
-
quorum 'from distance estimate', :needs => :distance_estimate do |characteristics|
|
36
|
-
characteristics[:distance_estimate]
|
37
|
-
end
|
38
|
-
|
39
|
-
quorum 'from duration', :needs => [:duration, :speed] do |characteristics|
|
40
|
-
#( minutes ) * ( kph )
|
41
|
-
characteristics[:duration] * characteristics[:speed] / 60
|
42
|
-
end
|
43
|
-
|
44
|
-
quorum 'from bus class', :needs => :bus_class do |characteristics|
|
45
|
-
characteristics[:bus_class].distance
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
committee :diesel_intensity do # returns litres diesel / vehicle kilometre
|
50
|
-
quorum 'from bus class', :needs => :bus_class do |characteristics|
|
51
|
-
characteristics[:bus_class].diesel_intensity
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
committee :gasoline_intensity do # returns litres gasoline / vehicle kilometre
|
56
|
-
quorum 'from bus class', :needs => :bus_class do |characteristics|
|
57
|
-
characteristics[:bus_class].gasoline_intensity
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
committee :alternative_fuels_intensity do # returns litres alternative_fuels / vehicle kilometre
|
62
|
-
quorum 'from bus class', :needs => :bus_class do |characteristics|
|
63
|
-
characteristics[:bus_class].alternative_fuels_intensity
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
committee :speed do # returns kph
|
68
|
-
quorum 'from bus class', :needs => :bus_class do |characteristics|
|
69
|
-
characteristics[:bus_class].speed
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
|
-
committee :passengers do
|
74
|
-
quorum 'from bus class', :needs => :bus_class do |characteristics|
|
75
|
-
characteristics[:bus_class].passengers
|
76
|
-
end
|
77
|
-
end
|
78
|
-
|
79
|
-
committee :bus_class do
|
80
|
-
quorum 'default' do
|
81
|
-
BusClass.fallback
|
82
|
-
end
|
83
|
-
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 'bus_trip/carbon_model'
|
11
|
+
require 'bus_trip/characterization'
|
12
|
+
require 'bus_trip/data'
|
13
|
+
require 'bus_trip/summarization'
|
14
|
+
|
15
|
+
base.send :include, BrighterPlanet::BusTrip::CarbonModel
|
16
|
+
base.send :include, BrighterPlanet::BusTrip::Characterization
|
17
|
+
base.send :include, BrighterPlanet::BusTrip::Data
|
18
|
+
base.send :include, BrighterPlanet::BusTrip::Summarization
|
19
|
+
end
|
20
|
+
def bus_trip_model
|
21
|
+
if Object.const_defined? 'BusTrip'
|
22
|
+
::BusTrip
|
23
|
+
elsif Object.const_defined? 'BusTripRecord'
|
24
|
+
BusTripRecord
|
25
|
+
else
|
26
|
+
raise 'There is no bus_trip model'
|
84
27
|
end
|
85
28
|
end
|
86
29
|
end
|
87
|
-
end
|
30
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'bus_trip'
|
2
|
+
|
3
|
+
class BusTripRecord < ActiveRecord::Base
|
4
|
+
include Sniff::Emitter
|
5
|
+
include BrighterPlanet::BusTrip
|
6
|
+
belongs_to :bus_class
|
7
|
+
|
8
|
+
conversion_accessor :distance_estimate, :external => :miles, :internal => :kilometres
|
9
|
+
|
10
|
+
falls_back_on
|
11
|
+
|
12
|
+
class << self
|
13
|
+
def research(key)
|
14
|
+
case key
|
15
|
+
when :diesel_emission_factor
|
16
|
+
22.450.pounds_per_gallon.to(:kilograms_per_litre) # CO2 / diesel https://brighterplanet.sifterapp.com/projects/30/issues/454
|
17
|
+
when :gasoline_emission_factor
|
18
|
+
23.681.pounds_per_gallon.to(:kilograms_per_litre) # CO2 / gasoline https://brighterplanet.sifterapp.com/projects/30/issues/454
|
19
|
+
when :alternative_fuels_emission_factor
|
20
|
+
9.742.pounds_per_gallon.to(:kilograms_per_litre) # CO2 / equiv alternative fuels https://brighterplanet.sifterapp.com/projects/30/issues/454
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def emission_date
|
26
|
+
created_at.to_date #FIXME we should add a date characteristic for this emitter
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'sniff/database'
|
2
|
+
|
3
|
+
Sniff::Database.define_schema do
|
4
|
+
create_table "bus_trip_records", :force => true do |t|
|
5
|
+
t.string "name"
|
6
|
+
t.integer "profile_id"
|
7
|
+
t.date "date"
|
8
|
+
t.datetime "created_at"
|
9
|
+
t.datetime "updated_at"
|
10
|
+
t.float "duration"
|
11
|
+
t.float "distance_estimate"
|
12
|
+
t.integer "bus_class_id"
|
13
|
+
end
|
14
|
+
end
|
metadata
CHANGED
@@ -1,49 +1,300 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bus_trip
|
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
14
|
- Seamus Abshere
|
14
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-
|
22
|
+
date: 2010-07-22 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
|
61
|
+
type: :development
|
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
|
76
|
+
- !ruby/object:Gem::Dependency
|
33
77
|
type: :development
|
34
|
-
|
78
|
+
prerelease: false
|
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
|
35
92
|
- !ruby/object:Gem::Dependency
|
36
|
-
|
93
|
+
type: :development
|
37
94
|
prerelease: false
|
38
|
-
|
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
|
45
107
|
type: :development
|
46
|
-
|
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
|
139
|
+
type: :development
|
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: 13
|
148
|
+
segments:
|
149
|
+
- 0
|
150
|
+
- 0
|
151
|
+
- 9
|
152
|
+
version: 0.0.9
|
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: earth
|
190
|
+
version_requirements: &id011 !ruby/object:Gem::Requirement
|
191
|
+
none: false
|
192
|
+
requirements:
|
193
|
+
- - "="
|
194
|
+
- !ruby/object:Gem::Version
|
195
|
+
hash: 17
|
196
|
+
segments:
|
197
|
+
- 0
|
198
|
+
- 0
|
199
|
+
- 7
|
200
|
+
version: 0.0.7
|
201
|
+
requirement: *id011
|
202
|
+
- !ruby/object:Gem::Dependency
|
203
|
+
type: :runtime
|
204
|
+
prerelease: false
|
205
|
+
name: falls_back_on
|
206
|
+
version_requirements: &id012 !ruby/object:Gem::Requirement
|
207
|
+
none: false
|
208
|
+
requirements:
|
209
|
+
- - "="
|
210
|
+
- !ruby/object:Gem::Version
|
211
|
+
hash: 27
|
212
|
+
segments:
|
213
|
+
- 0
|
214
|
+
- 0
|
215
|
+
- 2
|
216
|
+
version: 0.0.2
|
217
|
+
requirement: *id012
|
218
|
+
- !ruby/object:Gem::Dependency
|
219
|
+
type: :runtime
|
220
|
+
prerelease: false
|
221
|
+
name: fast_timestamp
|
222
|
+
version_requirements: &id013 !ruby/object:Gem::Requirement
|
223
|
+
none: false
|
224
|
+
requirements:
|
225
|
+
- - "="
|
226
|
+
- !ruby/object:Gem::Version
|
227
|
+
hash: 23
|
228
|
+
segments:
|
229
|
+
- 0
|
230
|
+
- 0
|
231
|
+
- 4
|
232
|
+
version: 0.0.4
|
233
|
+
requirement: *id013
|
234
|
+
- !ruby/object:Gem::Dependency
|
235
|
+
type: :runtime
|
236
|
+
prerelease: false
|
237
|
+
name: leap
|
238
|
+
version_requirements: &id014 !ruby/object:Gem::Requirement
|
239
|
+
none: false
|
240
|
+
requirements:
|
241
|
+
- - "="
|
242
|
+
- !ruby/object:Gem::Version
|
243
|
+
hash: 13
|
244
|
+
segments:
|
245
|
+
- 0
|
246
|
+
- 4
|
247
|
+
- 1
|
248
|
+
version: 0.4.1
|
249
|
+
requirement: *id014
|
250
|
+
- !ruby/object:Gem::Dependency
|
251
|
+
type: :runtime
|
252
|
+
prerelease: false
|
253
|
+
name: summary_judgement
|
254
|
+
version_requirements: &id015 !ruby/object:Gem::Requirement
|
255
|
+
none: false
|
256
|
+
requirements:
|
257
|
+
- - "="
|
258
|
+
- !ruby/object:Gem::Version
|
259
|
+
hash: 11
|
260
|
+
segments:
|
261
|
+
- 1
|
262
|
+
- 3
|
263
|
+
- 8
|
264
|
+
version: 1.3.8
|
265
|
+
requirement: *id015
|
266
|
+
- !ruby/object:Gem::Dependency
|
267
|
+
type: :runtime
|
268
|
+
prerelease: false
|
269
|
+
name: timeframe
|
270
|
+
version_requirements: &id016 !ruby/object:Gem::Requirement
|
271
|
+
none: false
|
272
|
+
requirements:
|
273
|
+
- - "="
|
274
|
+
- !ruby/object:Gem::Version
|
275
|
+
hash: 29
|
276
|
+
segments:
|
277
|
+
- 0
|
278
|
+
- 0
|
279
|
+
- 1
|
280
|
+
version: 0.0.1
|
281
|
+
requirement: *id016
|
282
|
+
- !ruby/object:Gem::Dependency
|
283
|
+
type: :runtime
|
284
|
+
prerelease: false
|
285
|
+
name: weighted_average
|
286
|
+
version_requirements: &id017 !ruby/object:Gem::Requirement
|
287
|
+
none: false
|
288
|
+
requirements:
|
289
|
+
- - "="
|
290
|
+
- !ruby/object:Gem::Version
|
291
|
+
hash: 23
|
292
|
+
segments:
|
293
|
+
- 0
|
294
|
+
- 0
|
295
|
+
- 4
|
296
|
+
version: 0.0.4
|
297
|
+
requirement: *id017
|
47
298
|
description: A software model in Ruby for the greenhouse gas emissions of a bus trip
|
48
299
|
email: andy@rossmeissl.net
|
49
300
|
executables: []
|
@@ -54,16 +305,18 @@ extra_rdoc_files:
|
|
54
305
|
- LICENSE
|
55
306
|
- README.rdoc
|
56
307
|
files:
|
57
|
-
- .document
|
58
|
-
- .gitignore
|
59
308
|
- LICENSE
|
60
309
|
- README.rdoc
|
61
|
-
- Rakefile
|
62
|
-
- VERSION
|
63
|
-
- bus_trip.gemspec
|
64
310
|
- lib/bus_trip.rb
|
65
|
-
-
|
66
|
-
-
|
311
|
+
- lib/bus_trip/carbon_model.rb
|
312
|
+
- lib/bus_trip/characterization.rb
|
313
|
+
- lib/bus_trip/data.rb
|
314
|
+
- lib/bus_trip/summarization.rb
|
315
|
+
- lib/test_support/bus_trip_record.rb
|
316
|
+
- lib/test_support/db/schema.rb
|
317
|
+
- features/support/env.rb
|
318
|
+
- features/bus_trip_committees.feature
|
319
|
+
- features/bus_trip_emissions.feature
|
67
320
|
has_rdoc: true
|
68
321
|
homepage: http://github.com/brighterplanet/bus_trip
|
69
322
|
licenses: []
|
@@ -74,26 +327,33 @@ rdoc_options:
|
|
74
327
|
require_paths:
|
75
328
|
- lib
|
76
329
|
required_ruby_version: !ruby/object:Gem::Requirement
|
330
|
+
none: false
|
77
331
|
requirements:
|
78
332
|
- - ">="
|
79
333
|
- !ruby/object:Gem::Version
|
334
|
+
hash: 3
|
80
335
|
segments:
|
81
336
|
- 0
|
82
337
|
version: "0"
|
83
338
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
339
|
+
none: false
|
84
340
|
requirements:
|
85
341
|
- - ">="
|
86
342
|
- !ruby/object:Gem::Version
|
343
|
+
hash: 3
|
87
344
|
segments:
|
88
345
|
- 0
|
89
346
|
version: "0"
|
90
347
|
requirements: []
|
91
348
|
|
92
349
|
rubyforge_project:
|
93
|
-
rubygems_version: 1.3.
|
350
|
+
rubygems_version: 1.3.7
|
94
351
|
signing_key:
|
95
352
|
specification_version: 3
|
96
353
|
summary: A carbon model
|
97
354
|
test_files:
|
98
|
-
-
|
99
|
-
-
|
355
|
+
- features/support/env.rb
|
356
|
+
- features/bus_trip_committees.feature
|
357
|
+
- features/bus_trip_emissions.feature
|
358
|
+
- lib/test_support/bus_trip_record.rb
|
359
|
+
- lib/test_support/db/schema.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 = "bus_trip"
|
8
|
-
gem.summary = %Q{A carbon model}
|
9
|
-
gem.description = %Q{A software model in Ruby for the greenhouse gas emissions of a bus trip}
|
10
|
-
gem.email = "andy@rossmeissl.net"
|
11
|
-
gem.homepage = "http://github.com/brighterplanet/bus_trip"
|
12
|
-
gem.authors = ["Andy Rossmeissl", "Seamus Abshere", "Ian Hough", "Matt Kling"]
|
13
|
-
gem.add_development_dependency "thoughtbot-shoulda", ">= 0"
|
14
|
-
gem.add_development_dependency "leap"
|
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 = "bus_trip #{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/bus_trip.gemspec
DELETED
@@ -1,57 +0,0 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in rakefile, and run the gemspec command
|
4
|
-
# -*- encoding: utf-8 -*-
|
5
|
-
|
6
|
-
Gem::Specification.new do |s|
|
7
|
-
s.name = %q{bus_trip}
|
8
|
-
s.version = "0.0.1"
|
9
|
-
|
10
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = ["Andy Rossmeissl", "Seamus Abshere", "Ian Hough", "Matt Kling"]
|
12
|
-
s.date = %q{2010-06-10}
|
13
|
-
s.description = %q{A software model in Ruby for the greenhouse gas emissions of a bus trip}
|
14
|
-
s.email = %q{andy@rossmeissl.net}
|
15
|
-
s.extra_rdoc_files = [
|
16
|
-
"LICENSE",
|
17
|
-
"README.rdoc"
|
18
|
-
]
|
19
|
-
s.files = [
|
20
|
-
".document",
|
21
|
-
".gitignore",
|
22
|
-
"LICENSE",
|
23
|
-
"README.rdoc",
|
24
|
-
"Rakefile",
|
25
|
-
"VERSION",
|
26
|
-
"bus_trip.gemspec",
|
27
|
-
"lib/bus_trip.rb",
|
28
|
-
"test/helper.rb",
|
29
|
-
"test/test_bus_trip.rb"
|
30
|
-
]
|
31
|
-
s.homepage = %q{http://github.com/brighterplanet/bus_trip}
|
32
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
33
|
-
s.require_paths = ["lib"]
|
34
|
-
s.rubygems_version = %q{1.3.6}
|
35
|
-
s.summary = %q{A carbon model}
|
36
|
-
s.test_files = [
|
37
|
-
"test/helper.rb",
|
38
|
-
"test/test_bus_trip.rb"
|
39
|
-
]
|
40
|
-
|
41
|
-
if s.respond_to? :specification_version then
|
42
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
43
|
-
s.specification_version = 3
|
44
|
-
|
45
|
-
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
46
|
-
s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
47
|
-
s.add_development_dependency(%q<leap>, [">= 0"])
|
48
|
-
else
|
49
|
-
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
50
|
-
s.add_dependency(%q<leap>, [">= 0"])
|
51
|
-
end
|
52
|
-
else
|
53
|
-
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
54
|
-
s.add_dependency(%q<leap>, [">= 0"])
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
data/test/helper.rb
DELETED