Commit 07d79a8b authored by Samuel E. Giddins's avatar Samuel E. Giddins

[PodspecSource] Use pathname to determine if spec is json.

parent 09a33aa0
...@@ -10,10 +10,10 @@ module Pod ...@@ -10,10 +10,10 @@ module Pod
title = "Fetching podspec for `#{name}` #{description}" title = "Fetching podspec for `#{name}` #{description}"
UI.titled_section(title, :verbose_prefix => '-> ') do UI.titled_section(title, :verbose_prefix => '-> ') do
podspec_path = Pathname(podspec_uri) podspec_path = Pathname(podspec_uri)
is_json = podspec_path.extname == '.json'
if podspec_path.exist? if podspec_path.exist?
store_podspec(sandbox, podspec_path, podspec_path.extname == '.json') store_podspec(sandbox, podspec_path, is_json)
else else
is_json = podspec_uri.split('.').last == 'json'
require 'open-uri' require 'open-uri'
begin begin
open(podspec_uri) { |io| store_podspec(sandbox, io.read, is_json) } open(podspec_uri) { |io| store_podspec(sandbox, io.read, is_json) }
......
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