Issue #4986 has been updated by Brad Grzesiak.


Adam Prescott wrote:
> On Thu, Jul 7, 2011 at 6:03 AM, Brad Grzesiak <brad / bendyworks.com> wrote:
>  >
>  > When issuing the following command in irb, it believes it's in the middle of a regexp, rather than returning a string with two slashes:
>  >
>  > ?? ??"#{"//"}"
>  >
>  > While this doesn't seem all that common, it has the same problem with the following string:
>  >
>  > ?? ??"#{Time.now.strftime("%m/%d/%Y")}"
>  >
>  > irb version is: irb 0.9.5(05/04/13)
>  >
>  
>  Works fine for me on a later version of IRB.
>  
>  ruby-1.9.2-p180 :001 > IRB.version
>   => "irb 0.9.6(09/06/30)"
>  ruby-1.9.2-p180 :002 > "#{"//"}"
>   => "//"
>  ruby-1.9.2-p180 :003 > "#{Time.now.strftime("%m/%d/%Y")}"
>   => "07/07/2011"

I've confirmed that the bug does not exist on ruby 1.9.2. The bug only manifests on ruby 1.8.7. I've seen it occur on both -p334 and -p352 (and, incidentally, ree-1.8.7-2010.02).
----------------------------------------
Bug #4986: Parsing bug in irb: "#{"//"}"
http://redmine.ruby-lang.org/issues/4986

Author: Brad Grzesiak
Status: Open
Priority: Normal
Assignee: 
Category: 
Target version: 
ruby -v: ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-darwin10.8.0]


When issuing the following command in irb, it believes it's in the middle of a regexp, rather than returning a string with two slashes:

    "#{"//"}"

While this doesn't seem all that common, it has the same problem with the following string:

    "#{Time.now.strftime("%m/%d/%Y")}"

irb version is: irb 0.9.5(05/04/13)


-- 
http://redmine.ruby-lang.org