Method: Puppet::Environments::Cached#guard

Defined in:
lib/puppet/environments.rb

#guard(name) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Guard an environment so it can’t be evicted while it’s in use. The method may be called multiple times, provided it is unguarded the same number of times. If you call this method, you must call ‘unguard` in an ensure block.



502
503
504
505
# File 'lib/puppet/environments.rb', line 502

def guard(name)
  entry = get_entry(name, false)
  entry.guard if entry
end