#SMC-Connect
This is a Rails app built by Code for America's 2013 San Mateo County fellowship team. We have acquired the Peninsula Library System's Community Information Program — a dataset of community resources in San Mateo County — which we are making available via an API.
This app serves as an example of what can be built with that data, and is consuming our API. It is deployed at http://smc-connect.org. The goal is to build an interface that makes it easy to find available services in San Mateo County, and to provide as much pertinent information as possible, such as travel directions, hours of operation, other services residents in need might be eligible for, etc.
We gladly welcome contributions. Below you will find instructions for installing the project and contributing.
Please note that the instructions below have only been tested on OS X. If you are running another operating system and run into any issues, feel free to update this README, or open an issue if you are unable to resolve installation issues.
###Prerequisites
OS X: Set up a dev environment on OS X with Homebrew, Git, RVM, Ruby, and Rails
Windows: Try RailsInstaller, along with some of these tutorials if you get stuck.
Linux:
- RVM is great, and this project uses it, but in any case, try to use the same ruby version as listed in the .ruby-version file. If you install it, it'll take care of making sure you have the right ruby, and let you focus on contributing to the app.
- You need a Javascript runtime. We recommend Node.JS (if you have a good reason not to use it, there are other options). On Ubuntu, it's as simple as
sudo apt-get install nodejs
. On others, check the official instructions.
Installation instructions for Mac, Linux, and Windows
git clone https://github.com/codeforamerica/human_services_finder.git
cd human_services_finder
bundle
Start the app locally using Unicorn:
unicorn
Ohana SMC should now be running at http://localhost:8080
To test locally, you can run tests with this simple command:
rspec
To configure rspec output formatting (for example, to provide command line output in color), use the command from the command line pico ./.rspec
while in the project root directory (or pico ~/.rspec
to provide rspec configuration globally for all projects on your machine). Settings such as color highlighting and the output style can be set with:
--color
--format documentation
Options for the format configuration are progress
(default - shows a series of dots), documentation
, html
, or textmate
. More information can be found on the rspec website.
For faster tests:
gem install zeus
zeus start #in a separate Terminal window or tab
zeus rspec spec
To see the actual tests, browse through the spec directory.
- Ruby version 2.0.0
- Rails version 3.2.13
- Template Engines: ERB and HAML
- Testing Frameworks: RSpec, Capybara and PhantomJS (via Poltergeist gem), JasmineJS installed but not currently used (via Teaspoon gem)
In the spirit of open source software, everyone is encouraged to help improve this project.
Here are some ways you can contribute:
- by using alpha, beta, and prerelease versions
- by reporting bugs
- by suggesting new features
- by suggesting labels for our issues
- by writing or editing documentation
- by writing specifications
- by writing code (no patch is too small: fix typos, add comments, clean up inconsistent whitespace)
- by refactoring code
- by closing issues
- by reviewing patches
- financially
We use the GitHub issue tracker to track bugs and features. Before submitting a bug report or feature request, check to make sure it hasn't already been submitted. When submitting a bug report, please include a Gist that includes a stack trace and any details that may be necessary to reproduce the bug, including your gem version, Ruby version, and operating system. Ideally, a bug report should include a pull request with failing specs.
- Fork the repository.
- Create a topic branch.
- Add specs for your unimplemented feature or bug fix.
- Run
rspec
. If your specs pass, return to step 3. In the spirit of Test-Driven Development, you want to write a failing test first, then implement the feature or bug fix to make the test pass. - Implement your feature or bug fix.
- Run
rspec
. If your specs fail, return to step 5. - Run
metric_fu -r
. This will go through all the files in the app and analyze the code quality and check for things like trailing whitespaces and hard tabs. When it's done, it will open a page in your browser with the results. Click onCane
andRails Best Practices
to check for files containing trailing whitespaces and hard tabs. If you use Sublime Text 2, you can use the TrailingSpaces plugin to highlight the trailing whitespaces and delete them. If the report complains about "hard tabs" in a file, change your indentation tospaces
by clicking onTabs: 2
at the bottom of your Sublime Text 2 window, then selectingConvert Indentation to Spaces
. As for the code itself, we try to follow GitHub's Ruby styleguide. - Add, commit, and push your changes.
- Submit a pull request.
Copyright (c) 2013 Code for America. See LICENSE for details.