Sha256: e0f8eec0c3862ea430419f0f45e372c0ea14f4136fcbf2532f8e6987f123cd86

Contents?: true

Size: 1.38 KB

Versions: 4

Compression:

Stored size: 1.38 KB

Contents

# frozen_string_literal: true

require 'zeitwerk'
require 'yaml'

loader = Zeitwerk::Loader.for_gem
loader.setup

# LokaliseManager main module that exposes helper methods:
#
#   importer = LokaliseManager.importer api_token: '1234abc', project_id: '123.abc'
#   exporter = LokaliseManager.exporter api_token: '1234abc', project_id: '123.abc'
#
# Use the instantiated objects to import or export your translation files:
#
#   importer.import!
#   exporter.export!
#
module LokaliseManager
  class << self
    # Initializes a new importer client which is used to download
    # translation files from Lokalise to the current project
    #
    # @return [LokaliseManager::TaskDefinitions::Importer]
    # @param custom_opts [Hash]
    # @param global_config [Object]
    def importer(custom_opts = {}, global_config = LokaliseManager::GlobalConfig)
      LokaliseManager::TaskDefinitions::Importer.new custom_opts, global_config
    end

    # Initializes a new exporter client which is used to upload
    # translation files from the current project to Lokalise
    #
    # @return [LokaliseManager::TaskDefinitions::Exporter]
    # @param custom_opts [Hash]
    # @param global_config [Object]
    def exporter(custom_opts = {}, global_config = LokaliseManager::GlobalConfig)
      LokaliseManager::TaskDefinitions::Exporter.new custom_opts, global_config
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
lokalise_manager-5.1.0 lib/lokalise_manager.rb
lokalise_manager-5.0.0 lib/lokalise_manager.rb
lokalise_manager-3.1.0 lib/lokalise_manager.rb
lokalise_manager-3.0.0 lib/lokalise_manager.rb