Sha256: 88042610bc613ae8913a29ec91c5f1bd99bc503427cb5d57e605a2724aacf837

Contents?: true

Size: 763 Bytes

Versions: 26

Compression:

Stored size: 763 Bytes

Contents

module Localeapp
  module CLI
    class Pull < Command
      include ::Localeapp::ApiCall

      def execute
        @output.puts "Localeapp Pull"
        @output.puts ""

        @output.puts "Fetching translations:"
        api_call :export,
          :success => :update_backend,
          :failure => :report_failure,
          :max_connection_attempts => 3
      end

      def update_backend(response)
        @output.puts "Success!"
        @output.puts "Updating backend:"
        Localeapp.updater.dump(Localeapp.load_yaml(response))
        @output.puts "Success!"
        Localeapp.poller.write_synchronization_data!(Time.now.to_i, Time.now.to_i)
      end

      def report_failure(response)
        @output.puts "Failed!"
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
localeapp-2.1.1 lib/localeapp/cli/pull.rb
localeapp-2.1.0 lib/localeapp/cli/pull.rb
localeapp-2.0.0 lib/localeapp/cli/pull.rb
localeapp-1.0.2 lib/localeapp/cli/pull.rb
localeapp-1.0.1 lib/localeapp/cli/pull.rb
localeapp-1.0.0 lib/localeapp/cli/pull.rb
localeapp-0.9.3 lib/localeapp/cli/pull.rb
localeapp-0.9.2 lib/localeapp/cli/pull.rb
localeapp-0.9.1 lib/localeapp/cli/pull.rb
localeapp-0.9.0 lib/localeapp/cli/pull.rb
localeapp-0.8.1 lib/localeapp/cli/pull.rb
localeapp-0.8.0 lib/localeapp/cli/pull.rb
localeapp-0.7.2 lib/localeapp/cli/pull.rb
localeapp-0.7.1 lib/localeapp/cli/pull.rb
localeapp-0.7.0 lib/localeapp/cli/pull.rb
localeapp-0.6.14 lib/localeapp/cli/pull.rb
localeapp-0.6.13 lib/localeapp/cli/pull.rb
localeapp-0.6.12 lib/localeapp/cli/pull.rb
localeapp-0.6.10 lib/localeapp/cli/pull.rb
localeapp-0.6.9 lib/localeapp/cli/pull.rb