#Somo
Development is typically done on a local machine with local instances of various services (data stores, email sender, etc).
We are currently running on Ruby 2.3, Rails 4, and PostgreSQL 9.4. Homebrew is recommended for installing dependencies.
brew install postgresqlor use Postgres.app- A general
postgresdatabase user is recommended; CREATEDB and SUPERUSER privileges are required:
$ createuser -s -d postgres # createuser is a command line tool installed with postgres
- Start/manage the postgres service via:
$ pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
$ pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log status
There are some settings to make it start by default as well.
\q + ENTER in terminal to quit interactive terminal
- Install and manage Ruby versions with rvm. Make sure to install the correct Ruby version, which is specified in the [Gemfile]
bundle installto install dependencies- Create a file
config/secrets.ymland add the following keys:
development:
secret_key_base: <your_secret_key>
twilio_account_id: <twilio_account_id>
twilio_auth_token: <twilio_auth_token>
somo_phone_number: <somo_phone_number>
Use rake secret to generate secret keys. Access the docs here for API dev and test keys.
-
rake db:createto create the databases. -
rake db:migrateto run migrations (creating the tables and their associations). -
rails serverand go tolocalhost:3000 -
Run
rspecin the root directory to run the specs.
- Strings
- Use single quotes instead of double quotes.
- Hashes
- Prefer
:over=>.
- Indentation
- Use 2 spaces.
- There should be no use of tabs.
- Spacing
- There should be no trailing whitespace.
- There should be no empty new lines at the end of a file.
- Line length
- The maximum number of characters per line should be 100.