JRuby

Argument Error when loading a YAML file that contains an asterisk character.

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: JRuby 1.1
  • Fix Version/s: JRuby 1.1.3
  • Component/s: None
  • Labels:
    None
  • Environment:
    MAC OSX Leopard, JDK 1.5.0_13, JRUBY 1.1, ruby 1.8.6 (2008-04-18 rev 6423) [i386-jruby1.1+]
  • Testcase included:
    yes
  • Number of attachments :
    3

Description

I have a simple YML file that I am trying to load that contains asterisks. It works fine in Ruby 1.8.6, but if I try and load it with JRuby I get the following exception with that test case.

ScannerException while scanning an alias we had this expected alphabetic or numeric character, but found something else...

Please see the attached files that run the test and the two example yml files, one that contains asterisks and another that does not.

bernie:jrubytest justin$ ruby -v
ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-darwin8.9.1]
bernie:jrubytest justin$ spec load.rb
..

Finished in 0.006037 seconds

2 examples, 0 failures

bernie:jrubytest justin$ jruby -v
ruby 1.8.6 (2008-04-18 rev 6423) [i386-jruby1.1+]

bernie:jrubytest justin$ jruby -S spec load.rb
F.

1)
ArgumentError in 'when first created tries to parse a YML file with asterisks successfully'
ScannerException while scanning an alias we had this expected alphabetic or numeric character, but found something else...

Finished in 0.133 seconds

2 examples, 1 failure

  1. asterisk.yml
    18/Apr/08 9:36 AM
    0.3 kB
    Justin Grammens
  2. load.rb
    18/Apr/08 9:36 AM
    0.3 kB
    Justin Grammens
  3. noasterisk.yml
    18/Apr/08 9:36 AM
    0.2 kB
    Justin Grammens

Activity

Hide
Nick Sieger added a comment -

There's obviously a difference between Syck and JvYAML in the way they handle the asterisk character. Until the matter is resolved, you can work around this issue by enclosing the *.rb in quotes or double-quotes. Both YAML engines should handle that properly.

Show
Nick Sieger added a comment - There's obviously a difference between Syck and JvYAML in the way they handle the asterisk character. Until the matter is resolved, you can work around this issue by enclosing the *.rb in quotes or double-quotes. Both YAML engines should handle that properly.
Hide
Justin Grammens added a comment -

Good idea. Yep, that seems to work. Thanks.

Show
Justin Grammens added a comment - Good idea. Yep, that seems to work. Thanks.
Hide
Ola Bini added a comment -

Fixed on trunk.

Show
Ola Bini added a comment - Fixed on trunk.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: