https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112020-06-27T02:11:23ZRuby Issue Tracking SystemRuby master - Bug #16988: Kernel.load loads file from current directory without '.' in pathhttps://bugs.ruby-lang.org/issues/16988?journal_id=863532020-06-27T02:11:23Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul></ul><p>I don’t this is an implementation bug, but a documentation issue.</p> Ruby master - Bug #16988: Kernel.load loads file from current directory without '.' in pathhttps://bugs.ruby-lang.org/issues/16988?journal_id=863722020-06-29T13:49:38ZTheSmartnik (Nikita Misharin)
<ul></ul><p>nobu (Nobuyoshi Nakada) wrote in <a href="#note-1">#note-1</a>:</p>
<blockquote>
<p>I don’t this is an implementation bug, but a documentation issue.</p>
</blockquote>
<p>Shouldn't behavior be consistent with require, though?</p> Ruby master - Bug #16988: Kernel.load loads file from current directory without '.' in pathhttps://bugs.ruby-lang.org/issues/16988?journal_id=864742020-07-09T21:16:08Zjeremyevans0 (Jeremy Evans)merch-redmine@jeremyevans.net
<ul></ul><p>TheSmartnik (Nikita Misharin) wrote in <a href="#note-2">#note-2</a>:</p>
<blockquote>
<p>nobu (Nobuyoshi Nakada) wrote in <a href="#note-1">#note-1</a>:</p>
<blockquote>
<p>I don’t this is an implementation bug, but a documentation issue.</p>
</blockquote>
<p>Shouldn't behavior be consistent with require, though?</p>
</blockquote>
<p>I don't think so. <code>load</code> has always been able to load files that exist relative to the current directory, and <code>require</code> has not. Technically, in Ruby <1.9, <code>require</code> worked similarly because <code>'.'</code> was in the default load path). <code>load</code> and <code>require</code> are different in many other ways, and changing this to increase the consistency between them doesn't make sense to me.</p>
<p>Changing <code>load</code>'s behavior would definitely break things. I agree with <a class="user active user-mention" href="https://bugs.ruby-lang.org/users/4">@nobu (Nobuyoshi Nakada)</a> that this is a documentation issue, and I'll try to update the documentation to explain it.</p> Ruby master - Bug #16988: Kernel.load loads file from current directory without '.' in pathhttps://bugs.ruby-lang.org/issues/16988?journal_id=864782020-07-09T21:50:03Zjeremyevans (Jeremy Evans)code@jeremyevans.net
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li></ul><p>Applied in changeset <a class="changeset" title="Document that Kernel#load will load relative to current directory [ci skip] Update and format th..." href="https://bugs.ruby-lang.org/projects/ruby-master/repository/git/revisions/e1bbb9ea9ce205320267783960cfb2e9215d5f52">git|e1bbb9ea9ce205320267783960cfb2e9215d5f52</a>.</p>
<hr>
<p>Document that Kernel#load will load relative to current directory [ci skip]</p>
<p>Update and format the Kernel#load documentation to separate the<br>
three cases (absolute path, explicit relative path, other), and<br>
also document that it raises LoadError on failure.</p>
<p>Fixes [Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: Kernel.load loads file from current directory without '.' in path (Closed)" href="https://bugs.ruby-lang.org/issues/16988">#16988</a>]</p>