Sha256: 6f585a7b3e9ef678a76d871d813e890644950dc07c43d93326df83329dbffcbb

Contents?: true

Size: 630 Bytes

Versions: 37

Compression:

Stored size: 630 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

37 entries across 37 versions & 1 rubygems

Version Path
sinatra_resource-0.4.21 examples/datacatalog/tasks/db.rake
sinatra_resource-0.4.20 examples/datacatalog/tasks/db.rake
sinatra_resource-0.4.19 examples/datacatalog/tasks/db.rake
sinatra_resource-0.4.18 examples/datacatalog/tasks/db.rake
sinatra_resource-0.4.17 examples/datacatalog/tasks/db.rake
sinatra_resource-0.4.16 examples/datacatalog/tasks/db.rake
sinatra_resource-0.4.15 examples/datacatalog/tasks/db.rake
sinatra_resource-0.4.14 examples/datacatalog/tasks/db.rake
sinatra_resource-0.4.13 examples/datacatalog/tasks/db.rake
sinatra_resource-0.4.12 examples/datacatalog/tasks/db.rake
sinatra_resource-0.4.11 examples/datacatalog/tasks/db.rake
sinatra_resource-0.4.10 examples/datacatalog/tasks/db.rake
sinatra_resource-0.4.9 examples/datacatalog/tasks/db.rake
sinatra_resource-0.4.8 examples/datacatalog/tasks/db.rake
sinatra_resource-0.4.7 examples/datacatalog/tasks/db.rake
sinatra_resource-0.4.6 examples/datacatalog/tasks/db.rake
sinatra_resource-0.4.5 examples/datacatalog/tasks/db.rake
sinatra_resource-0.4.4 examples/datacatalog/tasks/db.rake
sinatra_resource-0.4.3 examples/datacatalog/tasks/db.rake
sinatra_resource-0.4.2 examples/datacatalog/tasks/db.rake