File: Rakefile

package info (click to toggle)
libgettext-activerecord-ruby 2.1.0-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 608 kB
  • ctags: 285
  • sloc: ruby: 2,895; makefile: 13
file content (45 lines) | stat: -rw-r--r-- 1,197 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
$LOAD_PATH.unshift "../lib"
require 'rubygems'

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

task :default => :test

desc "Create mo files"
task :makemo do
  require 'activerecord'
  require 'gettext_activerecord/tools'
  GetText.create_mofiles(:mo_root => "locale")
end

SCHEMA_PATH = File.join(File.dirname(__FILE__), "db")

desc "Update pot/po files for ActiveRecord test."
task :updatepo do
  require 'activerecord'
  require 'db/sqlite'
  require 'db/migrate'
  require 'gettext_activerecord/tools'
  GetText::ActiveRecordParser.init(
    :adapter  => "sqlite3",
    :encoding => "utf8",
    :activerecord_classes => ["ActiveRecord::Base", "Reply"],
    :database => ':memory:'
  )
  GetText.update_pofiles("active_record", [
    "models/developer.rb",
    "models/topic.rb",
    "models/reply.rb",
    "test_validations.rb"
  ], "active_record 1.0.0")
end

desc 'Run all tests'
task :test do
  Dir.glob("test_*.rb").each do |path|
    ruby "-I../lib:../../locale/lib", "-I#{gettext_path}", "-rubygems", path rescue nil
  end
end