Sha256: 597bc98b3ac7c10f5bf9681880a032e55d15216b4cf364c3ea7c4b8302cd7e94

Contents?: true

Size: 417 Bytes

Versions: 46

Compression:

Stored size: 417 Bytes

Contents

require 'puppet/file_collection'

# A simple module for looking up file paths and indexes
# in a file collection.
module Puppet::FileCollection::Lookup
  attr_accessor :line, :file_index

  def file_collection
    Puppet::FileCollection.collection
  end

  def file=(path)
    @file_index = file_collection.index(path)
  end

  def file
    return nil unless file_index
    file_collection.path(file_index)
  end
end

Version data entries

46 entries across 46 versions & 3 rubygems

Version Path
puppet-2.6.18 lib/puppet/file_collection/lookup.rb
librarian-puppet-0.9.4 vendor/gems/ruby/1.8/gems/puppet-2.7.18/lib/puppet/file_collection/lookup.rb
puppet-2.7.19 lib/puppet/file_collection/lookup.rb
supply_drop-0.11.0 examples/vendored-puppet/vendor/puppet-2.7.8/lib/puppet/file_collection/lookup.rb
librarian-puppet-0.9.3 vendor/gems/ruby/1.8/gems/puppet-2.7.18/lib/puppet/file_collection/lookup.rb
supply_drop-0.10.2 examples/vendored-puppet/vendor/puppet-2.7.8/lib/puppet/file_collection/lookup.rb
puppet-2.7.18 lib/puppet/file_collection/lookup.rb
puppet-2.6.17 lib/puppet/file_collection/lookup.rb
supply_drop-0.10.1 examples/vendored-puppet/vendor/puppet-2.7.8/lib/puppet/file_collection/lookup.rb
supply_drop-0.10.0 examples/vendored-puppet/vendor/puppet-2.7.8/lib/puppet/file_collection/lookup.rb
puppet-2.7.17 lib/puppet/file_collection/lookup.rb
puppet-2.7.16 lib/puppet/file_collection/lookup.rb
puppet-2.7.14 lib/puppet/file_collection/lookup.rb
puppet-2.6.16 lib/puppet/file_collection/lookup.rb
puppet-2.7.13 lib/puppet/file_collection/lookup.rb
puppet-2.6.15 lib/puppet/file_collection/lookup.rb
supply_drop-0.9.0 examples/vendored-puppet/vendor/puppet-2.7.8/lib/puppet/file_collection/lookup.rb
supply_drop-0.8.1 examples/vendored-puppet/vendor/puppet-2.7.8/lib/puppet/file_collection/lookup.rb
supply_drop-0.8.0 examples/vendored-puppet/vendor/puppet-2.7.8/lib/puppet/file_collection/lookup.rb
puppet-2.7.12 lib/puppet/file_collection/lookup.rb