Skip to content

JRuby Yaml implementation (psych) fails dumping "-."  #1968

@scpike

Description

@scpike

I'm not sure whether this belongs here or on the psych project, since I think work is still underway to move the jruby implementation under that umbrella.

Under jruby-1.7.13:

require 'yaml'
YAML.dump('-.')

ArgumentError: invalid value for Float(): "-"
    from org/jruby/RubyKernel.java:448:in `Float'
    from /Users/scpike/.rvm/rubies/jruby-1.7.13/lib/ruby/shared/psych/scalar_scanner.rb:99:in `tokenize'
    from /Users/scpike/.rvm/rubies/jruby-1.7.13/lib/ruby/shared/psych/visitors/yaml_tree.rb:272:in `visit_String'
    from /Users/scpike/.rvm/rubies/jruby-1.7.13/lib/ruby/shared/psych/visitors/yaml_tree.rb:128:in `accept'
    from /Users/scpike/.rvm/rubies/jruby-1.7.13/lib/ruby/shared/psych/visitors/yaml_tree.rb:92:in `push'
    from /Users/scpike/.rvm/rubies/jruby-1.7.13/lib/ruby/shared/psych.rb:244:in `dump'
    from (irb):2:in `evaluate'
    from org/jruby/RubyKernel.java:1101:in `eval'
    from org/jruby/RubyKernel.java:1501:in `loop'
    from org/jruby/RubyKernel.java:1264:in `catch'
    from org/jruby/RubyKernel.java:1264:in `catch'
    from /Users/scpike/.rvm/rubies/jruby-1.7.13/bin/irb:13:in `(root)'

Here's MRI 2.1.0

2.1.0 :001 > require 'yaml'
 => true 
2.1.0 :002 > YAML.dump('-.')
 => "--- \"-.\"\n" 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions