Forum: Ruby Ruby 1.8.7 has been released

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
74f896b312b786ee75a18073941e2457?d=identicon&s=25 Akinori MUSHA (Guest)
on 2008-05-31 17:26
(Received via mailing list)
Folks,

It is my pleasure to announce that Ruby 1.8.7 has just been released.

The new version of Ruby includes many bug fixes, lots of feature
enhancements backported from 1.9 and some performance improvements
since 1.8.6 while maintaining stability and backward compatibility
with the previous release to a high degree.  See the bundled
documentation for details about compatibility issues.

The source code package is available in three formats at the following
locations:

  ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7.tar.bz2
  ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7.tar.gz
  ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7.zip

Checksums:

  MD5 (ruby-1.8.7.tar.bz2) = f17f14c8d55e731b3ce1bc35c42f0a6c
  SHA256 (ruby-1.8.7.tar.bz2) =
65f2a862ba5e88bac7a78cff15bcb88d7534e741b51a1ffb79a0136c7041359a
  SIZE (ruby-1.8.7.tar.bz2) = 4100024

  MD5 (ruby-1.8.7.tar.gz) = de906850f9a012c12ffc6e9f56fb1b66
  SHA256 (ruby-1.8.7.tar.gz) =
600dccf13bca3e4179fa6ff554220ce4ba67ffc72bce1ac3bf74c2599c03a0ca
  SIZE (ruby-1.8.7.tar.gz) = 4799732

  MD5 (ruby-1.8.7.zip) = 14d3eb37b32e4a26966bdd80f361ccd2
  SHA256 (ruby-1.8.7.zip) =
805987ad167d8f9cac90e4b9342686e96a7708664111be27a3c6d680ce21d6c1
  SIZE (ruby-1.8.7.zip) = 5851408


For a brief list of user visible changes and a full list of all
changes, see the bundled files named NEWS and ChangeLog, which are
also available at the following locations:

  http://svn.ruby-lang.org/repos/ruby/tags/v1_8_7/NEWS
  http://svn.ruby-lang.org/repos/ruby/tags/v1_8_7/ChangeLog

Enjoy!
86e33dee4a89a8879a26487051c216a8?d=identicon&s=25 Michael Fellinger (Guest)
on 2008-06-01 03:35
(Received via mailing list)
On Sun, Jun 1, 2008 at 12:25 AM, Akinori MUSHA <knu@idaemons.org> wrote:
> The source code package is available in three formats at the following
>        SIZE (ruby-1.8.7.tar.bz2) = 4100024
> For a brief list of user visible changes and a full list of all
> changes, see the bundled files named NEWS and ChangeLog, which are
> also available at the following locations:
>
>        http://svn.ruby-lang.org/repos/ruby/tags/v1_8_7/NEWS
>        http://svn.ruby-lang.org/repos/ruby/tags/v1_8_7/ChangeLog
>
> Enjoy!

I'm trying to, but it seems like this release breaks Hpricot due to an
unknown issue.

^ manveru
86e33dee4a89a8879a26487051c216a8?d=identicon&s=25 Michael Fellinger (Guest)
on 2008-06-01 05:25
(Received via mailing list)
On Sun, Jun 1, 2008 at 10:33 AM, Michael Fellinger
<m.fellinger@gmail.com> wrote:
> On Sun, Jun 1, 2008 at 12:25 AM, Akinori MUSHA <knu@idaemons.org> wrote:
>> Folks,
...
>>        http://svn.ruby-lang.org/repos/ruby/tags/v1_8_7/NEWS
>>        http://svn.ruby-lang.org/repos/ruby/tags/v1_8_7/ChangeLog
>>
>> Enjoy!
>
> I'm trying to, but it seems like this release breaks Hpricot due to an
> unknown issue.

After checking the source and change log I've found that Hpricot
depends on the erroneous Array#slice! return value which is nil now,
i've made a fix and put up a Hpricot mirror with the changes necessary
on:

http://github.com/manveru/hpricot

--
^ manveru
6848ac80d38c46beecca69ba442eb119?d=identicon&s=25 Kirill A. Shutemov (Guest)
on 2008-06-01 23:41
(Received via mailing list)
On Sun, Jun 01, 2008 at 12:25:08AM +0900, Akinori MUSHA wrote:
> Folks,
>
> It is my pleasure to announce that Ruby 1.8.7 has just been released.

ERB is unusable without strscan. TrimScanner(at least) is broken:

