Browse files

Document conventions for Gemfile and Gemfile.lock

* Create Bundler best practices section
* Move Ruby version convention from style to Bundler best practices
* Include advice about exact, pessimistic, and versionless requirements
  • Loading branch information...
1 parent cb09807 commit b1cf8d96cdab79db3cbacc6fa6240c32429af68a @jferris jferris committed Nov 8, 2012
Showing with 12 additions and 2 deletions.
  1. +12 −0 best-practices/
  2. +0 −2 style/
@@ -41,6 +41,18 @@ Rails
change can be solved with another migration.
* Validate the associated `belongs_to` object (`user`), not the database
column (`user_id`).
+* Avoid exact version numbers in `Gemfile` except for non-framework gems.
+* Use the project's Gemfile to specify the
+ [Ruby version](
+* Use an exact version in the `Gemfile` for fragile gems, such as Rails.
+* Use a pessimistic version in the 'Gemfile' for gems that follow semantic
+ versioning, such as rspec, factory_girl, and capybara.
+* Use versionless `Gemfile` declarations for gems that are safe to update
+ often, such as pg, thin, and debugger.
@@ -82,8 +82,6 @@ Ruby
* Avoid conditional modifiers (lines that end with conditionals).
* Avoid ternary operators (`boolean ? true : false`). Use multi-line `if`
instead to emphasize code branches.
-* Define the project's [Ruby version in the
- Gemfile](
* Prefer `detect` over `find`.
* Prefer `inject` over `reduce`.
* Prefer `map` over `collect`.

0 comments on commit b1cf8d9

Please sign in to comment.