{"id":24698560,"url":"https://github.com/faradayio/flight","last_synced_at":"2026-02-06T04:31:59.419Z","repository":{"id":939773,"uuid":"714581","full_name":"faradayio/flight","owner":"faradayio","description":"A carbon model","archived":false,"fork":false,"pushed_at":"2015-06-25T10:00:45.000Z","size":9516,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-09T06:32:53.733Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/faradayio.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-06-10T22:04:11.000Z","updated_at":"2023-04-21T05:53:42.000Z","dependencies_parsed_at":"2022-08-16T11:31:16.812Z","dependency_job_id":null,"html_url":"https://github.com/faradayio/flight","commit_stats":null,"previous_names":["brighterplanet/flight"],"tags_count":32,"template":false,"template_full_name":null,"purl":"pkg:github/faradayio/flight","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faradayio%2Fflight","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faradayio%2Fflight/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faradayio%2Fflight/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faradayio%2Fflight/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/faradayio","download_url":"https://codeload.github.com/faradayio/flight/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faradayio%2Fflight/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29150636,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T02:39:25.012Z","status":"ssl_error","status_checked_at":"2026-02-06T02:37:22.784Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-27T04:29:19.339Z","updated_at":"2026-02-06T04:31:59.396Z","avatar_url":"https://github.com/faradayio.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flight\n\nThe flight gem is used by Brighter Planet's CM1 web service to define a mathematical impacts model for a flight on any airline or aircraft. In addition, this gem defines how the model's calculation is displayed in a human readable format.\n\nContributions are welcome and encouraged, as we believe that help from the scientific and developer communities will help us provide correct and transparent models of greenhouse gas-emitting activities. See the section on the Collaboration Cycle below.\n\n[![Build Status](https://secure.travis-ci.org/brighterplanet/flight.png)](http://travis-ci.org/brighterplanet/flight)\n\n## Usage\n\nThe flight gem defines a module, BrighterPlanet::Flight that should be included into an ActiveRecord model. Calling #impact on an instance of the model will determine the amount of impacts (CO2e) generated by the activity.\n\n\n    class FlightRecord \u003c ActiveRecord::Base\n      include BrighterPlanet::Flight\n      ...\n    end\n\n    f = FlightRecord.new :origin_airport =\u003e { :iata_code =\u003e 'DTW'}, :destination_airport =\u003e { :iata_code =\u003e 'SFO' }\n    f.impact.carbon\n    # =\u003e 2472\n\n## Getting Ready for Development\nFlight uses bundler to manage dependencies. To prepare your environment, perform the following:\n    git clone git://github.com/brighterplanet/flight.git\n    cd flight\n    gem install bundler     (note: prior to bundler 1.0 release, add --pre)\n    bundle install\n\n### A Note to RVM Users (and Non-Users)\n\n[RVM](http://rvm.beginrescueend.com/) is a great tool for testing and development as it can create independent gem environments.\n\nIncluded in the repository is a .rvmrc that will automatically create a ruby 1.8.7 gemset for you named flight. If you already have a gemset with the same name, simply replace the \\`pwd\\` within the .rvmrc to whatever name you want.\n\n## Testing\n\nOur goal is to have sufficient testing coverage for our impacts models. We have chosen to write our tests using [cucumber](http://cukes.info) as the table-formatted testing fits well with our calculations tests and the plain English stories lower the barrier to entry for programmers of all skill levels.\n\nThere are two main features:\n* flight_impacts.feature, which tests impact values for various inputs\n* flight_committees.feature, which tests sub-calculations used within the model\n\nTo run all tests: `rake` or `cucumber`\n\nTo run individual tests: `cucumber features/name_of_feature.feature`\n\nTo run a specific scenario: `cucumber features/name_of_feature.feature:line_number_of_scenario`\n\n### Sniff\n\nThe sniff gem is used to provide a testing environment that loads dependent data models (defined in the earth gem), a database, and testing fixtures.\n\nSee: [https://github.com/brighterplanet/sniff](https://github.com/brighterplanet/sniff)\n\n### Earth\n\nThe earth gem contains the model definitions for dependent data models. For instance, this is zip code data or fuel prices used in the impacts calculations. Earth will look for any test fixtures defined in lib/test_support/db/fixtures. These sample records are in csv format and are imported into the testing database.\n\n## Implementation\n\nSee the README for the sniff gem: [https://github.com/brighterplanet/sniff/blob/master/README.markdown](https://github.com/brighterplanet/sniff/blob/master/README.markdown)\n\n## Collaboration cycle \nBrighter Planet vigorously encourages collaborative improvement of its emitter libraries. Collaboration requires a (free) GitHub account.\n\n### You\n1.  Fork the emitter repository on GitHub.\n1.  Write a test proving the existing implementation's inadequacy. Ensure that the test fails. Commit the test.\n1.  Improve the code until your new test passes and commit your changes.\n1.  Push your changes to your GitHub fork.\n1.  Submit a pull request to brighterplanet.\n\n### Brighter Planet\n1.  Receive a pull request.\n1.  Pull changes from forked repository.\n1.  Ensure tests pass.\n1.  Review changes for scientific accuracy.\n1.  Merge changes to master repository and publish.\n1.  Direct production environment to use new emitter version.\n\n## Copyright\n\nCopyright © 2010 Brighter Planet. See LICENSE for details. Contact Brighter Planet for dual-license arrangements.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffaradayio%2Fflight","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffaradayio%2Fflight","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffaradayio%2Fflight/lists"}