Skip to content

montrealrb/Montreal.rb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Montreal.rb website

Build Status Code Climate Stories in Priority

Description

This is the Montreal.rb organization's website. It is still in development stage so you are welcome to contribute. You can join our Slack Team if you have any question, need some help to get started or just hang around with friendly people.

Want to contribute? First thing to look at are the Issues with the priority label. You can optionnally use Waffle.io to see the development pipeline used to manage the project.

Throughput Graph

Requirements

Runtime

  • ruby 2.5.0
  • Postgresql 9.3+

Development Setup

Fork the repository and clone it to your machine. Then change directory to Montreal.rb

$ git clone <your_fork> && cd Montreal.rb

Ruby & Bundler

You should have Ruby version 2.5.0 installed using your prefered Ruby version management tool (or by globally updating your system Ruby)

Most Popular Ruby Version Managers

You should also have bundler (minimum v1.10) to help with tracking and installing the exact gems and versions that are needed.

Database

For development, sqlite3 will be used.

Rails

You should check out Ruby on Rails' guides if you are not familiar with the framework : http://guides.rubyonrails.org/

Setup your Project

$ bin/setup

Once successfully completed, this setup script will:

  • install bundler for managing your gem dependencies
  • install your project's required gems
  • create and setup your database
  • cleanup logs and temporary files

Set environment variables

Omniauth is used to allow users to log in to the site using GitHub or Twitter accounts. To use the GitHub API or Twitter API, you must set environment variables for the GitHub 'key' and 'secret.' For the Twitter API you will need to set up TWITTER_CONSUMER_KEY and TWITTER_CONSUMER_SECRET environment variables.

You can first obtain this key/secret through your GitHub account.

For image hosting Cloudinary is used. This service gives us the ability to host images with a heroku app. Sign up for a free coludinary account.

To tweet automatically when content is published, you can register an app on Twitter and set the keys to your environment variables. If you choose not to, don't set the variables and the app will simply skip the tweeting feature.

Now you need to set the environment variables on your server. The procedure will depend on your system.

For development, copy .env.sample file to .env and fill appropriately the variables settings.

If using Heroku, you can set the environment variables like this:

heroku config:add GITHUB_KEY=your_key GITHUB_SECRET=your_secret \
  CLOUDINARY_URL=cloudinary://your_key:your_secret \
  --app Montreal.rb

Start your Web Server

You should be ready to start your webserver using:

$ bin/rails server

By default, your application is accessible at http://localhost:3000 in your browser.

Code Style

Rubocop is used to anaylize and enforce the code style accross all the codebase. Before opening a new pull request run:

$ rubocop -a

This command will automatically fix the majority of the code style issues and you'll make code-climate happy.

Testing

RSpec is used to test the application. You can run all the tests using

$ bin/rspec

or you can run a specific test file (example 1), or a single test (example 2, 17 is the line number of your test)

$ bin/rspec spec/path/to/your/file.rb    # example 1

$ bin/rspec spec/path/to/your/file.rb:17 # example 2

You can also use guard to test automatically when you save a file

$ bundle exec guard

PROTIP: install ctags and guard will automatically generate an index (or tag) file of language objects found in source files that allows these items to be quickly and easily located by a text editor.

  • ex: macos brew install ctags && sudo mv /usr/bin/ctags /usr/bin/ctags.bak
  • ex: ubuntu sudo apt-get install exuberant-ctags

Deploy

This application is automatically deployed to heroku after a successful Travis CI build of the master branch.

URLs

Bug Tracker

If you find any bug, please open an issue in the project's Github repository (https://github.com/montrealrb/Montreal.rb/issues)

Contributing

Please see CONTRIBUTING.md.

Everyone interacting in Montrealrb.com and its sub-projects' codebases, issue trackers, chat rooms, and mailing lists is expected to follow our code of conduct.

License

montrealrb.com is released under the MIT License.