2018-07-11 15:44:35 -04:00
|
|
|
GEMFILE_LOCK_NOT_UPDATED_MESSAGE = <<~MSG.freeze
|
2018-07-10 06:10:54 -04:00
|
|
|
**%<gemfile>s was updated but %<gemfile_lock>s wasn't updated.**
|
|
|
|
|
|
|
|
Usually, when %<gemfile>s is updated, you should run
|
|
|
|
```
|
|
|
|
bundle install && \
|
2018-12-07 13:15:06 -05:00
|
|
|
bundle install
|
2018-07-10 06:10:54 -04:00
|
|
|
```
|
|
|
|
|
|
|
|
or
|
|
|
|
|
|
|
|
```
|
|
|
|
bundle update <the-added-or-updated-gem>
|
|
|
|
```
|
|
|
|
|
|
|
|
and commit the %<gemfile_lock>s changes.
|
|
|
|
MSG
|
|
|
|
|
2018-05-21 12:41:21 -04:00
|
|
|
gemfile_modified = git.modified_files.include?("Gemfile")
|
|
|
|
gemfile_lock_modified = git.modified_files.include?("Gemfile.lock")
|
|
|
|
|
|
|
|
if gemfile_modified && !gemfile_lock_modified
|
2018-07-10 06:10:54 -04:00
|
|
|
warn format(GEMFILE_LOCK_NOT_UPDATED_MESSAGE, gemfile: gitlab.html_link("Gemfile"), gemfile_lock: gitlab.html_link("Gemfile.lock"))
|
2018-05-21 12:41:21 -04:00
|
|
|
end
|