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

Deprecate Symbol#<=> monkey patch

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • PUP 4.5.0
    • None
    • None
    • Bug Fix
    • Comparing symbols to strings (or other types) in Ruby code is deprecated. This functionality was provided by a monkey patch in a ruby dependency that Puppet no longer requires.

    Description

      We restored the Symbol#<=> monkey patch in PUP-5962 because our version behaves differently from ruby 1.9.3 and up:

      Puppet:

      irb(main):005:0> :a <=> 'a'
      => 0
      

      Ruby:

      irb(main):003:0> :a <=> 'a'
      => nil
      

      This ticket is to deprecate puppet's behavior when comparing against non-Symbols. Ideally this could be done when strict mode is enabled and Symbol#<=>(other) is called, but other is not a Symbol.

      There could be performance implications of adding that check, and it may uncover other parts of puppet that rely on the deprecated behavior, like http://projects.puppetlabs.com/issues/5466. Those will need to be fixed also.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              josh Josh Cooper
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support