CocoaPods / cocoapods-downloader

A small library that provides downloaders for various source types (HTTP/SVN/Git/Mercurial)
MIT License
84 stars 72 forks source link

Change interface #9

Closed fabiopelosin closed 10 years ago

fabiopelosin commented 10 years ago

Change the interface to receive a single parameter and to output a single one:

require 'cocoapods-downloader'

input = Downloader::Configuration.new
input.target_path = './Downloads/MyDownload'
input.options = { :git => 'example.com' }
input.cache_root = '~/Library/Caches/APPNAME'
input.max_cache_size = 500

downloader = Pod::Downloader.for_target(input)
output = downloader.download
output.checkout_options #=> { :git => 'example.com', :commit => 'd7f410490dabf7a6bde665ba22da102c3acf1bd9' }

Considerations:

@alloy I would love to hear your take when you have a minute.

alloy commented 10 years ago

Sounds good to me! The name should probably be something like Downloader::Configuration, though.

fabiopelosin commented 10 years ago

Y U don't like my naming :question:

fabiopelosin commented 10 years ago

:+1: btw

fabiopelosin commented 10 years ago

Given that the implementation was simplified and that the cache was removed, now I'm of the idea that even if I would now design the gem slightly differently the benefits would be minimal.