Sha256: bf66dfdf553c42d586882f72670345e321e82e93441a620c83976d743765b93c

Contents?: true

Size: 1.16 KB

Versions: 2

Compression:

Stored size: 1.16 KB

Contents

module Xcodeproj
  class Project
    module Object
      class AbstractObject

        def basename
          name || path || Pathname(real_path).basename.to_s
        end

        def referring_groups
          referrers.select { |ref| ref.instance_of?(Xcodeproj::Project::Object::PBXGroup) }
        end

        def work_pathname
          # hierarchy path has a leading '/' that will break path concatenation
          @work_pathname ||= project.work_root_pathname + hierarchy_path[1..-1]
        end

        def ensure_internal_consistency(group)
          @removed_from_groups = []
          if referring_groups.count > 1
            # Files should only have one referring group -- this is an internal consistency issue if there is more than 1.
            # Just remove all referring groups but the one we're syncing with

            referring_groups.each do |rg|
              unless rg == group
                rg.remove_reference(self) unless rg == group
                @removed_from_groups << rg.hierarchy_path
              end
            end

          end
        end

        def sync(group)
          raise NotImplementedError
        end

      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
synx-0.0.54 lib/synx/xcodeproj_ext/project/object/abstract_object.rb
synx-0.0.53 lib/synx/xcodeproj_ext/project/object/abstract_object.rb