#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 postgresql
or use Postgres.app- A general
postgres
database 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 install
to install dependencies- Create a file
config/secrets.yml
and 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:create
to create the databases. -
rake db:migrate
to run migrations (creating the tables and their associations). -
rails server
and go tolocalhost:3000
-
Run
rspec
in 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.