Sha256: a772f6a405b46cca44d257739647faa34dc311a0597921a3c812366f51dbc29f

Contents?: true

Size: 740 Bytes

Versions: 6

Compression:

Stored size: 740 Bytes

Contents

require 'puppet/file_serving/mount'

# This is the modules-specific mount: it knows how to search through
# modules for files.  Yay.
class Puppet::FileServing::Mount::Modules < Puppet::FileServing::Mount
    # Return an instance of the appropriate class.
    def find(path, request)
        module_name, relative_path = path.split("/", 2)
        return nil unless mod = request.environment.module(module_name)

        mod.file(relative_path)
    end

    def search(path, request)
        module_name, relative_path = path.split("/", 2)
        return nil unless mod = request.environment.module(module_name)

        return nil unless path = mod.file(relative_path)
        return [path]
    end

    def valid?
        true
    end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
puppet-0.25.5 lib/puppet/file_serving/mount/modules.rb
puppet-0.25.4 lib/puppet/file_serving/mount/modules.rb
puppet-0.25.3 lib/puppet/file_serving/mount/modules.rb
puppet-0.25.2 lib/puppet/file_serving/mount/modules.rb
puppet-0.25.1 lib/puppet/file_serving/mount/modules.rb
puppet-0.25.0 lib/puppet/file_serving/mount/modules.rb