Sha256: afa58c3b35f1e6b9add8d46d8d673cb40d45369641a4aaf2f1f8b91a01fd2f54

Contents?: true

Size: 635 Bytes

Versions: 148

Compression:

Stored size: 635 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)
    raise _("No module specified") if path.to_s.empty?
    module_name, relative_path = path.split("/", 2)
    mod = request.environment.module(module_name)
    return nil unless mod

    mod.file(relative_path)
  end

  def search(path, request)
    result = find(path, request)
    if result
      [result]
    end
  end

  def valid?
    true
  end
end

Version data entries

148 entries across 148 versions & 1 rubygems

Version Path
puppet-6.29.0 lib/puppet/file_serving/mount/modules.rb
puppet-6.29.0-x86-mingw32 lib/puppet/file_serving/mount/modules.rb
puppet-6.29.0-x64-mingw32 lib/puppet/file_serving/mount/modules.rb
puppet-6.29.0-universal-darwin lib/puppet/file_serving/mount/modules.rb
puppet-6.28.0 lib/puppet/file_serving/mount/modules.rb
puppet-6.28.0-x86-mingw32 lib/puppet/file_serving/mount/modules.rb
puppet-6.28.0-x64-mingw32 lib/puppet/file_serving/mount/modules.rb
puppet-6.28.0-universal-darwin lib/puppet/file_serving/mount/modules.rb
puppet-6.27.0 lib/puppet/file_serving/mount/modules.rb
puppet-6.27.0-x86-mingw32 lib/puppet/file_serving/mount/modules.rb
puppet-6.27.0-x64-mingw32 lib/puppet/file_serving/mount/modules.rb
puppet-6.27.0-universal-darwin lib/puppet/file_serving/mount/modules.rb
puppet-6.26.0 lib/puppet/file_serving/mount/modules.rb
puppet-6.26.0-x86-mingw32 lib/puppet/file_serving/mount/modules.rb
puppet-6.26.0-x64-mingw32 lib/puppet/file_serving/mount/modules.rb
puppet-6.26.0-universal-darwin lib/puppet/file_serving/mount/modules.rb
puppet-6.25.1 lib/puppet/file_serving/mount/modules.rb
puppet-6.25.1-x86-mingw32 lib/puppet/file_serving/mount/modules.rb
puppet-6.25.1-x64-mingw32 lib/puppet/file_serving/mount/modules.rb
puppet-6.25.1-universal-darwin lib/puppet/file_serving/mount/modules.rb