Sha256: 78af7cafd3aa4ed26679cc9f6fe85fe3cd13d2dfea9ec03cd82462957e725452

Contents?: true

Size: 1.19 KB

Versions: 5

Compression:

Stored size: 1.19 KB

Contents

# rubocop:disable Metrics/BlockLength
namespace :wipe do
  desc 'Deletes development data'
  task all: :environment do
    abort "You're not in development environment. Aborting." unless Rails.env.development?
    system('bundle exec rake wipe:db')
    system('bundle exec rake wipe:logs')
    system('bundle exec rake wipe:files')
  end
  task db: :environment do
    abort "You're not in development environment. Aborting." unless Rails.env.development?
    system('bundle exec rake db:drop')
    system('bundle exec rake db:create')
    system('bundle exec rake db:migrate')
  end
  task db_seed: :environment do
    abort "You're not in development environment. Aborting." unless Rails.env.development?
    system('bundle exec rake wipe:db')
    system('bundle exec rake db:seed')
  end
  task logs: :environment do
    abort "You're not in development environment. Aborting." unless Rails.env.development?
    system("rm -f #{Rails.root}/log/*.log")
  end
  task files: :environment do
    abort "You're not in development environment. Aborting." unless Rails.env.development?
    system("rm -rf #{Rails.root}/storage/")
    system("rm -rf #{Rails.root}/tmp/storage/")
  end
end
# rubocop:enable Metrics/BlockLength

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
elabs-5.0.0 lib/tasks/wipe.rake
elabs-4.0.0 lib/tasks/wipe.rake
elabs-3.0.0 lib/tasks/wipe.rake
elabs-2.0.0 lib/tasks/wipe.rake
elabs-2.0.0.pre lib/tasks/wipe.rake