Sha256: c1339ce5ed0b2ec17137983b1b405caddcd6651a3714d8bb770b28b8771ff3dc
Contents?: true
Size: 959 Bytes
Versions: 12
Compression:
Stored size: 959 Bytes
Contents
class AwesomeTranslations::Handlers::LibraryHandler < AwesomeTranslations::Handlers::BaseHandler def groups ArrayEnumerator.new do |yielder| erb_inspector.files.each do |file| yielder << AwesomeTranslations::Group.new( id: Base64.urlsafe_encode64(file.full_path), handler: self, data: { name: file.file_path, root_path: file.root_path, full_path: file.full_path, file_path: file.file_path } ) end end end def translations_for_group(group) ArrayEnumerator.new do |yielder| file = erb_inspector.file(group.data[:root_path], group.data[:file_path]) file.translations.each do |translation| next if translation.global? yielder << translation.model end end end private def erb_inspector @erb_inspector ||= AwesomeTranslations::ErbInspector.new( exts: [".rb"] ) end end
Version data entries
12 entries across 12 versions & 1 rubygems