class Chef::ChefFS::FileSystem::ChefServer::CookbookSubdir

Attributes

children[R]
versions[R]

Public Class Methods

new(name, parent, ruby_only, recursive) click to toggle source
# File lib/chef/chef_fs/file_system/chef_server/cookbook_subdir.rb, line 26
def initialize(name, parent, ruby_only, recursive)
  super(name, parent)
  @children = []
  @ruby_only = ruby_only
  @recursive = recursive
end

Public Instance Methods

add_child(child) click to toggle source
# File lib/chef/chef_fs/file_system/chef_server/cookbook_subdir.rb, line 36
def add_child(child)
  @children << child
end
can_have_child?(name, is_dir) click to toggle source
# File lib/chef/chef_fs/file_system/chef_server/cookbook_subdir.rb, line 40
def can_have_child?(name, is_dir)
  if is_dir
    return false if !@recursive
  else
    return false if @ruby_only && name !~ /\.rb$/
  end
  true
end
make_child_entry(name) click to toggle source
# File lib/chef/chef_fs/file_system/chef_server/cookbook_subdir.rb, line 49
def make_child_entry(name)
  result = @children.find { |child| child.name == name } if @children
  result || NonexistentFSObject.new(name, self)
end
rest() click to toggle source
# File lib/chef/chef_fs/file_system/chef_server/cookbook_subdir.rb, line 54
def rest
  parent.rest
end