class Xcodeproj::Project::Object::PBXGroup

Public Instance Methods

child_for_path(path) click to toggle source
# File lib/xcake/xcodeproj_ext/PBXGroup.rb, line 7
def child_for_path(path)
  unless path.kind_of?(Array)
    path = path.split('/').keep_if do |c|
      c != '.'
    end
  end

  child_name = path.shift
  child = children.find { |c| c.display_name == child_name }

  if child.nil?
    child = new_group(child_name)
    child.path = child_name
  end

  if path.empty?
    child
  else
    child.child_for_path(path)
  end
end
dirname() click to toggle source
# File lib/xcake/xcodeproj_ext/PBXGroup.rb, line 29
def dirname
  return '.' if parent.kind_of? Xcake::Xcode::Project
  return '.' if parent.kind_of? PBXProject
  return parent.dirname.to_s if kind_of? PBXVariantGroup

  if display_name
    "#{parent.dirname}/#{display_name}"
  else
    parent.dirname.to_s
  end
end