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

Fix problems with Puppet running on Ruby 2.4

    XMLWordPrintable

Details

      • existing tests pass
    • Puppet Developer Experience
    • 2
    • PDE 2017-02-08, PDE 2017-02-22, PDE 2017-03-08
    • Bug Fix
    • Hide
      Ruby 2.4 could not be used with Puppet because in Ruby 2.4 the Fixnum and Bignum classes have been merged into Integer and Puppet explicitly uses Fixnum as Bignum (roughly: Integers larger than 64 bits) is not supported by Puppet other than as an intermediate result in arithmetic.
      Show
      Ruby 2.4 could not be used with Puppet because in Ruby 2.4 the Fixnum and Bignum classes have been merged into Integer and Puppet explicitly uses Fixnum as Bignum (roughly: Integers larger than 64 bits) is not supported by Puppet other than as an intermediate result in arithmetic.
    • No Action
    • covered by existing tests

    Description

      Ruby 2.4 introduces a couple of subtle differences that breaks puppet.

      1. It unifies the Fixnum and Bignum into Integer. This causes problems in several places.

      2. Prior to 2.4.0, the following code would raise an exception "couldn't find HOME" but in 2.4.0, the resolution works even when HOME is nil.

      ENV['HOME'] = nil
      path = File.expand_path('~/tmp')
      

      3. The handling of DateTime.to_time has changed. Prior to 2.4:

      x = DateTime.httpdate('Sat, 03 Feb 2001 04:05:06 GMT').to_time.to_s
      

      would produce a local time such as "2001-02-03 05:05:06 +0100". In 2.4.0, it retains its timezone and produces "2001-02-03 04:05:06 +0000".

      Attachments

        Issue Links

          Activity

            People

              qa qa
              thomas.hallgren Thomas Hallgren
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support