Sha256: 003ee9a890f3bc896c56ad7285a63050551a61acc222f162f71372ff6c9b82cb
Contents?: true
Size: 820 Bytes
Versions: 4
Compression:
Stored size: 820 Bytes
Contents
require 'bundler/gem_tasks' require 'rake/testtask' task :console do sh "irb -rubygems -I lib -r geokit" end Rake::TestTask.new do |t| t.libs << 'test' t.test_files = FileList['test/test*.rb'] t.verbose = true end desc 'Downloads GeoLiteCity.dat from maxmind.com' task :download_geolitecity do total_size = nil url = 'http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz' progress_cb = lambda { |size| print("Downloaded #{size} of #{total_size} bytes\r") if total_size } length_cb = lambda { |content_length| total_size = content_length } require 'open-uri' File.open('/tmp/GeoLiteCity.dat.gz', 'wb') do |f| open(url, 'rb', progress_proc: progress_cb, content_length_proc: length_cb) do |downloaded_file| f.write(downloaded_file.read) end end puts "\nDone." end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
geokit-1.13.1 | Rakefile |
geokit-1.13.0 | Rakefile |
geokit-1.12.0 | Rakefile |
geokit-1.11.0 | Rakefile |