title: Ruby if oneliner inside if statement yields error
body: <p>Here's an unexpected find. Something of a very basic Ruby issue that I haven't happened to run into before:</p>
  
  <pre><code>a = "a"
  
  if a
    test = "yes" if a == "a" else "no"
  else
    test = "no"
  end
  </code></pre>
  
  <p>Running this yields the error:</p>
  
  <pre><code>syntax error, unexpected kELSE, expecting kEND
  </code></pre>
  
  <p>Looks like the nested oneliner spills out into the enclosing if statement. What's the generalized solution for this? Not using a oneliner inside an exploded if statement? (It works when exploding the enclosed conditional because it is terminated by an <code>end</code> keyword.</p>
  
  <p>BTW, This is a minimized contrived example, so no need to explain its stupidity or question why I'd do this. I'm looking for a general explanation of how to prevent ruby oneliner if statements from spilling into enclosing conditional scopes.</p>