Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
scpike opened this issue Sep 12, 2014 · 2 comments
Closed

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

scpike opened this issue Sep 12, 2014 · 2 comments
Milestone

Comments

@scpike
Copy link

scpike commented Sep 12, 2014

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" 
@rtyler
Copy link

rtyler commented Aug 7, 2015

This works properly as of JRuby 9k

[15] pry(main)> require 'yaml' 
=> true
[16] pry(main)> YAML.dump('-.')
=> "--- \"-.\"\n"
[17] pry(main)> JRUBY_VERSION
=> "9.0.0.0"
[18] pry(main)> 

@rtyler rtyler closed this as completed Aug 7, 2015
@scpike
Copy link
Author

scpike commented Aug 8, 2015

@rtyler awesome! Thanks for the update.

@enebo enebo added this to the JRuby 9.0.1.0 milestone Aug 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants