Sha256: 530cf829b949bb5864f9b2f2b0d84d7d44f6f347cd1db4793341eabed725d236

Contents?: true

Size: 626 Bytes

Versions: 3

Compression:

Stored size: 626 Bytes

Contents

namespace :db do

  def verbosely_drop_database
    db_name = Config.drop_database
    puts "Dropped database: #{db_name}."
  end

  desc 'Drop database for current environment (development unless RACK_ENV is set)'
  task :reset do
    verbosely_drop_database
  end

  namespace :reset do
    desc 'Drop databases defined in config/config.yml'
    task :all do
      Config.environments.each do |env_name|
        Config.environment = env_name
        verbosely_drop_database
      end
    end

    desc 'Drop test database'
    task :test do
      Config.environment = 'test'
      verbosely_drop_database
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sinatra_resource-0.4.24 examples/datacatalog/tasks/db.rake
sinatra_resource-0.4.23 examples/datacatalog/tasks/db.rake
sinatra_resource-0.4.22 examples/datacatalog/tasks/db.rake