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