/usr/share/puppet/modules.available/puppetlabs-inifile/lib/puppet/util/external_iterator.rb is in puppet-module-puppetlabs-inifile 1.6.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | module Puppet
module Util
class ExternalIterator
def initialize(coll)
@coll = coll
@cur_index = -1
end
def next
@cur_index = @cur_index + 1
item_at(@cur_index)
end
def peek
item_at(@cur_index + 1)
end
private
def item_at(index)
if @coll.length > index
[@coll[index], index]
else
[nil, nil]
end
end
end
end
end
|