Unverified Commit b4aa59fa authored by Samuel Giddins's avatar Samuel Giddins Committed by GitHub

Merge pull request #7549 from dnkoutso/escape_module_map

Escape double quotes for module map contents
parents bb2f4ad7 1017a9ec
...@@ -12,10 +12,13 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -12,10 +12,13 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes ##### Bug Fixes
* Escape double quotes for module map contents
[Dimitris Koutsogiorgas](https://github.com/dnkoutso)
[#7549](https://github.com/CocoaPods/CocoaPods/pull/7549)
* Fix building Swift static library test specs. * Fix building Swift static library test specs.
[Samuel Giddins](https://github.com/segiddins) [Samuel Giddins](https://github.com/segiddins)
## 1.5.0.beta.1 (2018-03-23) ## 1.5.0.beta.1 (2018-03-23)
##### Enhancements ##### Enhancements
......
...@@ -6,7 +6,7 @@ module Pod ...@@ -6,7 +6,7 @@ module Pod
# with existing headers of the podspec. # with existing headers of the podspec.
# #
class ModuleMap class ModuleMap
# @return [PodTarget] the target represented by this Info.plist. # @return [PodTarget, AggregateTarget] the target the module map is generated for.
# #
attr_reader :target attr_reader :target
...@@ -21,7 +21,7 @@ module Pod ...@@ -21,7 +21,7 @@ module Pod
(:umbrella if umbrella), (:umbrella if umbrella),
(:exclude if exclude), (:exclude if exclude),
'header', 'header',
%("#{path}"), %("#{path.to_s.gsub('"', '\"')}"),
attrs, attrs,
].compact.join(' ') ].compact.join(' ')
end end
...@@ -38,7 +38,7 @@ module Pod ...@@ -38,7 +38,7 @@ module Pod
# Initialize a new instance # Initialize a new instance
# #
# @param [PodTarget] target @see target # @param [PodTarget, AggregateTarget] target @see target
# #
def initialize(target) def initialize(target)
@target = target @target = target
......
...@@ -35,5 +35,21 @@ module Pod ...@@ -35,5 +35,21 @@ module Pod
} }
EOS EOS
end end
it 'escapes double quotes properly for module map contents' do
path = temporary_directory + 'BananaLib.modulemap'
@pod_target.stubs(:umbrella_header_path).returns(Pathname.new('BananaLibWith"Quotes"-umbrella.h'))
@pod_target.stubs(:requires_frameworks?).returns(true)
gen = Generator::ModuleMap.new(@pod_target)
gen.save_as(path)
path.read.should == <<-EOS.strip_heredoc
framework module BananaLib {
umbrella header "BananaLibWith\\"Quotes\\"-umbrella.h"
export *
module * { export * }
}
EOS
end
end end
end end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment