ruby / ruby/rubygems

Consider to make the `Gem.default_path` more static

Open
#7,196 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

RubyGems
Dominant language
Ruby
Stars
4k
Forks
1.9k
Avg merge
1d 2h
Merged PRs (30d)
81

Description

The current implementation of Gem.default_path is quite dynamic:

https://github.com/rubygems/rubygems/blob/0339d53cd5fcece4504848c784d8fd9756ea4502/lib/rubygems/defaults.rb#L175-L181

It does not include user_dir and vendor_dir under some conditions, mainly if the directories are not present on the filesystem. That IMHO makes information about versatility of RubyGems more obscure.

Therefore I propose to make the Gem.default_path more static, starting by removing the directory existence check.

Please note that this ticket is based on discussion in https://github.com/rubygems/rubygems/pull/7187#issuecomment-1825533283

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in lib/rubygems/defaults.rb around lines 175-181 and read the discussion linked from pull request 7187. Check how Gem.default_path currently handles user_dir and vendor_dir, then remove the directory-existence condition as proposed. Done means the default path is static and includes those directories under the relevant conditions.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
tooling
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.