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

FFI Puppet::Util::Colors module

    XMLWordPrintable

Details

    • Task
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • PUP 3.7.0
    • None
    • 1
    • Week 2014-5-7 to 2014-5-14, Week 2014-5-21 to 2014-5-28

    Description

      In order to maintain compatibility with ruby 1.9.x, this ticket is about FFI'ing the Puppet::Util::Colors module, so use FFI instead of:

      WriteConsole = Win32API.new( "kernel32", "WriteConsoleW", ['l', 'p', 'l', 'p', 'p'], 'l' )
      

      We should always prefer wide character APIs, and not make assumptions about pointer lengths:

                lpNumberOfCharsWritten = ' ' * 4
      

      Note that none of this code is needed in ruby 2.x, since that ruby version correctly handles unicode characters (such as those used by the puppet module tool), and translation of ANSI escape sequences to the Windows console API. See PUP-1281 for more information.

      Attachments

        Issue Links

          Activity

            People

              rob Rob Reynolds
              josh Josh Cooper
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support