Parent

Included Modules

Librarian::Puppet::Source::Forge

Constants

LOCK_NAME

Attributes

environment[RW]
uri[R]

Public Class Methods

from_lock_options(environment, options) click to toggle source
# File lib/librarian/puppet/source/forge.rb, line 210
def from_lock_options(environment, options)
  new(environment, options[:remote], options.reject { |k, v| k == :remote })
end
from_spec_args(environment, uri, options) click to toggle source
# File lib/librarian/puppet/source/forge.rb, line 214
def from_spec_args(environment, uri, options)
  recognised_options = []
  unrecognised_options = options.keys - recognised_options
  unless unrecognised_options.empty?
    raise Error, "unrecognised options: #{unrecognised_options.join(", ")}"
  end

  new(environment, uri, options)
end
lock_name() click to toggle source
# File lib/librarian/puppet/source/forge.rb, line 206
def lock_name
  LOCK_NAME
end
new(environment, uri, options = {}) click to toggle source
# File lib/librarian/puppet/source/forge.rb, line 229
def initialize(environment, uri, options = {})
  self.environment = environment
  @uri = uri
  @cache_path = nil
end

Public Instance Methods

==(other) click to toggle source
# File lib/librarian/puppet/source/forge.rb, line 239
def ==(other)
  other &&
  self.class == other.class &&
  self.uri == other.uri
end
Also aliased as: eql?
cache_path() click to toggle source
# File lib/librarian/puppet/source/forge.rb, line 284
def cache_path
  @cache_path ||= begin
    dir = Digest::MD5.hexdigest(uri)
    environment.cache_path.join("source/puppet/forge/#{dir}")
  end
end
eql?(other) click to toggle source
Alias for: ==
fetch_dependencies(name, version, version_uri) click to toggle source
# File lib/librarian/puppet/source/forge.rb, line 304
def fetch_dependencies(name, version, version_uri)
  repo(name).dependencies(version).map do |k, v|
    v = Requirement.new(v).gem_requirement
    Dependency.new(k, v, nil)
  end
end
fetch_version(name, version_uri) click to toggle source
# File lib/librarian/puppet/source/forge.rb, line 295
def fetch_version(name, version_uri)
  versions = repo(name).versions
  if versions.include? version_uri
    version_uri
  else
    versions.first
  end
end
hash() click to toggle source
# File lib/librarian/puppet/source/forge.rb, line 247
def hash
  self.to_s.hash
end
install!(manifest) click to toggle source
# File lib/librarian/puppet/source/forge.rb, line 266
def install!(manifest)
  manifest.source == self or raise ArgumentError

  name = manifest.name
  version = manifest.version
  install_path = install_path(name)
  repo = repo(name)

  repo.install_version! version, install_path
end
install_path(name) click to toggle source
# File lib/librarian/puppet/source/forge.rb, line 291
def install_path(name)
  environment.install_path.join(name.split('/').last)
end
manifest(name, version, dependencies) click to toggle source
# File lib/librarian/puppet/source/forge.rb, line 277
def manifest(name, version, dependencies)
  manifest = Manifest.new(self, name)
  manifest.version = version
  manifest.dependencies = dependencies
  manifest
end
manifests(name) click to toggle source
# File lib/librarian/puppet/source/forge.rb, line 311
def manifests(name)
  repo(name).manifests
end
pinned?() click to toggle source
# File lib/librarian/puppet/source/forge.rb, line 259
def pinned?
  false
end
to_lock_options() click to toggle source
# File lib/librarian/puppet/source/forge.rb, line 255
def to_lock_options
  {:remote => uri}
end
to_s() click to toggle source
# File lib/librarian/puppet/source/forge.rb, line 235
def to_s
  uri
end
to_spec_args() click to toggle source
# File lib/librarian/puppet/source/forge.rb, line 251
def to_spec_args
  [uri, {}]
end
unpin!() click to toggle source
# File lib/librarian/puppet/source/forge.rb, line 263
def unpin!
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.