> testrb test/erb/test_erb.rb
Loaded suite test_erb.rb
Started
....E..E.EEF
Finished in 0.030524 seconds.
<skip/>
12 tests, 31 assertions, 1 failures, 4 errors
4995c7ce9523ce00dea01362cb976196?d=identicon&s=25 Kornelius Kalnbach (Guest)
on 2008-06-02 03:23
(Received via mailing list)
Akinori MUSHA wrote:
> It is my pleasure to announce that Ruby 1.8.7 has just been released.
thank you!

despite the claim of "some performance improvements" (are they
documented anywhere?): tests with the CodeRay syntax highlighting
library - which makes heavy use of StringScanner, Regexp and Hashes -
run about 20-30% slower than they did with 1.8.6. is anybody else
experiencing slowdowns, too? any ideas where to look for the bottleneck
before I profile the whole thing?

[murphy]
74f896b312b786ee75a18073941e2457?d=identicon&s=25 Akinori MUSHA (Guest)
on 2008-06-02 08:48
(Received via mailing list)
At Mon, 2 Jun 2008 06:37:21 +0900,
Kirill A. Shutemov wrote:
> ....E..E.EEF
> Finished in 0.030524 seconds.
> <skip/>
> 12 tests, 31 assertions, 1 failures, 4 errors

Hmm, someone should have tested erb without strscan.

Does this patch work for you?

Index: erb.rb
===================================================================
--- erb.rb  (revision 16747)
+++ erb.rb  (working copy)
@@ -327,9 +327,11 @@
       end

       def scan_line(line)
