--KsGdsel6WgEHnImy
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Jun 02, 2008 at 03:46:53PM +0900, Akinori MUSHA wrote:
> At Mon, 2 Jun 2008 06:37:21 +0900,
> Kirill A. Shutemov wrote:
> > 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
> 
> Hmm, someone should have tested erb without strscan.
> 
> Does this patch work for you?

Yes.

> 
> 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
> 
> 
> --
> Akinori MUSHA / http://akinori.org/



-- 
Regards,  Kirill A. Shutemov
 + Belarus, Minsk
 + ALT Linux Team, http://www.altlinux.com/

--KsGdsel6WgEHnImy
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkhDm9EACgkQbWYnhzC5v6qTZACeI6tVn67tPfgJRz7iz+4E8jPF
voAAoIRTdizKM0MlR4xjaxHCKrrjvH++
^OI
-----END PGP SIGNATURE-----

--KsGdsel6WgEHnImy--