Sha256: df40d4bfdf9ddf269081a23a4c01caafbafc86295b63d064bfc30b37acfede5b

Contents?: true

Size: 572 Bytes

Versions: 8

Compression:

Stored size: 572 Bytes

Contents

# -*- encoding : utf-8 -*-

class Phrase::Tool::Commands::Tags < Phrase::Tool::Commands::Base
  def initialize(options, args)
    super(options, args)
    require_auth_token!
  end
  
  def execute!
    if get_option(:list)
      list_tags
    else
      print_error "Unknown command"
    end
  end

protected
  def list_tags
    begin
      tags = api_client.list_tags
      tags.each do |tag|
        print_message "#{tag["name"]}"
      end
    rescue Exception => e
      print_error "Failure while fetching tags"
      print_server_error(e.message)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
phrase-0.4.14 lib/phrase/tool/commands/tags.rb
phrase-0.4.13 lib/phrase/tool/commands/tags.rb
phrase-0.4.12 lib/phrase/tool/commands/tags.rb
phrase-0.4.11 lib/phrase/tool/commands/tags.rb
phrase-0.4.10 lib/phrase/tool/commands/tags.rb
phrase-0.4.9 lib/phrase/tool/commands/tags.rb
phrase-0.4.8 lib/phrase/tool/commands/tags.rb
phrase-0.4.7 lib/phrase/tool/commands/tags.rb