Class: C11n::Synchronizer
- Inherits:
-
Object
- Object
- C11n::Synchronizer
show all
- Defined in:
- lib/c11n/synchronizer.rb,
lib/c11n/synchronizer/ios.rb,
lib/c11n/synchronizer/rails.rb,
lib/c11n/synchronizer/android.rb
Defined Under Namespace
Classes: Android, Ios, Rails
Instance Method Summary
collapse
Constructor Details
#initialize(options = {}) ⇒ Synchronizer
Returns a new instance of Synchronizer.
22
23
24
25
|
# File 'lib/c11n/synchronizer.rb', line 22
def initialize(options = {})
@configuration = options[:configuration]
@translations = C11n::Translations.new
end
|
Instance Method Details
#download ⇒ Object
42
43
44
45
46
47
48
|
# File 'lib/c11n/synchronizer.rb', line 42
def download
@translations.import_with(google_drive_importer)
project.exporters.each do |locale, exporter|
@translations.export_with(exporter, locale)
end
end
|
#google_drive_exporter ⇒ Object
31
32
33
|
# File 'lib/c11n/synchronizer.rb', line 31
def google_drive_exporter
@google_drive_exporter ||= C11n::Exporter::GoogleDrive.new
end
|
#google_drive_importer ⇒ Object
27
28
29
|
# File 'lib/c11n/synchronizer.rb', line 27
def google_drive_importer
@google_drive_importer ||= C11n::Importer::GoogleDrive.new
end
|
#upload ⇒ Object
35
36
37
38
39
40
|
# File 'lib/c11n/synchronizer.rb', line 35
def upload
project.importers.each do |locale, importer|
@translations.import_with(importer)
@translations.export_with(google_drive_exporter, locale)
end
end
|