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

#ephemeral_lockfileObject



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

def ephemeral_lockfile
  Lockfile.new(self, nil)
end

#git_destructiveObject



65
66
67
# File 'lib/librarian/puppet/environment.rb', line 65

def git_destructive
  config_db['git-destructive'].to_s == 'false' ? false : true
end

#install_pathObject



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

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

#local?Boolean

Returns:

  • (Boolean)


53
54
55
# File 'lib/librarian/puppet/environment.rb', line 53

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

#lockfileObject



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

def lockfile
  Lockfile.new(self, lockfile_path)
end

#tmp_pathObject



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

def tmp_path
  part = config_db["tmp"] || ".tmp"
  project_path.join(part)
end

#use_forgeObject



61
62
63
# File 'lib/librarian/puppet/environment.rb', line 61

def use_forge
  config_db['use-forge'].to_s == 'false' ? false : true
end

#use_v1_apiObject



57
58
59
# File 'lib/librarian/puppet/environment.rb', line 57

def use_v1_api
  config_db['use-v1-api']
end

#vendor!Object



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

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

#vendor?Boolean

Returns:

  • (Boolean)


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

def vendor?
  vendor_path.exist?
end

#vendor_cacheObject



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

def vendor_cache
  vendor_path.join('cache')
end

#vendor_pathObject



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

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

#vendor_sourceObject



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

def vendor_source
  vendor_path.join('source')
end

#verbose?Boolean

Returns:

  • (Boolean)


69
70
71
# File 'lib/librarian/puppet/environment.rb', line 69

def verbose?
  config_db['verbose'].to_s == 'false' ? false : true
end