Sha256: 1f7662763c60c013c93089271cd33fe2129759ad9cd8cb853ddb8f68fdfa2ad8

Contents?: true

Size: 708 Bytes

Versions: 22

Compression:

Stored size: 708 Bytes

Contents

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

      def execute(current_name, new_name,  *rest)
        @output.puts "Localeapp mv"
        @output.puts ""
        @output.puts "Renaming key: #{current_name} to #{new_name}"
        api_call :rename,
          :url_options => { :current_name => current_name },
          :payload => { :new_name => new_name },
          :success => :report_success,
          :failure => :report_failure,
          :max_connection_attempts => 3
      end

      def report_success(response)
        @output.puts "Success!"
      end

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

Version data entries

22 entries across 22 versions & 1 rubygems

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