Commit f9d3ec07 authored by Samuel E. Giddins's avatar Samuel E. Giddins

[ExternalSource] Store downloaded external source podspecs as JSON, evaluated…

[ExternalSource] Store downloaded external source podspecs as JSON, evaluated from the context of the source directory
parent e00268b7
......@@ -15,7 +15,7 @@ gem 'json', '1.7.7'
group :development do
cp_gem 'claide', 'CLAide'
cp_gem 'cocoapods-core', 'Core'
cp_gem 'cocoapods-core', 'Core', 'seg-podspec-eval-context'
cp_gem 'cocoapods-downloader', 'cocoapods-downloader'
cp_gem 'cocoapods-plugins', 'cocoapods-plugins'
cp_gem 'cocoapods-trunk', 'cocoapods-trunk'
......
......@@ -7,8 +7,8 @@ GIT
GIT
remote: https://github.com/CocoaPods/Core.git
revision: c674fd2cb5249a67f558d0fd73d42275710a11c7
branch: master
revision: 995e12321cd13b6eb66a07e4bc5d156e749b1537
branch: seg-podspec-eval-context
specs:
cocoapods-core (0.35.0)
activesupport (>= 3.2.15)
......
......@@ -138,6 +138,10 @@ module Pod
# @return [void]
#
def store_podspec(sandbox, spec, json = false)
if spec.is_a? Pathname
spec = Specification.from_file(spec).to_pretty_json
json = true
end
sandbox.store_podspec(name, spec, true, json)
end
end
......
......@@ -37,7 +37,7 @@ module Pod
it 'pre-downloads the Pod and stores the relevant information in the sandbox' do
@subject.send(:pre_download, config.sandbox)
path = config.sandbox.specifications_root + 'Reachability.podspec'
path = config.sandbox.specifications_root + 'Reachability.podspec.json'
path.should.exist?
config.sandbox.predownloaded_pods.should == ['Reachability']
config.sandbox.checkout_sources.should == {
......@@ -52,10 +52,10 @@ module Pod
path = config.sandbox.pod_dir('Reachability')
podspec_path = path + 'Reachability.podspec.json'
Dir.mkdir(path)
File.open(podspec_path, 'w') {}
File.open(podspec_path, 'w') { |f| f.write '{}' }
Pathname.any_instance.stubs(:rmtree)
Downloader::Git.any_instance.stubs(:download)
config.sandbox.expects(:store_podspec).with('Reachability', podspec_path, true, true)
config.sandbox.expects(:store_podspec).with('Reachability', "{\n}\n", true, true)
@subject.send(:pre_download, config.sandbox)
end
end
......
......@@ -13,7 +13,7 @@ module Pod
it 'creates a copy of the podspec' do
@subject.fetch(config.sandbox)
path = config.sandbox.specifications_root + 'Reachability.podspec'
path = config.sandbox.specifications_root + 'Reachability.podspec.json'
path.should.exist?
end
......
......@@ -12,7 +12,7 @@ module Pod
it 'creates a copy of the podspec' do
@subject.fetch(config.sandbox)
path = config.sandbox.specifications_root + 'Reachability.podspec'
path = config.sandbox.specifications_root + 'Reachability.podspec.json'
path.should.exist?
end
......@@ -22,7 +22,7 @@ module Pod
podfile_path = fixture('integration/Podfile')
@subject = ExternalSources.from_dependency(dependency, podfile_path)
@subject.fetch(config.sandbox)
path = config.sandbox.specifications_root + 'Reachability.podspec'
path = config.sandbox.specifications_root + 'Reachability.podspec.json'
path.should.exist?
end
......@@ -52,7 +52,7 @@ module Pod
end
it 'marks a pod as absolute' do
@subject.stubs(:params).returns(:path => '/path/Reachability')
@subject.stubs(:params).returns(:path => fixture('integration/Reachability'))
Pathname.any_instance.stubs(:exist?).returns(true)
config.sandbox.stubs(:store_podspec)
@subject.fetch(config.sandbox)
......
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