Sha256: 7d386934ccb5131203cf1c3a5e31871082d754625850478cb8f0db0938be2242
Contents?: true
Size: 1.1 KB
Versions: 36
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] == $1) msg << "#{file}:#{cnt}" found = true break end end ary << [$1, "#{file}:#{cnt}"] unless found end end f.close return ary end end GetText::RGetText.add_parser(SHTMLParser) end; end
Version data entries
36 entries across 36 versions & 1 rubygems