Sha256: 7ae3266ec46aeab3bde8a08fee2d5507e5d6714bceb2054f914fce37e802c7a1

Contents?: true

Size: 613 Bytes

Versions: 294

Compression:

Stored size: 613 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)
    return nil unless mod = request.environment.module(module_name)

    mod.file(relative_path)
  end

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

  def valid?
    true
  end
end

Version data entries

294 entries across 294 versions & 4 rubygems

Version Path
puppet-4.7.1-x64-mingw32 lib/puppet/file_serving/mount/modules.rb
puppet-4.7.1-universal-darwin lib/puppet/file_serving/mount/modules.rb
puppet-4.8.1 lib/puppet/file_serving/mount/modules.rb
puppet-4.8.1-x86-mingw32 lib/puppet/file_serving/mount/modules.rb
puppet-4.8.1-x64-mingw32 lib/puppet/file_serving/mount/modules.rb
puppet-4.8.1-universal-darwin lib/puppet/file_serving/mount/modules.rb
puppet-4.8.0 lib/puppet/file_serving/mount/modules.rb
puppet-4.8.0-x86-mingw32 lib/puppet/file_serving/mount/modules.rb
puppet-4.8.0-x64-mingw32 lib/puppet/file_serving/mount/modules.rb
puppet-4.8.0-universal-darwin lib/puppet/file_serving/mount/modules.rb
puppet-retrospec-1.2.1 vendor/gems/puppet-4.5.2/lib/puppet/file_serving/mount/modules.rb
puppet-retrospec-1.2.0 vendor/gems/puppet-4.5.2/lib/puppet/file_serving/mount/modules.rb
puppet-4.7.0 lib/puppet/file_serving/mount/modules.rb
puppet-4.7.0-x86-mingw32 lib/puppet/file_serving/mount/modules.rb
puppet-4.7.0-x64-mingw32 lib/puppet/file_serving/mount/modules.rb
puppet-4.7.0-universal-darwin lib/puppet/file_serving/mount/modules.rb
puppet-4.6.2 lib/puppet/file_serving/mount/modules.rb
puppet-4.6.2-x86-mingw32 lib/puppet/file_serving/mount/modules.rb
puppet-4.6.2-x64-mingw32 lib/puppet/file_serving/mount/modules.rb
puppet-4.6.2-universal-darwin lib/puppet/file_serving/mount/modules.rb