|
# to allow in-place run
|
|
$: << File.join(File.dirname(__FILE__), ".", "lib")
|
|
|
|
ENV['LC_ALL'] = "C"
|
|
|
|
require 'rake'
|
|
require 'gettext/tools/task'
|
|
require 'cyborghood/base/config_setup'
|
|
require 'cyborghood/base/info'
|
|
|
|
main_domain = "cyborghood"
|
|
components = ["postman"]
|
|
po_dir = "po"
|
|
mo_dir = CyborgHood::Config::L10N_DIR
|
|
msgmerge_options = ['--sort-by-msgid']
|
|
xgettext_options = ['--sort-by-msgid']
|
|
|
|
GetText::Tools::Task.define do |task|
|
|
task.package_name = CyborgHood::PRODUCT
|
|
task.package_version = CyborgHood::VERSION
|
|
task.domain = main_domain
|
|
task.po_base_directory = po_dir
|
|
task.mo_base_directory = mo_dir
|
|
task.files = Dir.glob("lib/**/*.{rb,rhtml}")
|
|
task.msgmerge_options = msgmerge_options
|
|
task.xgettext_options = xgettext_options
|
|
end
|
|
|
|
components.each do |c|
|
|
GetText::Tools::Task.define do |task|
|
|
task.package_name = CyborgHood::PRODUCT
|
|
task.package_version = CyborgHood::VERSION
|
|
task.domain = main_domain + "_" + c
|
|
task.po_base_directory = po_dir
|
|
task.mo_base_directory = mo_dir
|
|
task.files = [ File.join(CyborgHood::Config::BIN_DIR, c) ]
|
|
task.msgmerge_options = msgmerge_options
|
|
task.xgettext_options = xgettext_options
|
|
end
|
|
end
|
|
|
|
namespace :test do
|
|
require 'rake/testtask'
|
|
|
|
Rake::TestTask.new(:spec) do |t|
|
|
t.libs.push "spec"
|
|
t.test_files = FileList['spec/**/*.rb']
|
|
t.verbose = true
|
|
end
|
|
end
|