Sha256: a2896afbbfa8ae30a1f705f4feb93061bd80640b2ec82a759d7f0a6f2c6760fc

Contents?: true

Size: 661 Bytes

Versions: 14

Compression:

Stored size: 661 Bytes

Contents

require "bundler/gem_tasks"
require "rspec/core/rake_task"
require "yaml"
require "active_record"

RSpec::Core::RakeTask.new(:spec)

task :default => :spec

namespace :db do
  db_config = YAML::load(File.open("spec/support/database.yml"))
  db_config_admin = db_config.merge({"database" => "postgres", "schema_search_path" => "public"})

  desc "Create the database"
  task :create do
    begin
      ActiveRecord::Base.establish_connection(db_config_admin)
      ActiveRecord::Base.connection.create_database(db_config["database"])
      puts "Database created."
    rescue ActiveRecord::StatementInvalid
      puts "Database already exist."
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
directory_diff-0.6.0 Rakefile
directory_diff-0.5.0 Rakefile
directory_diff-0.4.15 Rakefile
directory_diff-0.4.14 Rakefile
directory_diff-0.4.13 Rakefile
directory_diff-0.4.12 Rakefile
directory_diff-0.4.11 Rakefile
directory_diff-0.4.10 Rakefile
directory_diff-0.4.9 Rakefile
directory_diff-0.4.8 Rakefile
directory_diff-0.4.7 Rakefile
directory_diff-0.4.6 Rakefile
directory_diff-0.4.5 Rakefile
directory_diff-0.4.4 Rakefile