Ruby Issue Tracking System: Issueshttps://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112014-05-02T10:21:09ZRuby Issue Tracking System
Redmine Ruby master - Feature #9794 (Closed): DateTime.strptime() doesn't work correctly for '%s %z'https://bugs.ruby-lang.org/issues/97942014-05-02T10:21:09Zfelipec (Felipe Contreras)felipe.contreras@gmail.com
<p>Time.strptime() works correctly:</p>
<pre><code>Time.strptime('0 +0100', '%s %z').strftime('%s %z')
=> "0 +0100"
</code></pre>
<p>But DateTime.strptime() doesn't:</p>
<pre><code>DateTime.strptime('0 +0100', '%s %z').strftime('%s %z')
=> "0 +0000"
</code></pre>
<p>In Rubinious it does work correctly:</p>
<pre><code>DateTime.strptime('0 +0100', '%s %z').strftime('%s %z')
=> "0 +0100"
</code></pre>
<p>This make the RubySL date space fail:</p>
<pre><code>DateTime#strptime parses seconds and timezone correctly FAILED
Expected "1970-01-01T00:00:00+00:00"
to equal "1970-01-01T01:00:00+01:00"
</code></pre>
<p>In addition, both C and perl preserver the offset correctly when doing '%s %z'.</p>
<p>So it's very clear DateTime.strptime() has to be fixed.</p>
<p>Patch attached.</p> Backport193 - Backport #9015 (Closed): r42282 (parse.y: fix build error with bison-3.0)https://bugs.ruby-lang.org/issues/90152013-10-12T07:00:03Zfelipec (Felipe Contreras)felipe.contreras@gmail.com
<p>Without this patch the compilation of Ruby 1.9 fails with Bison 3.0.</p> Ruby master - Feature #8460 (Assigned): PATCH: optparse: add `keep_unknown` optionhttps://bugs.ruby-lang.org/issues/84602013-05-29T20:39:13Zfelipec (Felipe Contreras)felipe.contreras@gmail.com
<p>Currently people have to do very convoluted tricks, essentially making<br>
it impossible for optparse to keep unknown options.</p>
<p>The safest and cleanest way is to do it in the code itself.</p>
<p>[1] <a href="http://www.ruby-forum.com/topic/88081" class="external">http://www.ruby-forum.com/topic/88081</a><br>
[2] <a href="http://stackoverflow.com/questions/3642331/can-optparse-skip-unknown-options-to-be-processed-later-in-a-ruby-program" class="external">http://stackoverflow.com/questions/3642331/can-optparse-skip-unknown-options-to-be-processed-later-in-a-ruby-program</a></p> Ruby master - Bug #7445 (Rejected): strptime('%s %z') doesn't workhttps://bugs.ruby-lang.org/issues/74452012-11-27T17:02:36Zfelipec (Felipe Contreras)felipe.contreras@gmail.com
<p>See:</p>
<pre><code>ruby -e "require 'date'; p DateTime.strptime('0 +0100', '%s %z').strftime('%s %z')"
</code></pre>
<p>The timezone is ignored.</p> Backport193 - Backport #7358 (Rejected): Wrong fd redirection on forkhttps://bugs.ruby-lang.org/issues/73582012-11-15T21:33:19Zfelipec (Felipe Contreras)felipe.contreras@gmail.com
<p>It seems fd redirecton only works with spawn, not with fork+exec (at least for fd 3).</p>
<p>% ruby -v<br>
ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-linux]</p>
<p>#!/usr/bin/env ruby</p>
<p>tmp = File.new('/tmp/foo', File::CREAT | File::WRONLY)<br>
cmd = ['echo', 'yes']</p>
<p>pid = Process.spawn(*cmd, 3 => tmp)<br>
Process.wait(pid)</p>
<p>pid = fork do<br>
Process.exec(*cmd, :close_others => true, 3 => tmp)<br>
end<br>
Process.wait(pid)</p> Ruby master - Bug #824 (Closed): st.h requires stdlib.hhttps://bugs.ruby-lang.org/issues/8242008-12-05T08:25:38Zfelipec (Felipe Contreras)felipe.contreras@gmail.com
<p>=begin<br>
st.h is using size_t which is defined in stdlib.h.</p>
<p>Compilation fails when using st.h directly. That happens in libxml-ruby for example.<br>
=end</p>