MMCT TEAM
Server IP : 111.118.215.189  /  Your IP : 18.217.207.112
Web Server : Apache
System : Linux md-in-83.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : a1673wkz ( 2475)
PHP Version : 8.2.25
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /usr/share/ruby/vendor_ruby/puppet/pops/loader/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //usr/share/ruby/vendor_ruby/puppet/pops/loader/uri_helper.rb
module Puppet::Pops::Loader::UriHelper
  # Raises an exception if specified gem can not be located
  #
  def path_for_uri(uri, subdir='lib')
    case uri.scheme
    when "gem"
      begin
        spec = Gem::Specification.find_by_name(uri.hostname)
        # if path given append that, else append given subdir
        File.join(spec.gem_dir, uri.path.empty?() ? subdir : uri.path)
      rescue StandardError => e
        raise "TODO TYPE: Failed to located gem #{uri}. #{e.message}"
      end
    when "file"
      File.join(uri.path, subdir)
    when nil
      File.join(uri.path, subdir)
    else
      raise "Not a valid scheme for a loader: #{uri.scheme}. Use a 'file:' (or just a path), or 'gem://gemname[/path]"
    end
  end
end

MMCT - 2023