Sha256: f40da76b2548e9e0c72612d569acecda0ce990927a2af506c7c0b5c963c8aba2

Contents?: true

Size: 616 Bytes

Versions: 247

Compression:

Stored size: 616 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

247 entries across 247 versions & 2 rubygems

Version Path
puppet-5.5.22 lib/puppet/file_serving/mount/modules.rb
puppet-5.5.22-x86-mingw32 lib/puppet/file_serving/mount/modules.rb
puppet-5.5.22-x64-mingw32 lib/puppet/file_serving/mount/modules.rb
puppet-5.5.22-universal-darwin lib/puppet/file_serving/mount/modules.rb
puppet-5.5.21 lib/puppet/file_serving/mount/modules.rb
puppet-5.5.21-x86-mingw32 lib/puppet/file_serving/mount/modules.rb
puppet-5.5.21-x64-mingw32 lib/puppet/file_serving/mount/modules.rb
puppet-5.5.21-universal-darwin lib/puppet/file_serving/mount/modules.rb
puppet-5.5.20 lib/puppet/file_serving/mount/modules.rb
puppet-5.5.20-x86-mingw32 lib/puppet/file_serving/mount/modules.rb
puppet-5.5.20-x64-mingw32 lib/puppet/file_serving/mount/modules.rb
puppet-5.5.20-universal-darwin lib/puppet/file_serving/mount/modules.rb
puppet-5.5.19 lib/puppet/file_serving/mount/modules.rb
puppet-5.5.19-x86-mingw32 lib/puppet/file_serving/mount/modules.rb
puppet-5.5.19-x64-mingw32 lib/puppet/file_serving/mount/modules.rb
puppet-5.5.19-universal-darwin lib/puppet/file_serving/mount/modules.rb
puppet-5.5.18 lib/puppet/file_serving/mount/modules.rb
puppet-5.5.18-x86-mingw32 lib/puppet/file_serving/mount/modules.rb
puppet-6.4.5 lib/puppet/file_serving/mount/modules.rb
puppet-5.5.18-x64-mingw32 lib/puppet/file_serving/mount/modules.rb