Skip to content

aspiers/ET-reporting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The ET Reporting Project

For the background behind this repository, see the #hack4good 0.6 project page, and the slide-deck presented at the end of the event.

This repository contains a Rails app that allows collection of carbon emission data from corporations and carbon analysts (volunteers who trawl company websites and extract data about carbon emissions etc.)

It will eventually also support generation of reports on the collected data.

Running the application

Install Ruby

The app is tested on Ruby 2.1.2 but you may have luck with older versions. It is suspected that anything older than 2.0 will not work.

On Linux or MacOS X, you can use RVM, a ruby version manager:

rvm install 2.1.2

Clone the repository to your machine

First, fork the repository. Then clone from your fork, e.g.:

git clone git@github.com:my-github-username/ET-reporting.git

Install all the gems!

With Ruby 2.0, bundler should automatically be available.

bundle install --without production

Use the --without production flag to avoid installing the pg gem for PostgreSQL, which you don't need in development anyway!

Setup the database

bundle exec rake db:create
bundle exec rake db:migrate

Load the reporting survey

bundle exec rake surveyor FILE=surveys/et_reporting_survey.rb

If you update surveys/et_reporting_survey.rb and re-run the above rake surveyor command, then http://localhost:3000/surveys will list a new version of the survey. It keeps old versions and any corresponding answers.

Run the app!

bundle exec rails server

and now you should be able to visit: http://localhost:3000/

Development links

Technical implementation details

surveyor gem

We use the surveyor gem to implement the survey. The questions are specified in a single file which uses a simple Ruby-based DSL. The gem's documentation explains this DSL in more detail:

This should allow non-coders to update the survey in the future without the expense of implementing sophisticated survey editing functionality.

User management / authentication / invitation

We use the devise and devise_invitable gems.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published