Class: Xcodeproj::Project::Object::PBXVariantGroup

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

Instance Method Summary collapse

Instance Method Details

#lproj_as_group?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/synx/pbx_variant_group.rb', line 30

def lproj_as_group?
  parent.basename =~ /.+\.lproj$/
end

#sync(group) ⇒ Object

Need to retain *.lproj files on the system



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/synx/pbx_variant_group.rb', line 9

def sync(group)
  ensure_internal_consistency(group)

  file = files.first
  if lproj_as_group?
    FileUtils.mv(file.real_path, work_pathname)
    Synx::Tabber.puts file.real_path.basename.to_s.green
  else
    parent_folder_path = children.first.real_path.parent
    work_destination_pathname = parent.work_pathname

    if parent_folder_path.exist?
      FileUtils.mv(parent_folder_path, work_destination_pathname.realpath)
    end
    Synx::Tabber.puts (parent_folder_path.basename.to_s + "/").green
    Synx::Tabber.increase
    Synx::Tabber.puts file.real_path.basename.to_s.green
    Synx::Tabber.decrease
  end
end