Class: Nabokov::LocalizationsRepoSyncer

Inherits:
Syncer
  • Object
show all
Defined in:
lib/nabokov/commands/syncers/localizations_repo_syncer.rb

Instance Attribute Summary

Attributes inherited from Syncer

#git_repo, #nabokovfile

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Syncer

#init_git_repo, #initialize_nabokov_file

Methods inherited from Runner

#ui

Constructor Details

#initialize(argv) ⇒ LocalizationsRepoSyncer

Returns a new instance of LocalizationsRepoSyncer.



11
12
13
14
# File 'lib/nabokov/commands/syncers/localizations_repo_syncer.rb', line 11

def initialize(argv)
  super
  @synchronized_file_names = []
end

Class Method Details

.optionsObject



20
21
22
# File 'lib/nabokov/commands/syncers/localizations_repo_syncer.rb', line 20

def self.options
  super
end

Instance Method Details

#runObject



24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/nabokov/commands/syncers/localizations_repo_syncer.rb', line 24

def run
  ui.important("Nabokov starts localizations repo synchronization")
  super
  checkout_temporary_branch
  has_changes = update_localization_files
  checkout_master_branch
  fetch_master_branch_changes
  if has_changes && merge_master_branch_with_temporary(@rescue_commit_sha) == Nabokov::MergerResult::SUCCEEDED
    push_changes_to_remote
  end
  delete_temporary_branch
  notify_user_about_finish
end

#validate!Object



16
17
18
# File 'lib/nabokov/commands/syncers/localizations_repo_syncer.rb', line 16

def validate!
  super
end