lib/garcon/chef/chef_helpers.rb
# Shortcut to return cache path, if you pass in a file it will return
# the file with the cache path.
#
# @example
#   file_cache_path
#     => "/var/chef/cache/"
#
#   file_cache_path 'patch.tar.gz'
#     => "/var/chef/cache/patch.tar.gz"
#
#   file_cache_path "#{node[:name]}-backup.tar.gz"
#     => "/var/chef/cache/c20d24209cc8-backup.tar.gz"
#
# @param [String] args
#   name of file to return path with file
#
# @return [String]
#
# @api public
Shortcut to return cache path, if you pass in a file it will return
the file with the cache path.
Shortcut to return cache path if you pass in a file it will return the file with the cache path .
def file_cache_path(*args)
      if args.nil?
        Chef::Config[:file_cache_path]
      else
        ::File.join(Chef::Config[:file_cache_path], args)
      end
    end
def file_cache_path ( * args ) if args . nil? Chef :: Config [ :file_cache_path ] else :: File . join ( Chef :: Config [ :file_cache_path ] , args ) end end
Shortcut to return cache path, if you pass in a file it will return
the file with the cache path.
Shortcut to return cache path if you pass in a file it will return the file with the cache path .
None
String
args
<not_specific>
<not_specific>
args name of file to return path with file
args name of file to return path with file
example
file_cache_path => "/var/chef/cache/" file_cache_path 'patch.tar.gz' => "/var/chef/cache/patch.tar.gz" file_cache_path "#{node[:name]}-backup.tar.gz" => "/var/chef/cache/c20d24209cc8-backup.tar.gz"
file_cache_path = > " / var / chef / cache / " file_cache_path ' patch . tar . gz ' = > " / var / chef / cache / patch . tar . gz " file_cache_path " # { node [ : name ] } - backup . tar . gz " = > " / var / chef / cache / c20d24209cc8 - backup . tar . gz "
api
None