Sha256: afb99d2bce6ea634d4dbc05b71d2eb6fa3138a50ed3cb00ac4da8ec6e92a4ac8
Contents?: true
Size: 1.76 KB
Versions: 8
Compression:
Stored size: 1.76 KB
Contents
# encoding: utf-8 require 'flextures/flextures' namespace :db do namespace :flextures do desc "Dump data to csv format" task :dump => :environment do table_names = Flextures::ARGS.parse Flextures::init_load puts "dumping..." if ["yml","yaml"].include? ENV["FORMAT"] table_names.each { |fmt| Flextures::Dumper::yml(fmt) } else table_names.each { |fmt| Flextures::Dumper::csv(fmt) } end end desc "Dump data to prefer csv format" task :csvdump => :environment do table_names = Flextures::ARGS.parse Flextures::init_load table_names.each { |fmt| Flextures::Dumper::csv(fmt) } end desc "Dump data to yaml format" task :ymldump => :environment do table_names = Flextures::ARGS.parse Flextures::init_load table_names.each { |fmt| Flextures::Dumper::yml(fmt) } end desc "load fixture data csv format" task :load => :environment do table_names = Flextures::ARGS.parse Flextures::init_load Flextures::init_tables puts "loading..." if ["yml","yaml"].include? ENV["FORMAT"] table_names.each { |fmt| Flextures::Loader::yml(fmt) } else table_names.each { |fmt| Flextures::Loader::csv(fmt) } end end desc "load fixture data only csv format files" task :csvload => :environment do table_names = Flextures::ARGS.parse Flextures::init_load Flextures::init_tables table_names.each { |fmt| Flextures::Loader::csv(fmt) } end desc "load fixture files only yaml format" task :ymlload => :environment do table_names = Flextures::ARGS::parse Flextures::init_load Flextures::init_tables table_names.each { |fmt| Flextures::Loader::yml(fmt) } end end end
Version data entries
8 entries across 8 versions & 1 rubygems