-        line.scan(/(.*?)(<%%|%%>|<%=|<%#|<%|%>|\n|\z)/m) do |token|
-    next if token.empty?
-    yield(token)
+        line.scan(/(.*?)(<%%|%%>|<%=|<%#|<%|%>|\n|\z)/m) do |tokens|
+          tokens.each do |token|
+            next if token.empty?
+            yield(token)
+          end
   end
       end
74f896b312b786ee75a18073941e2457?d=identicon&s=25 Akinori MUSHA (Guest)
on 2008-06-02 09:03
(Received via mailing list)
At Mon, 2 Jun 2008 15:46:53 +0900,
I wrote:
> > Loaded suite test_erb.rb
> > Started
> > ....E..E.EEF
> > Finished in 0.030524 seconds.
> > <skip/>
> > 12 tests, 31 assertions, 1 failures, 4 errors
>
> Hmm, someone should have tested erb without strscan.
>
> Does this patch work for you?

Seems this still leaves one failure.  I'll contact the author and be
back when it's fixed.
6848ac80d38c46beecca69ba442eb119?d=identicon&s=25 Kirill A. Shutemov (Guest)
on 2008-06-02 09:11
(Received via mailing list)
On Mon, Jun 02, 2008 at 03:46:53PM +0900, Akinori MUSHA wrote:
> > Loaded suite test_erb.rb
> > Started
> > ....E..E.EEF
> > Finished in 0.030524 seconds.
> > <skip/>
> > 12 tests, 31 assertions, 1 failures, 4 errors
>
> Hmm, someone should have tested erb without strscan.
>
> Does this patch work for you?

Yes.
6848ac80d38c46beecca69ba442eb119?d=identicon&s=25 Kirill A. Shutemov (Guest)
on 2008-06-02 09:14
(Received via mailing list)
On Mon, Jun 02, 2008 at 04:07:21PM +0900, Kirill A. Shutemov wrote:
> > > > testrb test/erb/test_erb.rb
>
> Yes.

Sorry, no. I can build trunk using it, but test still fail.

> testrb test/erb/test_erb.rb
Loaded suite test_erb.rb
Started
...........F
Finished in 0.075981 seconds.

  1) Failure:
test_08_explicit(TestERBCore) [./test/erb/test_erb.rb:410]:
<"NotSkip  NotSkip\n  * HELLO\n  * WORLD\n NotSkip \n   * hello\n   *
HELLO\n   * world\n   * WORLD\nKeepNewLine  \n"> expected but was
<"\nNotSkip  NotSkip\n\n\n  * HELLO\n\n\n  * WORLD\n\n NotSkip \n\n\n
* hello\n\n   * HELLO\n\n\n   * world\n\n   * WORLD\n\nKeepNewLine
\n">.

12 tests, 105 assertions, 1 failures, 0 errors
7f40fd88cc3915154810df02406755e5?d=identicon&s=25 Jayson Williams (Guest)
on 2008-06-02 18:13
(Received via mailing list)
On Sat, May 31, 2008 at 11:25 AM, Akinori MUSHA <knu@idaemons.org>
wrote:
> Enjoy!
>
> --
> Akinori MUSHA / http://akinori.org/
>

Will there be a Windows One-Click install for this release?
378bbd0b795e4c53e142f79aa070bec9?d=identicon&s=25 Stephen Sykes (Guest)
on 2008-06-24 15:52
(Received via mailing list)
I notice that ERB is still broken in Ruby 1.8.7.

$ cat test.erb
<% n=1 # make n equal to 1 %>
something
<% n=0 %>
something else
$ ruby -v
ruby 1.8.7 (2008-06-20 patchlevel 22) [i686-darwin9.3.0]
$ erb test.erb

something else
$

The comment in the ruby inside the <% %> seems to comment out all the
non-ruby that follows, until the next <%.

Compare with the old behaviour (on my other machine, but it doesn't
matter):

$ ruby -v
ruby 1.8.6 (2007-09-24 patchlevel 111) [x86_64-linux]
$ erb test.erb
something

something else
$

- Stephen
39b3031f890ad7ce40661614af8b52a6?d=identicon&s=25 Nathan Weizenbaum (nex3)
on 2008-06-25 05:45
(Received via mailing list)
I was under the impression that comments were never allowed in ERB. For
example:

$ ruby -v -rerb -e 'p ERB.new("<% 1 + 1 # test %>foo<% 1 + 1
%>bar").result'
ruby 1.8.6 (2007-09-24 patchlevel 111) [i486-linux]
2

That it worked in your example is an implementation detail.
378bbd0b795e4c53e142f79aa070bec9?d=identicon&s=25 Stephen Sykes (Guest)
on 2008-06-25 07:58
(Received via mailing list)
OK, fair enough, thanks.
6dfe8696eaf911e110635161ee251c19?d=identicon&s=25 Nate Dog (natedog)
on 2008-08-15 17:59
Kornelius Kalnbach wrote:
> Akinori MUSHA wrote:
>> It is my pleasure to announce that Ruby 1.8.7 has just been released.
> thank you!
>
> despite the claim of "some performance improvements" (are they
> documented anywhere?): tests with the CodeRay syntax highlighting
> library - which makes heavy use of StringScanner, Regexp and Hashes -
> run about 20-30% slower than they did with 1.8.6. is anybody else
> experiencing slowdowns, too? any ideas where to look for the bottleneck
> before I profile the whole thing?
>
> [murphy]

I haven't found the bottleneck myself but yes, moving to ruby 1.8.7 has
slowed down all my Ruby on Rails tests.  All together it now takes 100%
longer.  I moved back to 1.8.6 put out by the mod_rails guys:

http://www.rubyenterpriseedition.com/

And the speed of the tests are back to normal.
08f9cb7f1d52e03999973f9b14a4ac57?d=identicon&s=25 Charlie Marx (charliemarx)
on 2009-01-03 19:32
Actually comments will work in 1.8.7, but only with a specific, more
limited syntax than shown in the original example above.

Here is a relevant portion from the inline documentation for ERB:

| ERB recognizes certain tags in the provided template and converts them based on the 
rules below:
|
|   <% Ruby code -- inline with output %>
|   <%= Ruby expression -- replace with result %>
|   <%# comment -- ignored -- useful in testing %>
|   % a line of Ruby code -- treated as <% line %> (optional -- see ERB.new)
|   %% replaced with % if first thing on a line and % processing is used
|   <%% or %%> -- replace with <% or %> respectively

So comments ARE allowed when the whole embedded expression is a comment,
i.e.:

<%# this is good comment %>

<% n=1 # this is a bad comment %>

If your 'bad comments' are consistent in their usage of whitespace
around the hash mark, then it ought to be easy to do a grep
search-and-replace to change all your bad comments to look like this,
which WILL work in Ruby 1.8.7:

<% n=1 %><%# this is the fixed comment %>
47723350c9b0c3918d6c1578b70e2411?d=identicon&s=25 Jordan Brough (jordan-brough)
on 2009-01-28 14:33
Comments aren't supported, only comment tags are.

ruby -v -rerb -e 'p ERB.new("<%# test %>foobar").result'

correctly gives 'foobar'. while

ruby -v -rerb -e 'p ERB.new("<% # test %>foobar").result'

gives an empty string (in 1.8.6 and 1.8.7).

Charlie Marx wrote:
> Actually comments will work in 1.8.7, but only with a specific, more
> limited syntax than shown in the original example above.

>
> So comments ARE allowed when the whole embedded expression is a comment,
>
This topic is locked and can not be replied to.