lib/cocoapods-ppbuild/Integration.rb in cocoapods-ppbuild-1.0.6 vs lib/cocoapods-ppbuild/Integration.rb in cocoapods-ppbuild-1.0.9

- old
+ new

@@ -288,17 +288,33 @@ # phase and saved in the framework folder. We will treat it as a normal resource # file. if spec.attributes_hash["resource_bundles"] bundle_names = spec.attributes_hash["resource_bundles"].keys - spec.attributes_hash["resource_bundles"] = nil - spec.attributes_hash["resources"] ||= [] - spec.attributes_hash["resources"] += bundle_names.map{|n| n+".bundle"} + spec.attributes_hash["resource_bundles"] = nil + resources_list = spec.attributes_hash["resources"] + if resources_list.class == Array + spec.attributes_hash["resources"] ||= [] + spec.attributes_hash["resources"] += bundle_names.map{|n| n+".bundle"} + elsif resources_list.class == String + spec.attributes_hash["resources"] = Array(resources_list) + spec.attributes_hash["resources"] += bundle_names.map{|n| n+".bundle"} + else + spec.attributes_hash["resources"] = bundle_names.map{|n| n+".bundle"} + end elsif spec.attributes_hash['ios'] && spec.attributes_hash['ios']["resource_bundles"] bundle_names = spec.attributes_hash['ios']["resource_bundles"].keys spec.attributes_hash['ios']["resource_bundles"] = nil - spec.attributes_hash['ios']["resources"] ||= [] - spec.attributes_hash['ios']["resources"] += bundle_names.map{|n| n+".bundle"} + resources_list = spec.attributes_hash['ios']["resources"] + if resources_list.class == Array + spec.attributes_hash['ios']["resources"] ||= [] + spec.attributes_hash['ios']["resources"] += bundle_names.map{|n| n+".bundle"} + elsif resources_list.class == String + spec.attributes_hash['ios']["resources"] = Array(resources_list) + spec.attributes_hash['ios']["resources"] += bundle_names.map{|n| n+".bundle"} + else + spec.attributes_hash['ios']["resources"] = bundle_names.map{|n| n+".bundle"} + end end # to avoid the warning of missing license spec.attributes_hash["license"] = {} \ No newline at end of file