lib/slowlane/portal/profile.rb in slowlane-0.0.1.alpha vs lib/slowlane/portal/profile.rb in slowlane-0.0.3.alpha

- old
+ new

@@ -1,7 +1,8 @@ require_relative './util.rb' require "spaceship" +require 'terminal-table' module Slowlane module Portal class Profile < Thor @@ -19,19 +20,30 @@ Spaceship::Portal.login(c.username,c.password) t=Utils.team(options) Spaceship::Portal.client.team_id=t + rows = [] + headings = [ 'uuid', 'id', 'distribution_method', 'name' ] Spaceship::Portal.provisioning_profile.all.find_all do |profile| + row = [] + row << profile.uuid + row << profile.id + row << profile.distribution_method + row << profile.name unless options[:filter].nil? if profile.name =~ /#{options[:filter]}/ - puts "#{profile.uuid}|#{profile.id}|#{profile.distribution_method}|#{profile.name}" + rows << row end else - puts "#{profile.uuid}|#{profile.id}|#{profile.distribution_method}|#{profile.name}" + rows << row end end + + table = Terminal::Table.new :headings => headings, :rows => rows + puts table + end end end end