Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bundler-site documentation :path behavior confusion #546

Open
danlo opened this issue Jan 6, 2021 · 1 comment
Open

bundler-site documentation :path behavior confusion #546

danlo opened this issue Jan 6, 2021 · 1 comment

Comments

@danlo
Copy link

danlo commented Jan 6, 2021

Greetings,

I was reviewing the documentation for loading a gem via: "gem .... path: dir" in an attempt to install a gem directly from the file system.

Site Documentation

As I read the documentation for v2.2 (latest) at https://bundler.io/v2.2/man/gemfile.5.html#PATH
it says:

Similar to the semantics of the :git option, the :path option requires that the directory in question either contains a .gemspec for the gem, or that you specify an explicit version that bundler should use.

The feature that you specify an explicit version did not work for me.

As I reviewed the code & documentation. I downloaded rubygems/bundler-site and attempted to grep the above documentation.

I found the following documentation instead which appears more correct:

Source code for Site documentation

At: https://github.com/rubygems/bundler-site/blob/master/source/v2.2/gemfile.html.haml#L125

    .bullet
      .description
        If you would like to use an unpacked gem directly from the filesystem, simply set the <code>:path</code> option to the path containing the gem's files.
      :code
        # lang: ruby
        gem 'extracted_library', :path => './vendor/extracted_library'

The above documentation appears to be correct, in my experiments with the code.

Summary

I believe the website documentation is out of date with the documentation source code and am asking you to review this confusion.

What I was trying to do....

I was attempting to install a gem locally via:

Gemfile

gem 'lex', '0.0.14', path: 'gems'

What I expected to happen, was that "lex-0.0.14.gem" would be unpacked and installed into

/home/[user]/.bundle/ruby/2.7.0/gems/lex-0.0.14

The bundle(r) does not work in this manner as I thought it would.

If I can help in any manner, please give me a pointer to how to resolve this conflict and I will be happy to fork and update any documentation.

Thank you!

Daniel Lo

@deivid-rodriguez
Copy link
Member

This documentation is indeed confusing but for two things:

  • One is the one you mention. The current wording could mislead you into thinking that the :path option is a target folder for installing a packaged gem, not what it is: a source folder to pickup an unpackaged gem.

  • The other one is that the current wording makes you think that if the folder specified does not include a gemspec, it will automagically generate one if you specify a target version. I don't think this is how bundler works, but it'd be a cute hidden feature 😄.

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

No branches or pull requests

2 participants