Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit b1cf8d96cdab79db3cbacc6fa6240c32429af68a 1 parent cb09807
Joe Ferris jferris authored
Showing with 12 additions and 2 deletions.
  1. +12 −0 best-practices/README.md
  2. +0 −2  style/README.md
12 best-practices/README.md
View
@@ -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.
+
+Bundler
+-------
+
+* Use the project's Gemfile to specify the
+ [Ruby version](http://gembundler.com/man/gemfile.5.html#RUBY-ruby-)
+* 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.
Postgres
--------
2  style/README.md
View
@@ -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](http://gembundler.com/man/gemfile.5.html#RUBY-ruby-).
* Prefer `detect` over `find`.
* Prefer `inject` over `reduce`.
* Prefer `map` over `collect`.
Please sign in to comment.
Something went wrong with that request. Please try again.