Enhancement for gem env
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
まず、提案されている show_environment の実装を読み、gem env を実行して現在の出力を YAML の例と比較します。一覧にある設定、ディレクトリ、gem パス、シェルパスの値がどのように組み立てられているかを確認します。出力形式について合意し、提案されている存在チェック、ホームディレクトリの墨消し、中央集約されたフォーマットを実装すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
The following rewrite of show_environment suggests improvements of gem env output.
Feedback on further improvements or alternative angles appreciated.
| Feature | Benefits |
|---|---|
| Outputs YAML (near already) | Can parse, pipe to yq for colors, etc. |
| Checks file presence | Helpful in bug reports |
Replaces Dir.home with ~ |
Redaction / Privacy |
| Centralizes formatting | DRY |
Example output
RubyGems Environment:
Version:
- 4.0.20
Platforms:
- ruby
- arm64-darwin-25
Configuration:
update_sources: true
verbose: true
backtrace: true
bulk_threshold: 1000
gem: --no-document
Sources:
- https://rubygems.org/
Dependencies:
Ruby version: 4.0.7 (2026-09-15 patchlevel 0) [arm64-darwin25]
Ruby executable: /opt/homebrew/opt/ruby/bin/ruby
Git executable: /usr/bin/git
Directories:
Global install: /opt/homebrew/lib/ruby/gems/4.0.0
# Global config: /opt/homebrew/Cellar/ruby/4.0.7/etc
Executable: /opt/homebrew/lib/ruby/gems/4.0.0/bin
# User install: ~/.local/share/gem/ruby/4.0.0
Spec cache: ~/.cache/gem/specs
# Credentials: ~/.local/share/gem/credentials
Gem path:
- /opt/homebrew/lib/ruby/gems/4.0.0
# - ~/.local/share/gem/ruby/4.0.0
- /opt/homebrew/Cellar/ruby/4.0.7/lib/ruby/gems/4.0.0
Shell path:
- /opt/homebrew/bin
- /opt/homebrew/sbin
- /opt/homebrew/opt/ruby/bin
- /usr/bin
- /bin
- /usr/sbin
- /sbin
- /opt/homebrew/lib/ruby/gems/4.0.0/bin
Code
def exist(value)
case value
when %r{^/}
File.stat(value)
end
''
rescue Errno::ENOENT
'# '
end
def tree(items)
items.flat_map do |group, items|
items.compact.map do |item|
item = [item].flatten
line = exist(item.last) + (item.one? ? '- ' : '') + item.join(': ')
line.prepend(' ').gsub(Dir.home, '~')
end.prepend(format(' %s:', group))
end
end
def show_environment # :nodoc:
config = {}
Gem.configuration.each do |name, value|
config[name] = name == 'gemcutter_key' ? value.gsub(/./, '*') : value
end
{
'Version' => [Gem::VERSION],
'Platforms' => Gem.platforms.map(&:to_s),
'Configuration' => config,
'Sources' => Gem.sources.to_a,
'Dependencies' => {
'Ruby version' => "#{RUBY_VERSION} (#{RUBY_RELEASE_DATE} patchlevel #{RUBY_PATCHLEVEL}) [#{RUBY_PLATFORM}]",
'Ruby executable' => Gem.ruby,
'Git executable' => git_path
},
'Directories' => {
'Global install' => Gem.dir,
'Global config' => Gem::ConfigFile::SYSTEM_CONFIG_PATH,
'Executable' => Gem.bindir,
'User install' => Gem.user_dir,
'Prefix' => Gem.prefix,
'Spec cache' => Gem.spec_cache_dir,
'Credentials' => Gem.configuration.credentials_path
},
'Gem path' => ([Gem.dir] + Gem.path).uniq,
'Shell path' => ENV['PATH'].split(File::PATH_SEPARATOR)
}.then { tree(it).prepend('RubyGems Environment:').join("\n") }
end
- 主要言語
- Ruby
- スター
- 4k
- フォーク
- 2k
- 平均マージ
- 1日 5時間
- マージ済み PR(30日)
- 36
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ruby/rubygems のほかの issue
-
Broken linkオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 15/100
メンテナーはふだん 1 日以内に返信
-
Gem::Package::TarReader silently ignores pax/GNU extension headers対応中かも @akasakariko が 3 日前に担当しました。 オープンRubyGems
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
ruby/rubygems#9988 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
`Gem::Version.new`, `#bump`, and `#release` do not work in ractor対応中かも @mmporong が 7 日前に担当しました。 オープンRubyGems
難易度 3/5 半日 初心者へのやさしさ 55/100
メンテナーはふだん 1 日以内に返信
-
`bundle install` exits 0 even when a git gem's submodules fail to clone対応中かも @mattyb が 12 日前に担当しました。 オープンBundler
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
JWT::EncodedToken raises TypeError for a non-object header対応中かも @anakinj が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
jwt/ruby-jwt#780 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1時間未満 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
zold-io/zold-ruby-sdk#85 ·