module Transcriptic module CLI # manage projects # class Project < Thor desc "index", "upload FILENAME or DIRECTORY and launch it" def index if args.empty? error("Usage: transcriptic project NAME") end name = args.shift data = transcriptic.project_info(name) display "Project \"#{data["name"]}\":" display " shortname: #{data["codename"]}" display " active runs: #{data["active_runs"].length}" display " archived runs: #{data["completed_runs"].length}" display " datasets created: #{data["datasets"].length}" display " created at: #{data["created_at"]}" end # transcriptic project:list desc "list", "list the projects the user can see" def list ret = transcriptic.list_projects if ret.empty? error("No projects for #{transcriptic.user}") return end ret.each do |project| display "\t" + project["codename"] + "\t\t" + project["name"] end end end end