Skip to content

Add local source for rbs collection#854

Merged
soutaro merged 3 commits intoruby:masterfrom
pocke:collection-local-directory-source
Feb 17, 2023
Merged

Add local source for rbs collection#854
soutaro merged 3 commits intoruby:masterfrom
pocke:collection-local-directory-source

Conversation

@pocke
Copy link
Copy Markdown
Member

@pocke pocke commented Dec 23, 2021

Fix #842

This PR adds local source feature to rbs collection.

This feature allows you to write a local path as an rbs collection's source. Previously you need to create a git repository to add a source, but now you can just specify a local directory as a source.

Usage

# rbs_collection.yaml

sources:
  - type: local
    path: path/to/local_source/

Then, rbs collection install installs RBSs from the specified path.

@pocke pocke self-assigned this Dec 23, 2021
@pocke pocke force-pushed the collection-local-directory-source branch from dda9543 to 7288de7 Compare December 31, 2021 09:54
@pocke pocke force-pushed the collection-local-directory-source branch from b7466c5 to 61dd0e4 Compare February 11, 2022 04:22
@pocke pocke force-pushed the collection-local-directory-source branch 3 times, most recently from afe47a7 to 86f4ec5 Compare February 8, 2023 09:04
@pocke pocke changed the title WIP Collection local directory source Add local source for rbs collection Feb 9, 2023
@pocke pocke marked this pull request as ready for review February 9, 2023 08:50
@pocke pocke force-pushed the collection-local-directory-source branch from 0014b91 to 8699b59 Compare February 17, 2023 06:05
@soutaro soutaro added this to the RBS 3.0 milestone Feb 17, 2023
@soutaro soutaro added this pull request to the merge queue Feb 17, 2023
Merged via the queue into ruby:master with commit f6b9fff Feb 17, 2023
@pocke pocke deleted the collection-local-directory-source branch March 14, 2023 09:32
@leoneves
Copy link
Copy Markdown

leoneves commented Jun 16, 2023

@pocke how can I use this feature?

I created the directory: gems_sigs/gosu/1.4.6/gosu.rbs
there. there is a module and a class: module Gosu, class Window...

My rbs_collection.yaml:

sources:
  - type: local
    path: gems_sigs

gems:
  - name: rbs
    ignore: true

rbs collection install return:

.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rbs-2.8.2/lib/rbs/collection/sources.rb:20:in `from_config_entry': unhandled exception
        from /.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rbs-2.8.2/lib/rbs/collection/config.rb:69:in `block in sources'
        from /home/rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rbs-2.8.2/lib/rbs/collection/config.rb:69:in `map'
        from /home/rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rbs-2.8.2/lib/rbs/collection/config.rb:69:in `sources'
        from /home/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rbs-2.8.2/lib/rbs/collection/config/lockfile_generator.rb:119:in find_source'
        from /home/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rbs-2.8.2/lib/rbs/collection/config/lockfile_generator.rb:78:in assign_gem'
        from /home/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rbs-2.8.2/lib/rbs/collection/config/lockfile_generator.rb:51:in generate'
        from /home/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rbs-2.8.2/lib/rbs/collection/config/lockfile_generator.rb:26:in generate'
        from /home/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rbs-2.8.2/lib/rbs/collection/config.rb:33:in `generate_lockfile'
        from /home/Ebenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rbs-2.8.2/lib/rbs/cli.rb:1042:in `run_collection'
        from /home//.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rbs-2.8.2/lib/rbs/cli.rb:130:in `run'
        from /home/rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rbs-2.8.2/exe/rbs:7:in `<top (required)>'
        from /home/.rbenv/versions/3.2.2/bin/rbs:25:in `load'
        from /home/.rbenv/versions/3.2.2/bin/rbs:25:in `<main>'

Any idea?
There are any docs for this use?

@pocke
Copy link
Copy Markdown
Member Author

pocke commented Jun 17, 2023

I couldn't reproduce this error. Could you open an issue and create a repository to reproduce this error?

@leoneves
Copy link
Copy Markdown

leoneves commented Jun 19, 2023

Thanks for the answer. I will try =)

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.

Ability to point collection to local definitions

3 participants