Sha256: 5a3cd88ef1df532c9fb2483d52844b888df4404baa634e9af6bad9546b136e78
Contents?: true
Size: 959 Bytes
Versions: 7
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
7 entries across 7 versions & 1 rubygems