Sha256: 7b588ad784eb8697ca43cdd1ad5bec78f67b8ade808835ce95b615cf93052b91
Contents?: true
Size: 1.1 KB
Versions: 18
Compression:
Stored size: 1.1 KB
Contents
require 'gettext/tools' require 'spiderfw/templates/blocks/text' module Spider; module I18n module SHTMLParser module_function def target?(file) File.extname(file) == '.shtml' end def parse(file, ary) f = File.new(file) cnt = 0 f.each_line do |line| cnt += 1 scanner = ::StringScanner.new(line) while scanner.scan_until(Spider::TemplateBlocks::GettextRegexp) str = scanner.matched str =~ Spider::TemplateBlocks::GettextRegexp found = false ary.each do |msg| if (msg[0] == $2) msg << "#{file}:#{cnt}" found = true break end end ary << [$2, "#{file}:#{cnt}"] unless found end end f.close return ary end end ::GetText::RGetText.add_parser(SHTMLParser) end; end
Version data entries
18 entries across 18 versions & 1 rubygems