Project

General

Profile

Bug #5374 » gettext-test.rb

test for gettext workaround - 375gnu (Hleb Valoshka), 09/28/2011 04:02 AM

 
#!/usr/bin/ruby1.9.1 -d -I.

require 'gettext'
include GetText

$SAFE = 1

set_current_locale ARGV[0]
bindtextdomain('test', :path => './')

module Locale
module_function
def require_driver(name) #:nodoc:
require File.join(ROOT, "locale/driver", name.to_s).untaint
end
end

module GetText
class MOFile
alias :oldload :load
def load(arg)
arg = arg.dup.untaint if arg.kind_of? String
oldload(arg)
end
end
end

puts _('Hello world!')


(3-3/5)