Skip to content

Support to call collection coomand in chid dir#1135

Merged
pocke merged 6 commits into
ruby:masterfrom
pocke:support-to-call-collection-coomand-in-chid-dir
Nov 10, 2022
Merged

Support to call collection coomand in chid dir#1135
pocke merged 6 commits into
ruby:masterfrom
pocke:support-to-call-collection-coomand-in-chid-dir

Conversation

@pocke
Copy link
Copy Markdown
Member

@pocke pocke commented Oct 27, 2022

This PR takes over #1025.

How to find rbs_collection.yaml and Gemfile.lock

It searches these files with the following procedure.

rbs_collection.yaml

It searches this file upwards. Search ./rbs_collection.yaml, then ../rbs_collection.yaml, then ../../, ...

Gemfile.lock

It uses Bundler.default_lockfile, which is the same as bundle exec's Gemfile.lock. If rbs collection is not executed with bundler, this method searches Gemfile.lock with the same procedure as rbs_collection.yaml.

Mismatch between rbs_collection.yaml and Gemfile.lock

As #1025 (comment), rbs_collection.yaml refers only to one Gemfile.lock. If it refers to a different Gemfile.lock, rbs collection install generates inconsistent rbs_collection.lock.yaml.

rbs_collection.lock.yaml records gemfile_lock_path to avoid this problem. If Bundler.default_lockfile points to a different path from gemfile_lock_path, it raises an error.

This change extends the syntax of rbs_collection.lock.yaml, but it is not a breaking change because the old format is still supported. If rbs_collection.lock.yaml has no gemfile_lock_path, it doesn't check anything and record current Bundler.default_lockfile as gemfile_lock_path.

@soutaro soutaro added this to the RBS 2.8.0 milestone Nov 7, 2022
@pocke pocke merged commit a3b9827 into ruby:master Nov 10, 2022
@pocke pocke deleted the support-to-call-collection-coomand-in-chid-dir branch November 10, 2022 05:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants