Class: ChefDK::Policyfile::StorageConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/chef-dk/policyfile/storage_config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ StorageConfig

Returns a new instance of StorageConfig.



31
32
33
34
35
36
37
# File 'lib/chef-dk/policyfile/storage_config.rb', line 31

def initialize(options = {})
  @relative_paths_root = Dir.pwd
  @cache_path = CookbookOmnifetch.storage_path
  @policyfile_filename = "<< Policyfile filename not specified >>"
  @policyfile_lock_filename = "<< Policyfile lock filename not specified >>"
  handle_options(options)
end

Instance Attribute Details

#cache_pathObject

Returns the value of attribute cache_path.



26
27
28
# File 'lib/chef-dk/policyfile/storage_config.rb', line 26

def cache_path
  @cache_path
end

#policyfile_filenameObject (readonly)

Returns the value of attribute policyfile_filename.



28
29
30
# File 'lib/chef-dk/policyfile/storage_config.rb', line 28

def policyfile_filename
  @policyfile_filename
end

#policyfile_lock_filenameObject (readonly)

Returns the value of attribute policyfile_lock_filename.



29
30
31
# File 'lib/chef-dk/policyfile/storage_config.rb', line 29

def policyfile_lock_filename
  @policyfile_lock_filename
end

#relative_paths_rootObject

Returns the value of attribute relative_paths_root.



25
26
27
# File 'lib/chef-dk/policyfile/storage_config.rb', line 25

def relative_paths_root
  @relative_paths_root
end

Instance Method Details

#use_policyfile(policyfile_filename) ⇒ Object



39
40
41
42
43
# File 'lib/chef-dk/policyfile/storage_config.rb', line 39

def use_policyfile(policyfile_filename)
  @policyfile_filename = policyfile_filename
  @relative_paths_root = File.dirname(policyfile_filename)
  self
end

#use_policyfile_lock(policyfile_lock_filename) ⇒ Object



45
46
47
48
49
# File 'lib/chef-dk/policyfile/storage_config.rb', line 45

def use_policyfile_lock(policyfile_lock_filename)
  @policyfile_lock_filename = policyfile_lock_filename
  @relative_paths_root = File.dirname(policyfile_lock_filename)
  self
end