Sha256: f0465e96517fff836cc0c5d7d0d8fa90a446a318ddbf023970545d381560b2f2
Contents?: true
Size: 737 Bytes
Versions: 737
Compression:
Stored size: 737 Bytes
Contents
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
Version data entries
737 entries across 737 versions & 3 rubygems