Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Confusing error when forgetting protocol

オープン
#160 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
ruby
領域
backend

調査の方向性

まず、IRB または Pry セッションで URI.parse の例を再現し、次に、失敗している open 呼び出しで言及されている URI::Generic の実装を調べます。プロトコルのない URI に対して意図されている動作を特定し、現在の分かりにくい NoMethodError ではなく、説明的なエラーを completion が出力するようにします。

索引モデルが issue の本文から書いたものです。

説明

Steps to Reproduce

  1. Environment:
    gems/ruby-3.3.7@x/gems/uri-1.0.3

  2. Steps:
    Open an Pry/IRB session.

Run:

URI.parse('www.google.com').class
=> URI::Generic
URI.parse('https://www.google.com').class
=> URI::HTTPS

In my production code, I have

URI.parse('www.google.com').open
=> NoMethodError: private method `open' called for an instance of URI::Generic (NoMethodError)

This got me reading the URI source code.

I think that URI::Generic should implement open as a public method and throw an error that explains the issue if its called.

This cost me over an hour. - it must have caught others.
Otherwise. I will need to write a wrapper for URI.parse.

主要言語
Ruby
スター
125
フォーク
65
平均マージ
6時間 4分
マージ済み PR(30日)
2

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

ruby/uri のほかの issue

ruby/uri の issue をすべて見る

似ている issue

Ruby の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。