jmuheim/base

View on GitHub
README.rdoc

Summary

Maintainability
Test Coverage
== Base Project

This is a basic Rails project with everything configured the way I want. To fork it, create a new repository on GitHub, clone it to your computer, and execute <code>git remote add upstream git@github.com:jmuheim/base.git</code> to add Base's original repository as upstream. Now you can always merge Base's code into your project using <code>git pull upstream master</code>.

= Additional TODOs in your fork

- Rename <code>README_example.md</code> to <code>README.md</code> and commit. Then open <code>README.md</code> and...
  - Replace <code>TITLE</code> with a meaningful title, e.g. <code>Pretty Calc - A pretty calculator</code> (be sure you search case sensitive!)
  - Replace all occurrences of <code>GITHUB</code> to the name of the GitHub account where your repository lies, e.g. <code>jmuheim</code>
  - Replace all occurrences of <code>PROJECT</code> to your project's downcased name, e.g. <code>pretty_calc</code> for <code>Pretty Calc</code>
- Change the content of <code>.ruby-gemset</code> file to the name of your fork's repository
- Execute the following:
  - <code>$ rvm use .</code> (activates the RVM gemset)
  - <code>$ bundle</code> (installs the gems) (if bundler isn't installed already, first execute <code>$ gem install bundler</code>)
- Replace all occurrences of <code>Base::Application</code> with <code>PROJECT::Application</code> (e.g. <code>PrettyCalc::Application</code>), every occurrence of <code>module Base</code> with <code>module PROJECT</code> (e.g. <code>module PrettyCalc</code>), and every occurrence of <code>Base::</code> with <code>PROJECT::</code> (e.g. <code>PrettyCalc::</code>)
- `$ cp config/secrets.example.yml config/secrets.yml`, then edit `secrets.yml` contents appropriately
- Change the value of <code>session_store</code> in <code>config/initializers/session_store.rb</code> to <code>_PROJECT_session</code> (while <code>PROJECT</code> is your project's downcased and underscored name)
- Change the value of <code>config.mailer_sender</code> in <code>config/initializers/devise.rb</code> to some useful email address (e.g. <code>info@PROJECT.com</code>)
- We want to use ports different to the default ports, so they don't clash with other Rails apps:
  - Change the Rack Livereload port in <code>Guardfile</code> and <code>config/development.rb</code> to e.g. <code>35730</code>
  - Change the value of <code>port</code> in <code>config/puma.rb</code> and the value of <code>config.action_mailer.default_url_options</code> in <code>config/development.rb</code> to e.g. <code>3050</code>
    - Note: in your browser, you will have to connect to your app using this port, e.g. <code>localhost:3050</code>!
- Create an <code>.rspec</code> file with your specific RSpec config, e.g. <code>--color</code>
- Execute the following:
  - <code>$ rails db:setup</code> (sets up the database with seed data))
  - <code>$ rails db:test:prepare</code> (prepare test database)

= Install needed software

- Pandoc `>= 1.16` and `< 2.0`
  - Homebrew doesn't offer Pandoc `< 2.0` anymore, but we can sneak it into the current formula like so:
    - `$ cd "$(brew --repo homebrew/core)"`
    - In `Formula/pandoc.rb`, replace the contents of `url` with `https://hackage.haskell.org/package/pandoc-1.19.2.4/pandoc-1.19.2.4.tar.gz` and the contents of `sha256` with `bbe08c1f7fcfea98b899f9956c04159d493a26f65d3350aa6579aa5b93203556`
  - Now you can install Pandoc: `$ brew install pandoc`
- MiniMagick
  - `$ brew install imagemagick`

= Run specs

Last but not least: run <code>$ rails spec</code> to see if everything's working, then commit all your changes.

= Complement README.md

 As there are now both a <code>README.md</code> and <code>README.rdoc</code> file, GitHub will show the <code>README.md</code> when browsing the repository. So please complement <code>README.md</code> with your project specific details (and leave <code>README.rdoc</code> in place).