Sha256: ba270ca69c51f348a1095adf69fe8c136bb9e060a650865128094bcbdbc51fe0

Contents?: true

Size: 634 Bytes

Versions: 6

Compression:

Stored size: 634 Bytes

Contents

require 'readline'
require 'launchy'

module Lingohub::Command
  class Project < Base
    def login
      Lingohub::Command.run_internal "auth:reauthorize", args.dup
    end

    def logout
      Lingohub::Command.run_internal "auth:delete_credentials", args.dup
      display "Local credentials cleared."
    end

    def list
      list = lingohub.projects.all
      if list.size > 0
        display "Projects:\n"
        list.each_pair { |name, project|
          display "- #{name}"
        }
      else
        display "You have no projects."
      end
    end

    def open
      Launchy.open project.weburl
    end

  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
lingohub-0.7.0 lib/lingohub/commands/project.rb
lingohub-0.6.1 lib/lingohub/commands/project.rb
lingohub-0.6.0 lib/lingohub/commands/project.rb
lingohub-0.5.0 lib/lingohub/commands/project.rb
lingohub-0.4.1 lib/lingohub/commands/project.rb
lingohub-0.4.0 lib/lingohub/commands/project.rb