Saturday, December 17, 2011

Re: [Rails] Re: How does bundler know whether Gemfile has changed?

On 17 December 2011 17:41, Frederick Cheung <frederick.cheung@gmail.com> wrote:
>
>
> On Dec 17, 4:50 pm, Colin Law <clan...@googlemail.com> wrote:
>> I am trying to understand how bundler works.  Looking at the manual [1] it says
>> "If a Gemfile.lock does exist, and you have not updated your
>> Gemfile(5), bundler will fetch all remote sources, but use the
>> dependencies specified in the Gemfile.lock instead of resolving
>> dependencies."
>> The question is how does it know whether Gemfile has been updated?  I
>> expected to find something in Gemfile.lock but can't see it.
>>
> Does it use the list of dependencies at the bottom of gemfile.lock?

I don't there is enough information there. Looking at the section
there on Conservative Updating it would appear that it has to know the
previous version specification for every gem specified, in order to
know whether it has changed. Thinking about it further I don't
think the information in the link is fully correct. When it talks
about whether Gemfile has changed, I think what it means is that it
looks at the spec in Gemfile for each gem and compares it with the
spec in gemfile.lock, if they are *incompatible* then that is what it
means by "changed". So if for example one were to change the spec of
a gem from > 2.0.0 to >1.0.0 that would not actually trigger any
action, even though a change had been made, because the lockfile was
still compatible with the Gemfile.

Colin

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate