class Xcodeproj::Project::Object::PBXGroup

def find_subpath(path, should_create = false)

Returns:
  • (Nil) - if the path could not be found and should create is
  • (PBXGroup) - the group if found.

Other tags:
    Note: - The path is matched against the {#display_name} of the groups.

Parameters:
  • should_create (Boolean) --
  • path (String) --
def find_subpath(path, should_create = false)
  return self unless path
  path = path.split('/') unless path.is_a?(Array)
  child_name = path.shift
  child = children.find{ |c| c.display_name == child_name }
  if child.nil?
    if should_create
      child = new_group(child_name)
    else
      return nil
    end
  end
  if path.empty?
    child
  else
    child.find_subpath(path, should_create)
  end
end