Class: POEditor::PullCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/PullCommand.rb

Instance Method Summary collapse

Constructor Details

#initialize(project_path = "") ⇒ PullCommand

Returns a new instance of PullCommand.

Parameters:

  • project_path (String) (defaults to: "")

    Path of project main directory [optional] - if present then target paths would be created by concatenating it with paths in JSON config



13
14
15
# File 'lib/PullCommand.rb', line 13

def initialize(project_path = "")
  @project_path = project_path
end

Instance Method Details

#run(config, target_name = "") ⇒ Object

Pulls POEditor translations based on passed POEditor JSON config and target name

Parameters:

  • config (JSON)

    POEditor JSON config

  • target_name (String) (defaults to: "")

    Target name for translations [optional] - if absent paths would not be parameterized



24
25
26
# File 'lib/PullCommand.rb', line 24

def run(config, target_name = "")
  pull_translations(create_configuration(config, target_name))
end

#run_from_path(config_path, target_name = "") ⇒ Object

Pulls POEditor translations based on POEditor JSON config read from passed path and target name

Parameters:

  • config_path (String)

    Path to POEditor config

  • target_name (String) (defaults to: "")

    Target name for translations [optional] - if absent paths would not be parameterized



36
37
38
# File 'lib/PullCommand.rb', line 36

def run_from_path(config_path, target_name = "")
  pull_translations(get_configuration(config_path, target_name))
end