Initial commit

This commit is contained in:
zhongjin
2020-06-15 10:58:47 +08:00
commit 4f1dfe7564
8590 changed files with 1516878 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
require 'csv'
namespace :cartodb do
desc 'Generates random CSV files in db/fake_data'
task 'generate_random_csv' => :environment do
filename = "#{Rails.root}/db/fake_data/csv_file_#{rand(10)}_#{Time.now.to_i}.csv"
CSV.open(filename, "wb") do |csv|
columns = []
100.times do
columns << String.random(30)
end
csv << columns
1.upto(100000) do
columns = []
100.times do
columns << String.random(30)
end
csv << columns
putc '.'
end
end
puts "Generated file: #{filename}"
end
end