https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112012-11-11T06:28:15ZRuby Issue Tracking SystemRuby master - Bug #7326: Time.c doc improvementshttps://bugs.ruby-lang.org/issues/7326?journal_id=327582012-11-11T06:28:15Zbt (Bernd Homuth)
<ul></ul><p>Actually, I'm not really happy with my "improvements". After looking through more classes there is inconsistency everywhere and it seems every class has its own style. Maybe there should be some API documentation guideline first. I checked the Rails guidelines but don't think they cover everything: <a href="http://edgeguides.rubyonrails.org/api_documentation_guidelines.html" class="external">http://edgeguides.rubyonrails.org/api_documentation_guidelines.html</a></p> Ruby master - Bug #7326: Time.c doc improvementshttps://bugs.ruby-lang.org/issues/7326?journal_id=327962012-11-12T11:24:55Zzzak (zzak _)
<ul><li><strong>Assignee</strong> changed from <i>drbrain (Eric Hodel)</i> to <i>zzak (zzak _)</i></li><li><strong>Target version</strong> set to <i>2.0.0</i></li></ul> Ruby master - Bug #7326: Time.c doc improvementshttps://bugs.ruby-lang.org/issues/7326?journal_id=328022012-11-12T13:29:17Zrohitarondekar (Rohit Arondekar)rohit.arondekar@gmail.com
<ul></ul><p>=begin<br>
Made a quick pass through the patch and the following stood out:</p>
<blockquote>
<blockquote>
<p>((<em>The idea is taken from Perl:</em>))</p>
</blockquote>
</blockquote>
<p>I would prefer "The idea is borrowed from Perl:"</p>
<blockquote>
<blockquote>
<p>((<em>The first DST is at 1916 in German.<br>
So we don't need to care DST before that.</em>))</p>
</blockquote>
</blockquote>
<p>I would prefer "DST was used for the first time by Germany starting in 1916" and "Therefore we don't check for DST prior to 1916"</p>
<p>Also IMHO I think it would have been better if the patch was split into two ― one only for formatting changes and another for corrections. Don't do it because I said so! I just think it would have made reviewing the patch easier. :)</p>
<p>I agree on CRuby needing a API Documentation guideline. The reasons are obvious, it will make editing and adding docs much easier for both newcomers as well as existing contributors. However how do you go about writing a documentation guide for a programming language? :) I'll try to find if other programming languages have such a guide.<br>
=end</p> Ruby master - Bug #7326: Time.c doc improvementshttps://bugs.ruby-lang.org/issues/7326?journal_id=328112012-11-12T16:16:02Zbt (Bernd Homuth)
<ul></ul><p><a class="user active user-mention" href="https://bugs.ruby-lang.org/users/6350">@rohitarondekar (Rohit Arondekar)</a> thank you for the comments and welcome to ruby bugs :)</p>
<blockquote>
<p>I would prefer "The idea is borrowed from Perl:"<br>
yes, sounds better, you're right.</p>
<blockquote>
<blockquote>
<p>((<em>The first DST is at 1916 in German.<br>
So we don't need to care DST before that.</em>))</p>
</blockquote>
</blockquote>
<p>I would prefer "DST was used for the first time by Germany starting in 1916" and "Therefore we don't check for DST prior to 1916"<br>
Doesn't really matter if it was used in Germany or elsewhere, should be rephrased altogether.</p>
</blockquote>
<blockquote>
<p>Also IMHO I think it would have been better if the patch was split into two ― one only for formatting changes and another for corrections. Don't do it because I said so! I just think it would have made reviewing the patch easier. :)</p>
<p>I agree on CRuby needing a API Documentation guideline. The reasons are obvious, it will make editing and adding docs much easier for both newcomers as well as existing contributors. However how do you go about writing a documentation guide for a programming language? :) I'll try to find if other programming languages have such a guide.</p>
</blockquote>
<p>yes to both, zzak sent me the link to this: <a href="http://bugs.ruby-lang.org/projects/ruby/wiki/DocumenterHowTo" class="external">http://bugs.ruby-lang.org/projects/ruby/wiki/DocumenterHowTo</a><br>
so there is some documentation available. Needs some clarifications, though.</p> Ruby master - Bug #7326: Time.c doc improvementshttps://bugs.ruby-lang.org/issues/7326?journal_id=328932012-11-14T13:54:40Zzzak (zzak _)
<ul></ul><p>The formatting looks good, except you shouldn't wrap classes in anything, such as ArgumentError or Time and Time#to_f</p>
<p>This allow rdoc to properly link these objects.</p> Ruby master - Bug #7326: Time.c doc improvementshttps://bugs.ruby-lang.org/issues/7326?journal_id=330522012-11-18T20:21:41Zbt (Bernd Homuth)
<ul><li><strong>File</strong> <a href="/attachments/3255">time_docs_2.diff</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/3255/time_docs_2.diff">time_docs_2.diff</a> added</li></ul><p>In contrast to the guidelines I have: <em>arguments</em>, <em>object</em> and <em>other_object</em> (also <em>self</em>)<br>
Monospaced only for return values: +nil and +true+<br>
What about class methods: Time::new vs Time#new vs Time.new?<br>
Method references should be complete or abbreviated: Time#to_a vs #to_a</p>
<p>If we can decide on a format I can go through the other classes as well.</p>
<p>diff is just for review, not yet split.</p> Ruby master - Bug #7326: Time.c doc improvementshttps://bugs.ruby-lang.org/issues/7326?journal_id=331532012-11-20T12:44:17Zzzak (zzak _)
<ul></ul><p>If you can separate typo/grammar changes from formatting, it will be much easier for me to review and more likely to commit.</p>
<p>edit: s/grammer/grammar ... how ironic</p> Ruby master - Bug #7326: Time.c doc improvementshttps://bugs.ruby-lang.org/issues/7326?journal_id=331552012-11-20T13:09:12Zdrbrain (Eric Hodel)drbrain@segment7.net
<ul></ul><p>=begin<br>
Arguments should be surrounded by "+", not "_". In Time.at, (({+seconds+})), (({+seconds_with_frac+})) and (({+microseconds_with_frac+})) are preferred.</p>
<p>Otherwise, a quick scan makes me think this patch is good.</p>
<p>For reference purposes, methods will be linked in the same class if they have an "_" or them, so (({Time#to_s})) and (({#to_s})) and (({to_s})) would all link to the same place. A full name like (({Array#join})) should be used when referring to a method external to the current class.</p>
<p>If a method doesn't have an "_" like (({Time#sec})) you need to prefix it with an "#". (({Time#sec})) and (({#sec})) would both link to the same place, but (({sec})) would not be linked.</p>
<p>Similarly, for class methods without "_", prefix the method with "::". When using a full name, if the method is unambiguous, a "." will also work. (({Time.sec})) will link to (({Time#sec}))</p>
<p>=end</p> Ruby master - Bug #7326: Time.c doc improvementshttps://bugs.ruby-lang.org/issues/7326?journal_id=338122012-11-24T19:38:36Zbt (Bernd Homuth)
<ul><li><strong>File</strong> <a href="/attachments/3296">time_patch0001.diff</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/3296/time_patch0001.diff">time_patch0001.diff</a> added</li><li><strong>File</strong> <a href="/attachments/3297">time_patch0002.diff</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/3297/time_patch0002.diff">time_patch0002.diff</a> added</li><li><strong>File</strong> <a href="/attachments/3298">time_patch0003.diff</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/3298/time_patch0003.diff">time_patch0003.diff</a> added</li></ul><p>See my three patches (time_patch000x.diff), first one for typos etc, second one for format changes and third one for more substantial changes to the docs.</p> Ruby master - Bug #7326: Time.c doc improvementshttps://bugs.ruby-lang.org/issues/7326?journal_id=338282012-11-25T07:00:24Zbt (Bernd Homuth)
<ul><li><strong>File</strong> <a href="/attachments/3299">time_patch0004.diff</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/3299/time_patch0004.diff">time_patch0004.diff</a> added</li></ul><p>After going over the file one last time I found a couple of lines I've missed.</p> Ruby master - Bug #7326: Time.c doc improvementshttps://bugs.ruby-lang.org/issues/7326?journal_id=341912012-11-30T13:53:12Zzzak (zzak _)
<ul><li><strong>Status</strong> changed from <i>Open</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 r38032.<br>
Bernd, thank you for reporting this issue.<br>
Your contribution to Ruby is greatly appreciated.<br>
May Ruby be with you.</p>
<hr>
<ul>
<li>time.c: Documentation improvements, grammar and formatting<br>
Patch by Bernd Homuth <a href="/issues/7326">[ruby-core:49203]</a> [Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: Time.c doc improvements (Closed)" href="https://bugs.ruby-lang.org/issues/7326">#7326</a>]</li>
</ul>