Module: Xcode::ProjectReference
- Defined in:
- lib/xcode/project_reference.rb
Instance Method Summary collapse
-
#group(name, options = {}, &block) ⇒ Group
Returns the group specified.
Instance Method Details
#group(name, options = {}, &block) ⇒ Group
Note:
this will attempt to find the paths specified, if it fails to find them it will create one and then continue traversing.
Note:
this path functionality current is only exercised from the project level all groups will treat the path division ‘/` as simply a character.
Returns the group specified. If any part of the group does not exist along the path the group is created. Also paths can be specified to make the traversing of the groups easier.
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/xcode/project_reference.rb', line 26 def group(name, = {},&block) # By default create missing groups along the way = { :create => true }.merge() current_group = main_group # @todo consider this traversing and find/create as a normal procedure when # traversing the project. name.split("/").each do |path_component| found_group = current_group.group(path_component).first if [:create] and found_group.nil? found_group = current_group.create_group(path_component) end current_group = found_group break unless current_group end current_group.instance_eval(&block) if block_given? and current_group current_group end |