class PProf::OutputFormatter

A helper tool to pretty-print Provisioning Profile informations

Public Class Methods

new(output = $stdout) click to toggle source

Initialize a new OutputFormatter

@param [IO] output

The output destination where to print the formatted data.
Defaults to $stdout
# File lib/pprof/output_formatter.rb, line 11
def initialize(output = $stdout)
  @output = output
end

Private Class Methods

match_aps_env(actual, expected) click to toggle source
# File lib/pprof/output_formatter.rb, line 193
def self.match_aps_env(actual, expected)
  return false if actual.nil?      # false if no Push entitlements
  return true if expected === true # true if Push present but we don't filter on specific env
  return actual =~ expected        # true if Push present and we filter on specific env
end

Public Instance Methods

print_error(message, file) click to toggle source

Prints an error message

@param [String] message

The error message to print

@param [String] file

The provisioning profile file for which the error occurred
print_filtered_list(dir = PProf::ProvisioningProfile::DEFAULT_DIR, filters = {}, list_options = { :mode => :table }) click to toggle source

Prints the filtered list of Provisioning Profiles

Convenience method. Calls self.print_list with a filter block build from a filter hash

@param [String] dir

The directory to search for the provisioning profiles. Defaults to the standard directory on Mac

@param [Hash<Symbol,Any>] filters

The hash describing the applied filters

@param [Hash<Symbol,Any>] list_options

The way to print the output.
* Valid values for key `:mode` are:
  - `:table` (for ASCII table output)
  - `:list` (for plain list of only the UUIDs, suitable for piping to `xargs`)
  - `:path` (for plain list of only the paths, suitable for piping to `xargs`)
* Valid values for key `:zero` are `true` or `false` to decide if we print `\0` at the end of each output.
  Only used by `:list` and `:path` modes
print_info(profile, options = nil) click to toggle source

Prints the description of a Provisioning Profile

@param [PProf::ProvisioningProfile] profile

The ProvisioningProfile object to print

@param [Hash<Symbol,Bool>] options

Decide what to print. Valid keys are :info, :certs and :devices
print_list(dir = PProf::ProvisioningProfile::DEFAULT_DIR, options) { |p| ... } click to toggle source

Prints the filtered list of UUIDs or Paths only

@param [String] dir

The directory containing the mobileprovision files to list.
Defaults to '~/Library/MobileDevice/Provisioning Profiles'

@yield each provisioning provile for filtering/validation

The block is given ProvisioningProfile object and should
return true to display the row, false to filter it out
print_table(dir = PProf::ProvisioningProfile::DEFAULT_DIR) { |p| ... } click to toggle source

Prints the filtered list as a table

@param [String] dir

The directory containing the mobileprovision files to list.
Defaults to '~/Library/MobileDevice/Provisioning Profiles'

@yield each provisioning provile for filtering/validation

The block is given ProvisioningProfile object and should
return true to display the row, false to filter it out