Parent

Files

Class/Module Index [+]

Quicksearch

Chef::ChefFS::Knife

Public Class Methods

common_options() click to toggle source
# File lib/chef/chef_fs/knife.rb, line 28
def self.common_options
  option :repo_mode,
    :long => '--repo-mode MODE',
    :default => "default",
    :description => "Specifies the local repository layout.  Values: default or full"
end

Public Instance Methods

base_path() click to toggle source
# 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
chef_fs() click to toggle source
# 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
chef_repo() click to toggle source
# File lib/chef/chef_fs/knife.rb, line 46
def chef_repo
  @chef_repo ||= File.expand_path(File.join(Chef::Config.cookbook_path, ".."))
end
format_path(path) click to toggle source
# 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
local_fs() click to toggle source
# File lib/chef/chef_fs/knife.rb, line 63
def local_fs
  @local_fs ||= Chef::ChefFS::FileSystem::ChefRepositoryFileSystemRootDir.new(chef_repo)
end
pattern_args() click to toggle source
# File lib/chef/chef_fs/knife.rb, line 67
def pattern_args
  @pattern_args ||= pattern_args_from(name_args)
end
pattern_args_from(args) click to toggle source
# File lib/chef/chef_fs/knife.rb, line 71
def pattern_args_from(args)
  args.map { |arg| Chef::ChefFS::FilePattern::relative_to(base_path, arg) }.to_a
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.