-
-
Notifications
You must be signed in to change notification settings - Fork 259
How to add features
Please join the google group and send a quick note introducing yourself.
- Get the repo running locally (via a fork)
- Check out the issues on Pivotal Tracker
- Write some pretty code
- Merge with upstream, push to your remote (fork), then submit a pull request
- Pat yourself on the back!
###Detailed Setup:
-
If you haven’t attended a RailsBridge workshop or otherwise installed Rails and all the related bits, refer to Railsbridge Installfest to verify that you have all the correct tools installed.
-
Fork this repo (see fork button at top right of this page)
-
From your forked repo, find the link to clone it to your local machine:
- GitHub provides three links for forking a repo: https, ssh, and git read-only. The https link is generally easier to use.
- Copy the provided link, for instance: https://github.com/yourname/bridge_troll.git
- Open a shell window on your computer, and clone the repo by pasting in the link
git clone https://github.com/yourname/bridge_troll
- This creates a new directory on your machine, with the entire git repo copied (cloned) to your local machine
-
Change into the newly created directory:
cd bridge_troll
-
NOTE: Changing into this directory sets rvm to use a ruby version for this project. If you have other shell windows open, check the ruby version, or either close them and open new windows, or run the same command in the windows:
cd bridge_troll
-
NOTE: Changing into this directory sets rvm to use a ruby version for this project. If you have other shell windows open, check the ruby version, or either close them and open new windows, or run the same command in the windows:
-
To install all the gems used by the project (see gems explained), run
bundle install
If you get an error and don't have a bundler installed run:gem install bundler
-
To create and migrate the database, run
rake db:create:all
rake db:test:prepare
-
rake db:migrate
See Common Errors if running rake gives errors.
-
You will need to install phantomjs for tests to run successfully.
- On OSX with Homebrew:
brew update
brew install phantomjs
- On OSX with Homebrew:
-
To start the web app
-
rails server
orrails s
- Go to http://localhost:3000/ in your browser and play with the app.
-
-
To start the rails console
-
rails console
orrails c
- Enter ruby commands in the rails console to find out how objects behave. For example
User.count
User.all
- When a new user is created, if email confirmation isn’t working yet, enter the following in the rails console:
User.last.confirm!
-
###Using Git & GitHub
- Steps to Merge and Make Pull Request --- https://help.github.com/articles/fork-a-repo
git checkout -b my_branch
- To keep track of the original repo, you need to add another remote named upstream:
git remote add upstream https://github.com/railsbridge/bridge_troll.git
- Make some changes to file to add the features you want.
- Test the features you added or changed.
- Pull in changes not present in your local repository, without modifying your files
git fetch upstream
- Merge the changes to your working files.
git merge upstream/master
- Test again.
- Add the files to git. Tell git that you changed these and you want to get ready to commit those changes
git add .
- Commit the changes locally
git commit -m “a brief message (~80 characters) describing your commit”
- fetch/merge upstream
git push origin my_branch
- Send a Pull request
- Press “Pull Request” button, enter title and description on the popup window.
- Wait for comments, discussion etc.
- Clean up/Delete your fork
###Errors
If you run into any issues, take a look around the interwebs (you’d be surprised how much time professional software developers spending googling questions). If you don’t find an answer that works for you, you can ask a question yourself on StackOverflow, and then if that gets you nowhere, feel free to ask the aforementioned Google Group.
- rake [anything]: try prepending rake tasks with “bundle exec”
- in other words, instead of running
rake db:create
, runbundle exec rake db:create
- to learn more about why, see: https://rvm.io/integration/bundler/
- in other words, instead of running
Then, have a look at our feature backlog. Pick an issue to work on, fork the project, and then make your changes, merge upstream, and send a pull request.
You'll need rvm. We're using Ruby 2.3.1 and Rails 5.0.2, and there's an .rvmrc
file which should help make sure you are using the right Ruby version.
Features may be tested using RSpec.
- See RSpec documentation.
- See the
spec/
directory for examples.