# File lib/chef/chef_fs/knife.rb, line 35 def base_path @base_path ||= begin relative_to_base = Chef::ChefFS::PathUtils::relative_to(File.expand_path(Dir.pwd), chef_repo) relative_to_base == '.' ? '/' : "/#{relative_to_base}" end end
# File lib/chef/chef_fs/knife.rb, line 42 def chef_fs @chef_fs ||= Chef::ChefFS::FileSystem::ChefServerRootDir.new("remote", Chef::Config, config[:repo_mode]) end
# File lib/chef/chef_fs/knife.rb, line 46 def chef_repo @chef_repo ||= File.expand_path(File.join(Chef::Config.cookbook_path, "..")) end
# File lib/chef/chef_fs/knife.rb, line 50 def format_path(path) if path[0,base_path.length] == base_path if path == base_path return "." elsif path[base_path.length] == "/" return path[base_path.length + 1, path.length - base_path.length - 1] elsif base_path == "/" && path[0] == "/" return path[1, path.length - 1] end end path end
# File lib/chef/chef_fs/knife.rb, line 63 def local_fs @local_fs ||= Chef::ChefFS::FileSystem::ChefRepositoryFileSystemRootDir.new(chef_repo) end
Generated with the Darkfish Rdoc Generator 2.