File: predefined_loader.rb

package info (click to toggle)
puppet-agent 7.23.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 19,092 kB
  • sloc: ruby: 245,074; sh: 456; makefile: 38; xml: 33
file content (28 lines) | stat: -rw-r--r-- 697 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
module Puppet::Pops::Loader

# A PredefinedLoader is a loader that is manually populated with loaded elements
# before being used. It never loads anything on its own.
#
class PredefinedLoader < BaseLoader
  def find(typed_name)
    nil
  end

  def to_s()
    "(PredefinedLoader '#{loader_name}')"
  end

  # Allows shadowing since this loader is used internally for things like function local types
  # And they should win as there is otherwise a risk that the local types clash with built in types
  # that were added after the function was written, or by resource types loaded by the 3x auto loader.
  #
  def allow_shadowing?
    true
  end

  def synchronize(&block)
    yield
  end
end

end