class Drupid::DownloadStrategy::CurlApacheMirror
Detect and download from Apache Mirror
Public Instance Methods
_fetch()
click to toggle source
# File lib/drupid/download_strategy.rb 233 def _fetch 234 # Fetch mirror list site 235 require 'open-uri' 236 mirror_list = open(@url).read() 237 238 # Parse out suggested mirror 239 # Yep, this is ghetto, grep the first <strong></strong> element content 240 mirror_url = mirror_list[/<strong>([^<]+)/, 1] 241 242 raise "Couldn't determine mirror. Try again later." if mirror_url.nil? 243 244 blah "Best Mirror #{mirror_url}" 245 # Start download from that mirror 246 curl mirror_url, '-o', @tarball_path 247 end