File: repo.rb

package info (click to toggle)
librarian-puppet 5.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 512 kB
  • sloc: ruby: 1,428; sh: 37; makefile: 9
file content (38 lines) | stat: -rw-r--r-- 810 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# parent class for githubtarball and forge source Repos
module Librarian
  module Puppet
    module Source
      class Repo

        attr_accessor :source, :name
        private :source=, :name=

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

        def environment
          source.environment
        end

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

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

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

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

      end
    end
  end
end