Sha256: 0c6e74251634a7bdf73535bd62f4e44ed17e323b3dc68ce96f2f6295945adc5d
Contents?: true
Size: 1.07 KB
Versions: 8
Compression:
Stored size: 1.07 KB
Contents
# encoding: UTF-8 # Copyright 2012 Twitter, Inc # http://www.apache.org/licenses/LICENSE-2.0 module TwitterCldr module Resources module CollationTriesDumper class << self def update_dumps update_default_trie_dump #TwitterCldr.supported_locales [:he].each { |locale| update_tailoring_trie_dump(locale) } end private def update_default_trie_dump save_trie_dump(TwitterCldr::Collation::TrieLoader::DEFAULT_TRIE_LOCALE, default_trie) end def update_tailoring_trie_dump(locale) save_trie_dump(locale, TwitterCldr::Collation::TrieBuilder.load_tailored_trie(locale, @default_trie)) end def save_trie_dump(locale, trie) path = TwitterCldr::Collation::TrieLoader.dump_path(locale) FileUtils.mkdir_p(File.dirname(path)) File.open(path, 'w') { |f| f.write(Marshal.dump(trie)) } end def default_trie @default_trie ||= TwitterCldr::Collation::TrieBuilder.load_default_trie end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems