class Librarian::Puppet::Source::GitHubTarball
Constants
- LOCK_NAME
Attributes
Public Class Methods
Source
# File lib/librarian/puppet/source/githubtarball.rb, line 20 def from_lock_options(environment, options) new(environment, options[:remote], options.reject { |k, _v| k == :remote }) end
Source
# File lib/librarian/puppet/source/githubtarball.rb, line 24 def from_spec_args(environment, uri, options) recognised_options = [] unrecognised_options = options.keys - recognised_options raise Error, "unrecognised options: #{unrecognised_options.join(', ')}" unless unrecognised_options.empty? new(environment, uri, options) end
Source
# File lib/librarian/puppet/source/githubtarball.rb, line 16 def lock_name LOCK_NAME end
Source
# File lib/librarian/puppet/source/githubtarball.rb, line 37 def initialize(environment, uri, _options = {}) self.environment = environment @uri = URI.parse(uri) @cache_path = nil end
Public Instance Methods
Source
# File lib/librarian/puppet/source/githubtarball.rb, line 47 def ==(other) other && self.class == other.class && uri == other.uri end
Also aliased as: eql?
Source
# File lib/librarian/puppet/source/githubtarball.rb, line 93 def cache_path @cache_path ||= environment.cache_path.join("source/puppet/githubtarball/#{uri.host}#{uri.path}") end
Source
# File lib/librarian/puppet/source/githubtarball.rb, line 110 def fetch_dependencies(_name, _version, _version_uri) {} end
Source
# File lib/librarian/puppet/source/githubtarball.rb, line 101 def fetch_version(name, version_uri) versions = repo(name).versions if versions.include? version_uri version_uri else versions.first end end
Source
# File lib/librarian/puppet/source/githubtarball.rb, line 73 def install!(manifest) manifest.source == self or raise ArgumentError debug { "Installing #{manifest}" } name = manifest.name version = manifest.version install_path = install_path(name) repo = repo(name) repo.install_version! version, install_path end
Source
# File lib/librarian/puppet/source/githubtarball.rb, line 97 def install_path(name) environment.install_path.join(module_name(name)) end
Source
# File lib/librarian/puppet/source/githubtarball.rb, line 86 def manifest(name, version, dependencies) manifest = Manifest.new(self, name) manifest.version = version manifest.dependencies = dependencies manifest end
Source
# File lib/librarian/puppet/source/githubtarball.rb, line 114 def manifests(name) repo(name).manifests end
Source
# File lib/librarian/puppet/source/githubtarball.rb, line 67 def pinned? false end
Source
# File lib/librarian/puppet/source/githubtarball.rb, line 63 def to_lock_options { remote: clean_uri(uri).to_s } end
Source
# File lib/librarian/puppet/source/githubtarball.rb, line 43 def to_s clean_uri(uri).to_s end
Source
# File lib/librarian/puppet/source/githubtarball.rb, line 59 def to_spec_args [clean_uri(uri).to_s, {}] end
Private Instance Methods
Source
# File lib/librarian/puppet/source/githubtarball.rb, line 120 def repo(name) @repo ||= {} @repo[name] ||= Repo.new(self, name) end