Files

Class/Module Index [+]

Quicksearch

Chef::ChefFS::FileSystem::ChefServerRootDir

Attributes

chef_private_key[R]
chef_server_url[R]
chef_username[R]
environment[R]
repo_mode[R]

Public Class Methods

new(root_name, chef_config, repo_mode) click to toggle source
# File lib/chef/chef_fs/file_system/chef_server_root_dir.rb, line 29
def initialize(root_name, chef_config, repo_mode)
  super("", nil)
  @chef_server_url = chef_config[:chef_server_url]
  @chef_username = chef_config[:node_name]
  @chef_private_key = chef_config[:client_key]
  @environment = chef_config[:environment]
  @repo_mode = repo_mode
  @root_name = root_name
end

Public Instance Methods

api_path() click to toggle source
# File lib/chef/chef_fs/file_system/chef_server_root_dir.rb, line 49
def api_path
  ""
end
can_have_child?(name, is_dir) click to toggle source
# File lib/chef/chef_fs/file_system/chef_server_root_dir.rb, line 57
def can_have_child?(name, is_dir)
  is_dir && children.any? { |child| child.name == name }
end
children() click to toggle source
# File lib/chef/chef_fs/file_system/chef_server_root_dir.rb, line 61
def children
  @children ||= begin
    result = [
      CookbooksDir.new(self),
      DataBagsDir.new(self),
      RestListDir.new("environments", self),
      RestListDir.new("roles", self)
    ]
    if repo_mode == 'everything'
      result += [
        RestListDir.new("clients", self),
        NodesDir.new(self),
        RestListDir.new("users", self)
      ]
    end
    result.sort_by { |child| child.name }
  end
end
path_for_printing() click to toggle source
# File lib/chef/chef_fs/file_system/chef_server_root_dir.rb, line 53
def path_for_printing
  "#{@root_name}/"
end
rest() click to toggle source
# File lib/chef/chef_fs/file_system/chef_server_root_dir.rb, line 45
def rest
  Chef::REST.new(chef_server_url, chef_username, chef_private_key)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.