[#66126] Creation/Conversion methods/functions table for Ruby types — SASADA Koichi <ko1@...>
Hi,
5 messages
2014/11/07
[#66248] [ruby-trunk - Feature #10423] [PATCH] opt_str_lit*: avoid literal string allocations — normalperson@...
Issue #10423 has been updated by Eric Wong.
3 messages
2014/11/13
[#66595] [ruby-trunk - Bug #10557] [Open] Block not given when the argument is a string — bartosz@...
Issue #10557 has been reported by Bartosz Kopinski.
3 messages
2014/11/30
[ruby-core:66296] [ruby-trunk - Bug #10483] [Feedback] Latest Ruby 2.1.4 update introduced backwards incompatible change related to boolean evaluation
From:
nobu@...
Date:
2014-11-15 05:55:34 UTC
List:
ruby-core #66296
Issue #10483 has been updated by Nobuyoshi Nakada.
Status changed from Open to Feedback
Priority changed from Normal to Low
----------------------------------------
Bug #10483: Latest Ruby 2.1.4 update introduced backwards incompatible change related to boolean evaluation
https://bugs.ruby-lang.org/issues/10483#change-49961
* Author: Joe Seeley
* Status: Feedback
* Priority: Low
* Assignee:
* Category:
* Target version: current: 2.2.0
* ruby -v: ruby 2.1.4p265 (2014-10-27 revision 48166) [x86_64-darwin13.0]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
The following, albeit ugly line of code (I didn't write it), worked in Ruby 2.1.1, but fails to evaluate in Ruby 2.1.4
= f.inputs (((q.pick == 'none' || (q.pick == 'one' && q.display_type != "default")) && q.display_type != 'label' ) ? nil : q_text(q, render_context)),:id => rg ? "q_#{q.id}_#{rg}" : "q_#{q.id}",'data-id' => q.id, :class => "q_#{renderer} #{css_class} #{state_prefix_class}" do
This exists within a haml template and the piece that appears to be causing the problem is this section here.
(((q.pick == 'none' || (q.pick == 'one' && q.display_type != "default")) && q.display_type != 'label' )
When this is changed to span lines with some variable assignment, but no other changes it works correctly.
- qid = rg ? "q_#{q.id}_#{rg}" : "q_#{q.id}"
- q_render_context = (((q.pick == 'none' || (q.pick == 'one' && q.display_type != "default")) && q.display_type != 'label' ) ? nil : q_text(q, render_context))
= f.inputs q_render_context, :id => qid,'data-id' => q.id, :class => "q_#{renderer} #{css_class} #{state_prefix_class}" do
This original version produces the following error output.
/Users/jseeley/code/eiacuc/app/views/partials/_question.html.haml:15: syntax error, unexpected keyword_do, expecting keyword_end
/Users/jseeley/code/eiacuc/app/views/partials/_question.html.haml:53: syntax error, unexpected keyword_ensure, expecting end-of-input
The error was produced on haml v4.0.5 with Ruby 2.1.4; the error does not occur on haml v4.0.5 and Ruby 2.1.1 or prior.
--
https://bugs.ruby-lang.org/