What happens when modifying Gemfile.lock directly?
Posted
by
Mik378
on Stack Overflow
See other posts from Stack Overflow
or by Mik378
Published on 2012-06-21T09:01:11Z
Indexed on
2012/06/21
9:16 UTC
Read the original article
Hit count: 176
Since the second time of bundle install
execution, dependencies are loaded from Gemfile.lock when Gemfile isn't changed.
But I wonder how detection of changes is made between those two files.
For instance, if I'm adding a new dependency directly into Gemfile.lock without adding it into Gemfile (as opposed to the best practice since Gemfile.lock is auto-generated from Gemfile), would a bundle install
consider Gemfile as changed ?
Indeed, does bundle install
process compares the whole Gemfile and Gemfile.lock trees in order to detect changes?
If it is, even if I'm adding a dependency directly to Gemfile.lock, Gemfile would be detected as changed (since different) and would re-erase Gemfile.lock (so losing the added dependency...)
What is the process of bundle install
since the launch for the second time ?
To be more clear, my question is:
Are changes based only from Gemfile ? That means bundler would keep a Gemfile snapshot of every bundle install
execution number N and merely compares it to the bundle install
execution N+1 ?
Or none snapshot are created in bundler memory and bundler makes a comparison with Gemfile.lock each time to detect if Gemfile must be considered as changed.
© Stack Overflow or respective owner