Sha256: a990ee0dcea9b0ace0928f76dbdf7d82e84c2c12490de5a40732ce223736cdec

Contents?: true

Size: 1.05 KB

Versions: 19

Compression:

Stored size: 1.05 KB

Contents

COLORS_BY_PROPERTY_VALUES = {
  "Enabled" => :green,
  "Configurable" => :yellow,
  "Unavailable" => :underline
}

command :'app_ids:list' do |c|
  c.syntax = 'ios app_ids:list'
  c.summary = 'Lists the App IDs'
  c.description = ''

  c.action do |args, options|
    app_ids = try{agent.list_app_ids}

    title = "Legend: #{COLORS_BY_PROPERTY_VALUES.collect{|k, v| k.send(v)}.join(', ')}"
    table = Terminal::Table.new :title => title do |t|
      t << ["Bundle Seed ID", "Description", "Development", "Distribution"]
      app_ids.each do |app_id|
        t << :separator

        row = [app_id.bundle_seed_id, app_id.description]
        [app_id.development_properties, app_id.distribution_properties].each do |properties|
          values = []
          properties.each do |key, value|
            color = COLORS_BY_PROPERTY_VALUES[value] || :reset
            values << key.sub(/\:$/, "").send(color)
          end
          row << values.join("\n")
        end
        t << row
      end
    end

    puts table
  end
end

alias_command :app_ids, :'app_ids:list'

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
cupertino-1.0.2 ./lib/cupertino/provisioning_portal/commands/app_ids.rb
cupertino-1.0.1 ./lib/cupertino/provisioning_portal/commands/app_ids.rb
cupertino-1.0.0 ./lib/cupertino/provisioning_portal/commands/app_ids.rb
cupertino-0.9.7 ./lib/cupertino/provisioning_portal/commands/app_ids.rb
cupertino-0.9.5 ./lib/cupertino/provisioning_portal/commands/app_ids.rb
cupertino-0.9.3 ./lib/cupertino/provisioning_portal/commands/app_ids.rb
cupertino-0.9.2 ./lib/cupertino/provisioning_portal/commands/app_ids.rb
cupertino-0.9.1 ./lib/cupertino/provisioning_portal/commands/app_ids.rb
cupertino-0.9.0 ./lib/cupertino/provisioning_portal/commands/app_ids.rb
cupertino-0.8.1 ./lib/cupertino/provisioning_portal/commands/app_ids.rb
cupertino-0.8.0 ./lib/cupertino/provisioning_portal/commands/app_ids.rb
cupertino-0.7.1 ./lib/cupertino/provisioning_portal/commands/app_ids.rb
cupertino-0.7.0 ./lib/cupertino/provisioning_portal/commands/app_ids.rb
cupertino-0.6.1 ./lib/cupertino/provisioning_portal/commands/app_ids.rb
cupertino-0.6.0 ./lib/cupertino/provisioning_portal/commands/app_ids.rb
cupertino-0.5.1 ./lib/cupertino/provisioning_portal/commands/app_ids.rb
cupertino-0.5.0 ./lib/cupertino/provisioning_portal/commands/app_ids.rb
cupertino-0.4.0 ./lib/cupertino/provisioning_portal/commands/app_ids.rb
cupertino-0.3.3 ./lib/cupertino/provisioning_portal/commands/app_ids.rb