Skip to content

Commit d029613

Browse files
committed
fix: Remove empty () from PBXFileSystemSynchronizedRootGroup exceptions output
ref: CocoaPods#1012
1 parent 5f77702 commit d029613

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

lib/xcodeproj/project/object/file_system_synchronized_root_group.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,21 @@ def display_name
6868
return path if path
6969
super
7070
end
71+
72+
def to_hash_as(method = :to_hash)
73+
hash_as = super
74+
excluded_keys_for_serialization_when_empty.each do |key|
75+
if !hash_as[key].nil? && hash_as[key].empty?
76+
hash_as.delete(key)
77+
end
78+
end
79+
hash_as
80+
end
81+
82+
# @return [Array<String>] array of keys to exclude from serialization when the value is empty
83+
def excluded_keys_for_serialization_when_empty
84+
%w(exceptions)
85+
end
7186
end
7287
end
7388
end

0 commit comments

Comments
 (0)