Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-9313

String#to_yaml behaves differently with ruby 2.4.5-1 and 2.5.3-1 on Windows

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Done
    • None
    • None
    • None
    • Platform OS
    • Platform OS Kanban
    • Needs Assessment
    • Needs Assessment

    Description

      Ruby released bug+security fixes in ruby 2.4.5p335 and 2.5.3p105. For some reason, the Windows versions no longer emit the YAML document end tag (aka triple dots).

      Given yaml.rb containing:

      require 'yaml'
       
      puts "Ruby #{RUBY_VERSION}p#{RUBY_PATCHLEVEL}"
      puts "Psych #{Psych::VERSION}"
      puts "string".to_yaml
      

      C:\>c:\rubyinstaller-2.4.5-1-x64\bin\ruby.exe yaml.rb
      Ruby 2.4.5p335
      Psych 2.2.2
      --- string
      C:\>c:\rubyinstaller-2.5.3-1-x64\bin\ruby.exe yaml.rb
      Ruby 2.5.3p105
      Psych 3.0.2
      --- string
      

      The preceding ruby versions do emit triple dots:

      C:\>c:\rubyinstaller-2.4.4-2-x64\bin\ruby.exe yaml.rb
      Ruby 2.4.4p296
      Psych 2.2.2
      --- string
      ...
      C:\>c:\rubyinstaller-2.5.1-2-x64\bin\ruby.exe yaml.rb
      Ruby 2.5.1p57
      Psych 3.0.2
      --- string
      ...
      

      All of the ruby versions on mac (using rbenv) do emit triple dots consistently:

      $ ruby yaml.rb
      Ruby 2.4.4p296
      Psych 2.2.2
      --- string
      ...
      $ ruby yaml.rb
      Ruby 2.4.5p335
      Psych 2.2.2
      --- string
      ...
      $ ruby yaml.rb
      Ruby 2.5.1p57
      Psych 3.0.2
      --- string
      ...
      $ ruby yaml.rb
      Ruby 2.5.3p105
      Psych 3.0.2
      --- string
      ...
      

      Attachments

        Issue Links

          Activity

            People

              casey.williams Casey Williams
              josh Josh Cooper
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support