Method: Xcode::Group#create_file
- Defined in:
- lib/xcode/group.rb
#create_file(file_properties) ⇒ FileReference
Add a file to the specified group. Currently the file creation requires the path to the physical file.
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
# File 'lib/xcode/group.rb', line 140 def create_file(file_properties) # This allows both support for the string value or the hash as the parameter file_properties = { 'path' => file_properties } if file_properties.is_a? String # IF the file already exists then we will not create the file with the # parameters that are being supplied, instead we will return what we # found. find_file_by = file_properties['name'] || file_properties['path'] found_or_created_file = exists?(find_file_by).first unless found_or_created_file found_or_created_file = create_child_object FileReference.file(file_properties) end found_or_created_file.supergroup = self found_or_created_file end |