<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/lib/syntax_suggest/mini_stringio.rb, branch v4.0.2</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>[ruby/syntax_suggest] Explain why class exists</title>
<updated>2024-11-15T16:06:25+00:00</updated>
<author>
<name>Schneems</name>
<email>richard.schneeman+foo@gmail.com</email>
</author>
<published>2024-11-15T16:02:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=3a547e2539124e8ecd9b09f747fb8f516295134e'/>
<id>3a547e2539124e8ecd9b09f747fb8f516295134e</id>
<content type='text'>
https://github.com/ruby/syntax_suggest/commit/8c36b0cb35
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/syntax_suggest/commit/8c36b0cb35
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/syntax_suggest] Freeze strings</title>
<updated>2024-11-15T16:06:24+00:00</updated>
<author>
<name>Schneems</name>
<email>richard.schneeman+foo@gmail.com</email>
</author>
<published>2024-11-15T16:00:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=7969f6791fc219ba3e3af84574344d870b44fe4f'/>
<id>7969f6791fc219ba3e3af84574344d870b44fe4f</id>
<content type='text'>
https://github.com/ruby/syntax_suggest/commit/b17bf0baca
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/syntax_suggest/commit/b17bf0baca
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/syntax_suggest] Fix missing line break due to puts logic</title>
<updated>2024-11-15T01:31:26+00:00</updated>
<author>
<name>Schneems</name>
<email>richard.schneeman+foo@gmail.com</email>
</author>
<published>2024-11-15T00:54:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=226cfda3069c76c094d294a68585b5772fcc730a'/>
<id>226cfda3069c76c094d294a68585b5772fcc730a</id>
<content type='text'>
In #225 it was reported that the output looks incorrect:

```
$ cat /tmp/4a71c7e417cc9eac0971e3a2519b295c/scratch.rb
def x.y.z
end
$ ruby /tmp/4a71c7e417cc9eac0971e3a2519b295c/scratch.rb
/tmp/4a71c7e417cc9eac0971e3a2519b295c/scratch.rb: --&gt; /tmp/4a71c7e417cc9eac0971e3a2519b295c/scratch.rb
expected a delimiter to close the parametersunexpected '.', ignoring it
&gt; 1  def x.y.z
&gt; 2  end
```

Specifically:

```
expected a delimiter to close the parametersunexpected '.', ignoring it
```

However this does not show up when executing the debug executable:

```
$ bin/bundle exec exe/syntax_suggest /tmp/4a71c7e417cc9eac0971e3a2519b295c/scratch.rb
--&gt; /tmp/4a71c7e417cc9eac0971e3a2519b295c/scratch.rb

expected a delimiter to close the parameters
unexpected '.', ignoring it

&gt; 1  def x.y.z
&gt; 2  end
```

This is because `exe/syntax_suggest` uses STDOUT.puts while calling `ruby` with the filename uses a fake IO object represented by MiniStringIO. This class was incorrectly not adding a newline to the end of the print.

The fix was to move the class to it's own file where it can be tested and then fix the behavior.

close https://github.com/ruby/syntax_suggest/pull/225

https://github.com/ruby/syntax_suggest/commit/d2ecd94a3b

Co-authored-by: Andy Yong &lt;andyywz@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In #225 it was reported that the output looks incorrect:

```
$ cat /tmp/4a71c7e417cc9eac0971e3a2519b295c/scratch.rb
def x.y.z
end
$ ruby /tmp/4a71c7e417cc9eac0971e3a2519b295c/scratch.rb
/tmp/4a71c7e417cc9eac0971e3a2519b295c/scratch.rb: --&gt; /tmp/4a71c7e417cc9eac0971e3a2519b295c/scratch.rb
expected a delimiter to close the parametersunexpected '.', ignoring it
&gt; 1  def x.y.z
&gt; 2  end
```

Specifically:

```
expected a delimiter to close the parametersunexpected '.', ignoring it
```

However this does not show up when executing the debug executable:

```
$ bin/bundle exec exe/syntax_suggest /tmp/4a71c7e417cc9eac0971e3a2519b295c/scratch.rb
--&gt; /tmp/4a71c7e417cc9eac0971e3a2519b295c/scratch.rb

expected a delimiter to close the parameters
unexpected '.', ignoring it

&gt; 1  def x.y.z
&gt; 2  end
```

This is because `exe/syntax_suggest` uses STDOUT.puts while calling `ruby` with the filename uses a fake IO object represented by MiniStringIO. This class was incorrectly not adding a newline to the end of the print.

The fix was to move the class to it's own file where it can be tested and then fix the behavior.

close https://github.com/ruby/syntax_suggest/pull/225

https://github.com/ruby/syntax_suggest/commit/d2ecd94a3b

Co-authored-by: Andy Yong &lt;andyywz@gmail.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
