$LOAD_PATH.unshift "../lib"

gettext_path = File.join(ENV["GETTEXT_PATH"] || "../../gettext/", "lib")
$LOAD_PATH.unshift gettext_path

require 'rubygems'
require 'gettext'

desc "Create mo files"
task :makemo do
  require 'gettext_activerecord/tools'
  GetText.create_mofiles
end

desc "Update po files"
task :updatepo do
  require 'gettext_activerecord/tools'
  # Read Database information from "config/database.yml"
  GetText.update_pofiles("sample_ar", ["book.rb"],
                           "sample AR 1.0.0")
end

task :createdb do
  require 'active_record'
  config = YAML.load(IO.read("config/database.yml"))["development"]
  ActiveRecord::Base.establish_connection(config)
  require 'db/schema.rb'
end

task :dropdb do
  rm "db/development.sqlite3"
end
