fa user and post controller cleanup
This commit is contained in:
10
Rakefile
10
Rakefile
@@ -77,16 +77,18 @@ end
|
||||
namespace :db_sampler do
|
||||
task :export => :environment do
|
||||
url_names = ENV["url_names"] || raise("need 'url_names' (comma-separated)")
|
||||
outfile_path = ENV["outfile"] || raise("need 'outfile' (file path)")
|
||||
outfile = File.open(outfile_path, "wb")
|
||||
# outfile_path = ENV["outfile"] || raise("need 'outfile' (file path)")
|
||||
# outfile = File.open(outfile_path, "wb")
|
||||
outfile = $stdout
|
||||
DbSampler.new(outfile).export(url_names.split(","))
|
||||
ensure
|
||||
outfile.close if outfile
|
||||
end
|
||||
|
||||
task :import => [:environment] do
|
||||
infile_path = ENV["infile"] || raise("need 'infile' (file path)")
|
||||
infile = File.open(infile_path, "rb")
|
||||
# infile_path = ENV["infile"] || raise("need 'infile' (file path)")
|
||||
# infile = File.open(infile_path, "rb")
|
||||
infile = $stdin
|
||||
DbSampler.new(infile).import
|
||||
ensure
|
||||
infile.close if infile
|
||||
|
||||
Reference in New Issue
Block a user