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.1 examples/datacatalog/tasks/db.rake
sinatra_resource-0.4.0 examples/datacatalog/tasks/db.rake
sinatra_resource-0.3.6 examples/datacatalog/tasks/db.rake
sinatra_resource-0.3.5 examples/datacatalog/tasks/db.rake
sinatra_resource-0.3.4 examples/datacatalog/tasks/db.rake
sinatra_resource-0.3.3 examples/datacatalog/tasks/db.rake
sinatra_resource-0.3.2 examples/datacatalog/tasks/db.rake
sinatra_resource-0.3.1 examples/datacatalog/tasks/db.rake
sinatra_resource-0.3.0 examples/datacatalog/tasks/db.rake
sinatra_resource-0.2.6 examples/datacatalog/tasks/db.rake
sinatra_resource-0.2.5 examples/datacatalog/tasks/db.rake
sinatra_resource-0.2.4 examples/datacatalog/tasks/db.rake
sinatra_resource-0.2.3 examples/datacatalog/tasks/db.rake
sinatra_resource-0.2.2 examples/datacatalog/tasks/db.rake
sinatra_resource-0.2.1 examples/datacatalog/tasks/db.rake
sinatra_resource-0.2.0 examples/datacatalog/tasks/db.rake
sinatra_resource-0.1.0 examples/datacatalog/tasks/db.rake