https://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17113305112013-10-10T18:48:44ZRuby Issue Tracking SystemRuby master - Bug #9002: Use simpler example for File#expand_pathhttps://redmine.ruby-lang.org/issues/9002?journal_id=424142013-10-10T18:48:44ZEregon (Benoit Daloze)
<ul></ul><p>I don't know, the original example shows File.expand_path does resolve ".." and such.<br>
Your example could be interpreted as File.expand_path being just File.join with reversed arguments.<br>
On the other hand, ".." could be used just once in the example and probably still be clear (going to "/" does not make a lot of sense, one could just use "/bin" directly).</p> Ruby master - Bug #9002: Use simpler example for File#expand_pathhttps://redmine.ruby-lang.org/issues/9002?journal_id=424222013-10-11T12:23:11Zcha1tanya (Prathamesh Sonpatki)csonpatki@gmail.com
<ul></ul><p>Can we give both examples? I think the original example is a bit hard to understand due to two "..". In the first example we can show normal use and in second example, as you pointed out, how to resolve "..".<br>
Eregon (Benoit Daloze) wrote:</p>
<blockquote>
<p>I don't know, the original example shows File.expand_path does resolve ".." and such.<br>
Your example could be interpreted as File.expand_path being just File.join with reversed arguments.<br>
On the other hand, ".." could be used just once in the example and probably still be clear (going to "/" does not make a lot of sense, one could just use "/bin" directly).</p>
</blockquote> Ruby master - Bug #9002: Use simpler example for File#expand_pathhttps://redmine.ruby-lang.org/issues/9002?journal_id=424812013-10-16T00:24:51Zzzak (zzak _)
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Assigned</i></li></ul><p>The original makes no sense to me, but I can see how it resolves ".." (... somehow).</p>
<p>I'm not even sure what the "/tmp/x" has to do with anything.</p>
<p>A patch to explain what's going on there would be nice, at least for my own sake :D</p> Ruby master - Bug #9002: Use simpler example for File#expand_pathhttps://redmine.ruby-lang.org/issues/9002?journal_id=425192013-10-19T20:49:35ZEregon (Benoit Daloze)
<ul></ul><p>cha1tanya (Prathamesh Sonpatki) wrote:</p>
<blockquote>
<p>Can we give both examples? I think the original example is a bit hard to understand due to two "..". In the first example we can show normal use and in second example, as you pointed out, how to resolve "..".</p>
</blockquote>
<p>Yes, that sounds good to me, could you update your patch?</p>
<p>(Sorry for the long delay to answer, I missed your response)</p> Ruby master - Bug #9002: Use simpler example for File#expand_pathhttps://redmine.ruby-lang.org/issues/9002?journal_id=425202013-10-19T22:00:59Zcha1tanya (Prathamesh Sonpatki)csonpatki@gmail.com
<ul><li><strong>File</strong> <a href="/attachments/4009">0001-Use-simpler-example-for-File.expand_path.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/4009/0001-Use-simpler-example-for-File.expand_path.patch">0001-Use-simpler-example-for-File.expand_path.patch</a> added</li></ul><p>Updated based on suggestions of <a class="user active user-mention" href="https://redmine.ruby-lang.org/users/1677">@zzak (zzak _)</a> and <a class="user active user-mention" href="https://redmine.ruby-lang.org/users/772">@Eregon (Benoit Daloze)</a>. Please take a look</p> Ruby master - Bug #9002: Use simpler example for File#expand_pathhttps://redmine.ruby-lang.org/issues/9002?journal_id=425402013-10-22T16:42:55ZEregon (Benoit Daloze)
<ul><li><strong>Assignee</strong> changed from <i>zzak (zzak _)</i> to <i>Eregon (Benoit Daloze)</i></li></ul><p>This is better.<br>
There is a typo "exapnd_path" and I would avoid references to your specific machine and Rails but use something more neutral. I will commit your patch with a couple changes.<br>
Dir.pwd is also subject to change, so a static reference like <strong>FILE</strong> might be better.</p>
<p>Thank you for your contribution!</p> Ruby master - Bug #9002: Use simpler example for File#expand_pathhttps://redmine.ruby-lang.org/issues/9002?journal_id=425412013-10-22T16:59:25ZEregon (Benoit Daloze)
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Closed</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul><p>This issue was solved with changeset r43386.<br>
Prathamesh, thank you for reporting this issue.<br>
Your contribution to Ruby is greatly appreciated.<br>
May Ruby be with you.</p>
<hr>
<ul>
<li>file.c (File#expand_path): [DOC] improve documentation of File#expand_path.<br>
Based on patch by Prathamesh Sonpatki. <a href="/issues/9002">[ruby-core:57734]</a> [Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: Use simpler example for File#expand_path (Closed)" href="https://redmine.ruby-lang.org/issues/9002">#9002</a>]</li>
</ul> Ruby master - Bug #9002: Use simpler example for File#expand_pathhttps://redmine.ruby-lang.org/issues/9002?journal_id=425422013-10-22T18:05:52Zcha1tanya (Prathamesh Sonpatki)csonpatki@gmail.com
<ul></ul><p>Thanks Benoit :)</p>