Sha256: e2830e814394cb74864f0b6e23100ad798304e4ec3e7934cf2ccdc41401f8c0c

Contents?: true

Size: 683 Bytes

Versions: 20

Compression:

Stored size: 683 Bytes

Contents

# frozen_string_literal: true
require_relative '../../../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

20 entries across 20 versions & 1 rubygems

Version Path
puppet-8.3.0 lib/puppet/file_serving/mount/modules.rb
puppet-8.3.0-x86-mingw32 lib/puppet/file_serving/mount/modules.rb
puppet-8.3.0-x64-mingw32 lib/puppet/file_serving/mount/modules.rb
puppet-8.3.0-universal-darwin lib/puppet/file_serving/mount/modules.rb
puppet-8.3.1 lib/puppet/file_serving/mount/modules.rb
puppet-8.3.1-x86-mingw32 lib/puppet/file_serving/mount/modules.rb
puppet-8.3.1-x64-mingw32 lib/puppet/file_serving/mount/modules.rb
puppet-8.3.1-universal-darwin lib/puppet/file_serving/mount/modules.rb
puppet-8.2.0 lib/puppet/file_serving/mount/modules.rb
puppet-8.2.0-x86-mingw32 lib/puppet/file_serving/mount/modules.rb
puppet-8.2.0-x64-mingw32 lib/puppet/file_serving/mount/modules.rb
puppet-8.2.0-universal-darwin lib/puppet/file_serving/mount/modules.rb
puppet-8.1.0 lib/puppet/file_serving/mount/modules.rb
puppet-8.1.0-x86-mingw32 lib/puppet/file_serving/mount/modules.rb
puppet-8.1.0-x64-mingw32 lib/puppet/file_serving/mount/modules.rb
puppet-8.1.0-universal-darwin lib/puppet/file_serving/mount/modules.rb
puppet-8.0.1 lib/puppet/file_serving/mount/modules.rb
puppet-8.0.1-x86-mingw32 lib/puppet/file_serving/mount/modules.rb
puppet-8.0.1-x64-mingw32 lib/puppet/file_serving/mount/modules.rb
puppet-8.0.1-universal-darwin lib/puppet/file_serving/mount/modules.rb