Commit 6ac6f7e1 authored by Samuel Giddins's avatar Samuel Giddins

Fix storing cached specs in the sandbox

parent 5762646a
...@@ -170,14 +170,15 @@ module Pod ...@@ -170,14 +170,15 @@ module Pod
rescue Pod::DSLError => e rescue Pod::DSLError => e
raise Informative, "Failed to load '#{name}' podspec: #{e.message}" raise Informative, "Failed to load '#{name}' podspec: #{e.message}"
end end
defined_in_file = spec.defined_in_file
spec.defined_in_file = nil
validate_podspec(spec) validate_podspec(spec)
spec.defined_in_file = defined_in_file
sandbox.store_podspec(name, spec, true, true) sandbox.store_podspec(name, spec, true, true)
end end
def validate_podspec(podspec) def validate_podspec(podspec)
defined_in_file = podspec.defined_in_file
podspec.defined_in_file = nil
validator = validator_for_podspec(podspec) validator = validator_for_podspec(podspec)
validator.quick = true validator.quick = true
validator.allow_warnings = true validator.allow_warnings = true
...@@ -188,6 +189,8 @@ module Pod ...@@ -188,6 +189,8 @@ module Pod
unless validator.validated? unless validator.validated?
raise Informative, "The `#{name}` pod failed to validate due to #{validator.failure_reason}:\n#{validator.results_message}" raise Informative, "The `#{name}` pod failed to validate due to #{validator.failure_reason}:\n#{validator.results_message}"
end end
ensure
podspec.defined_in_file = defined_in_file
end end
def validator_for_podspec(podspec) def validator_for_podspec(podspec)
......
...@@ -266,8 +266,8 @@ module Pod ...@@ -266,8 +266,8 @@ module Pod
raise ArgumentError unless json raise ArgumentError unless json
output_path.open('w') { |f| f.puts(podspec.to_pretty_json) } output_path.open('w') { |f| f.puts(podspec.to_pretty_json) }
spec = podspec.dup spec = podspec.dup
spec.defined_in_file = output_path else
else raise ArgumentError raise ArgumentError, "Unknown type for podspec: #{podspec.inspect}"
end end
spec ||= Specification.from_file(output_path) spec ||= Specification.from_file(output_path)
......
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