Skip to content

Commit

Permalink
Tidy up.
Browse files Browse the repository at this point in the history
  • Loading branch information
James Campbell committed Apr 18, 2016
1 parent 3335950 commit 794c7a7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
23 changes: 18 additions & 5 deletions lib/cocoapods-deploy/deploy_downloader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 25,9 @@ def download_podspec(config)
source = ExternalSources.from_dependency(dep, config.podfile.defined_in_file)

begin
return source.fetch
return source.fetch(config.sandbox)
rescue Exception
puts "Not Found"
end
end

Expand All @@ -42,11 43,23 @@ def dependencies_for_sources(config)
podfile_sources(config).map do |source|
filename = File.basename(source, ".*")
raw_url = File.join( File.dirname(source), filename )
root_url = "#{raw_url}/raw"
source = @dependency.external_source[:podspec].gsub('{root-url}', root_url)
root_urls = [
"#{raw_url}/raw/master/Specs",
"#{raw_url}/raw/master"
]

Dependency.new(@dependency.name, {:podspec => source})
end
root_urls.map do |url|
source = @dependency.external_source[:podspec].gsub('{root-url}', url)
dependencies_for_url(source)
end
end.flatten
end

def dependencies_for_url(url)
[
Dependency.new(@dependency.name, {:podspec => "#{url}.podspec"}),
Dependency.new(@dependency.name, {:podspec => "#{url}.podspec.json"})
]
end
end
end
2 changes: 1 addition & 1 deletion lib/cocoapods-deploy/deploy_transformer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 64,7 @@ def parse_dependency(name_or_hash)
end

def podspec_url(pod, version)
"{root-url}/master/Specs/#{pod}/#{version}/#{pod}.podspec.json"
"{root-url}/#{pod}/#{version}/#{pod}"
end

def collect_podspec_dependencies(name_or_hash)
Expand Down

0 comments on commit 794c7a7

Please sign in to comment.