Class: Puppet::FileServing::Mount::Modules
- Inherits:
-
Puppet::FileServing::Mount
- Object
- Puppet::FileServing::Mount
- Puppet::FileServing::Mount::Modules
- Defined in:
- lib/puppet/file_serving/mount/modules.rb
Overview
This is the modules-specific mount: it knows how to search through modules for files. Yay.
Instance Attribute Summary
Attributes inherited from Puppet::FileServing::Mount
Instance Method Summary collapse
-
#find(path, request) ⇒ Object
Return an instance of the appropriate class.
- #search(path, request) ⇒ Object
- #valid? ⇒ Boolean
Methods inherited from Puppet::FileServing::Mount
Methods included from Util::Logging
#clear_deprecation_warnings, #debug, #deprecation_warning, #format_backtrace, #format_exception, #get_deprecation_offender, #log_and_raise, #log_deprecations_to_file, #log_exception, #puppet_deprecation_warning, #send_log, setup_facter_logging!, #warn_once
Constructor Details
This class inherits a constructor from Puppet::FileServing::Mount
Instance Method Details
#find(path, request) ⇒ Object
Return an instance of the appropriate class.
9 10 11 12 13 14 15 16 17 |
# File 'lib/puppet/file_serving/mount/modules.rb', line 9 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 |
#search(path, request) ⇒ Object
19 20 21 22 23 24 |
# File 'lib/puppet/file_serving/mount/modules.rb', line 19 def search(path, request) result = find(path, request) if result [result] end end |
#valid? ⇒ Boolean
26 27 28 |
# File 'lib/puppet/file_serving/mount/modules.rb', line 26 def valid? true end |