BikeCsvImporter: add comments

This commit is contained in:
Ilya Konanykhin
2017-03-20 22:49:45 +06:00
parent a6a616cf6d
commit b7729ae29a
6 changed files with 43 additions and 0 deletions
+6
View File
@@ -1,6 +1,9 @@
namespace :import do
namespace :bikes do
# Imports bikes info from CSV file
#
# rake import:bikes:csv[import.csv,dry] # dry run
# rake import:bikes:csv[import.csv] # live import
task :csv, [:file, :dry_run] => :environment do |t, args|
file, dry_run = args.values_at :file, :dry_run
next puts "Usage: rake #{t.name}[$csv_file_path[,$dry_run=dry]]" unless file
@@ -9,6 +12,9 @@ namespace :import do
end
# Analyze a single field from CSV file
#
# rake import:bikes:analyze_csv[import.csv] # dumps all fields data
# rake import:bikes:analyze_csv[import.csv,"date in"] # shows only single field
task :analyze_csv, [:file, :field] => :environment do |t, args|
file, field = args.values_at :file, :field
next puts "Usage: rake #{t.name}[$csv_file_path[,\"$field_name\"]]" unless file