Class: Librarian::Puppet::Environment

Inherits:
Environment
  • Object
show all
Defined in:
lib/librarian/puppet/environment.rb

Instance Method Summary collapse

Instance Method Details

#adapter_nameObject



10
11
12
# File 'lib/librarian/puppet/environment.rb', line 10

def adapter_name
  "puppet"
end

#cache_pathObject



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

def cache_path
  project_path.join(".tmp/librarian/cache")
end

#install_pathObject



14
15
16
17
# File 'lib/librarian/puppet/environment.rb', line 14

def install_path
  part = config_db["path"] || "modules"
  project_path.join(part)
end

#local?Boolean

Returns:

  • (Boolean)


48
49
50
# File 'lib/librarian/puppet/environment.rb', line 48

def local?
  config_db['mode'] == 'local'
end

#scratch_pathObject



35
36
37
# File 'lib/librarian/puppet/environment.rb', line 35

def scratch_path
  project_path.join(".tmp/librarian/scratch")
end

#vendor!Object



39
40
41
42
# File 'lib/librarian/puppet/environment.rb', line 39

def vendor!
  vendor_cache.mkpath  unless vendor_cache.exist?
  vendor_source.mkpath unless vendor_source.exist?
end

#vendor?Boolean

Returns:

  • (Boolean)


44
45
46
# File 'lib/librarian/puppet/environment.rb', line 44

def vendor?
  vendor_path.exist?
end

#vendor_cacheObject



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

def vendor_cache
  vendor_path.join('cache')
end

#vendor_pathObject



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

def vendor_path
  project_path.join('vendor/puppet')
end

#vendor_sourceObject



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

def vendor_source
  vendor_path.join('source')
end