Sha256: 257440bba49d35f0de9961260bf75f61f160d6b040a5df33ac9247037b066d03

Contents?: true

Size: 828 Bytes

Versions: 649

Compression:

Stored size: 828 Bytes

Contents

require 'puppet/property/list'

module Puppet
  class Property
    # This subclass of {Puppet::Property} manages an ordered list of values.
    # The maintained order is the order defined by the 'current' set of values (i.e. the
    # original order is not disrupted). Any additions are added after the current values
    # in their given order).
    #
    # For an unordered list see {Puppet::Property::List}.
    #
    class OrderedList < List

      def add_should_with_current(should, current)
        if current.is_a?(Array)
          #tricky trick
          #Preserve all the current items in the list
          #but move them to the back of the line
          should = should + (current - should)
        end
        should
      end

      def dearrayify(array)
        array.join(delimiter)
      end
    end
  end
end

Version data entries

649 entries across 649 versions & 3 rubygems

Version Path
puppet-3.8.1-x86-mingw32 lib/puppet/property/ordered_list.rb
puppet-3.8.1-x64-mingw32 lib/puppet/property/ordered_list.rb
puppet-4.1.0 lib/puppet/property/ordered_list.rb
puppet-4.1.0-x86-mingw32 lib/puppet/property/ordered_list.rb
puppet-4.1.0-x64-mingw32 lib/puppet/property/ordered_list.rb
puppet-4.0.0 lib/puppet/property/ordered_list.rb
puppet-4.0.0-x86-mingw32 lib/puppet/property/ordered_list.rb
puppet-4.0.0-x64-mingw32 lib/puppet/property/ordered_list.rb
puppet-3.7.5 lib/puppet/property/ordered_list.rb
puppet-3.7.5-x86-mingw32 lib/puppet/property/ordered_list.rb
puppet-3.7.5-x64-mingw32 lib/puppet/property/ordered_list.rb
puppet-4.0.0.rc1 lib/puppet/property/ordered_list.rb
puppet-4.0.0.rc1-x86-mingw32 lib/puppet/property/ordered_list.rb
puppet-4.0.0.rc1-x64-mingw32 lib/puppet/property/ordered_list.rb
puppet-3.7.4 lib/puppet/property/ordered_list.rb
puppet-3.7.4-x86-mingw32 lib/puppet/property/ordered_list.rb
puppet-3.7.4-x64-mingw32 lib/puppet/property/ordered_list.rb
puppet-3.7.3 lib/puppet/property/ordered_list.rb
puppet-3.7.3-x86-mingw32 lib/puppet/property/ordered_list.rb
puppet-3.7.3-x64-mingw32 lib/puppet/property/ordered_list.rb