Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Don't update Gemfile.lock when developing with local gems

  • Loading branch information...
commit 19b3c8b1a4f6ab32b74a20f760d01abea309e4d5 1 parent 5cfccfb
@ndbroadbent authored
Showing with 11 additions and 1 deletion.
  1. +3 −1 README.md
  2. +8 −0 lib/bundler/local_development.rb
View
4 README.md
@@ -28,7 +28,7 @@ And then execute:
You can provide regular expressions or strings to match gem names.
* Set the `$DEV_GEMS` environment variable to add extra gems to this list (comma separated list of gem names).
-If the `$GEM_DEV` environment variable is unset, this gem will do nothing.
+If the `$GEM_DEV` environment variable is unset, this gem will have no effect.
If the `$GEM_DEV` environment variable is set:
@@ -38,6 +38,8 @@ path specified by `$GEM_DEV_DIR`. (The default search path is `$HOME/code/gems`,
* If a local copy of the gem is found, it will add the `:path => <path>`
option to the `gem` command.
+* `Gemfile.lock` will **NOT** be updated if this gem is activated.
+
## Shell shortcut
View
8 lib/bundler/local_development.rb
@@ -33,4 +33,12 @@ def gem_with_development(name, *args)
end
alias :gem :gem_with_development
end
+
+ class Definition
+ # Don't update Gemfile.lock when developing with local gems
+ alias :lock_original :lock
+ def lock(*args)
+ lock_original(*args) unless ENV['GEM_DEV']
+ end
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.