Class: Xcodeproj::Project::Object::PBXGroup

Inherits:
Object
  • Object
show all
Defined in:
lib/synx/pbx_group.rb

Instance Method Summary collapse

Instance Method Details

#all_groupsObject



53
54
55
# File 'lib/synx/pbx_group.rb', line 53

def all_groups
  groups | version_groups | variant_groups
end

#excluded_from_sync?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/synx/pbx_group.rb', line 26

def excluded_from_sync?
  project.group_exclusions.include?(hierarchy_path)
end

#groups_containing_forward_slashObject



123
124
125
126
127
128
129
130
131
132
# File 'lib/synx/pbx_group.rb', line 123

def groups_containing_forward_slash
  found_groups = []
  groups.each do |group|
    unless group.excluded_from_sync?
      found_groups << group if group.basename.include?("/")
      found_groups |= group.groups_containing_forward_slash
    end
  end
  found_groups
end

#move_entries_not_in_xcodeprojObject



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/synx/pbx_group.rb', line 30

def move_entries_not_in_xcodeproj
  if excluded_from_sync?
    Synx::Tabber.puts "#{basename}/ (excluded)".yellow
  else
    Synx::Tabber.puts "#{basename}/".green
    Synx::Tabber.increase
    Dir[real_path.to_s + "/{*,.*}"].reject { |e| %W(. ..).include?(Pathname(e).basename.to_s) }.each do |entry|
      entry_pathname = real_path + entry
      unless project.has_object_for_pathname?(entry_pathname)
        handle_unused_entry(entry_pathname)
      end
    end
    all_groups.each(&:move_entries_not_in_xcodeproj)
    Synx::Tabber.decrease
  end
end

#sync(group) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/synx/pbx_group.rb', line 8

def sync(group)
  ensure_internal_consistency(group)
  if excluded_from_sync?
    Synx::Tabber.puts "#{basename}/ (excluded)".yellow
  else
    Synx::Tabber.puts "#{basename}/".green
    Synx::Tabber.increase

    squash_duplicate_file_references
    work_pathname.mkpath
    files.each { |pbx_file| pbx_file.sync(self) }
    all_groups.each { |group| group.sync(self) }
    sync_path

    Synx::Tabber.decrease
  end
end