Class: Librarian::Puppet::Source::Repo

Inherits:
Object
  • Object
show all
Defined in:
lib/librarian/puppet/source/repo.rb

Direct Known Subclasses

Forge::Repo, GitHubTarball::Repo

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source, name) ⇒ Repo

Returns a new instance of Repo.



10
11
12
13
# File 'lib/librarian/puppet/source/repo.rb', line 10

def initialize(source, name)
  self.source = source
  self.name = name
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



7
8
9
# File 'lib/librarian/puppet/source/repo.rb', line 7

def name
  @name
end

#sourceObject

Returns the value of attribute source.



7
8
9
# File 'lib/librarian/puppet/source/repo.rb', line 7

def source
  @source
end

Instance Method Details

#cache_pathObject



19
20
21
# File 'lib/librarian/puppet/source/repo.rb', line 19

def cache_path
  @cache_path ||= source.cache_path.join(name)
end

#environmentObject



15
16
17
# File 'lib/librarian/puppet/source/repo.rb', line 15

def environment
  source.environment
end

#vendored?(name, version) ⇒ Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/librarian/puppet/source/repo.rb', line 27

def vendored?(name, version)
  vendored_path(name, version).exist?
end

#vendored_path(name, version) ⇒ Object



31
32
33
# File 'lib/librarian/puppet/source/repo.rb', line 31

def vendored_path(name, version)
  environment.vendor_cache.join("#{name}-#{version}.tar.gz")
end

#version_unpacked_cache_path(version) ⇒ Object



23
24
25
# File 'lib/librarian/puppet/source/repo.rb', line 23

def version_unpacked_cache_path(version)
  cache_path.join(version.to_s)
end