Method: FreeZipcodeData::DataSource#download
- Defined in:
- lib/free_zipcode_data/data_source.rb
#download ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/free_zipcode_data/data_source.rb', line 19 def download return nil if !.clobber && File.exist?(zipfile_path) FileUtils.mkdir_p(.work_dir) @logger.info("Downloading: #{zipfile} from GeoNames...") open(zipfile_path, 'wb') do |file| file << open("#{BASE_URL}/#{zipfile}").read end end |