Class: Match::Portal::Cache
- Inherits:
-
Object
- Object
- Match::Portal::Cache
- Defined in:
- match/lib/match/portal_cache.rb
Instance Attribute Summary collapse
-
#additional_cert_types ⇒ Object
readonly
Returns the value of attribute additional_cert_types.
-
#bundle_id_identifiers ⇒ Object
readonly
Returns the value of attribute bundle_id_identifiers.
-
#include_mac_in_profiles ⇒ Object
readonly
Returns the value of attribute include_mac_in_profiles.
-
#needs_profiles_certificate_content ⇒ Object
readonly
Returns the value of attribute needs_profiles_certificate_content.
-
#needs_profiles_devices ⇒ Object
readonly
Returns the value of attribute needs_profiles_devices.
-
#platform ⇒ Object
readonly
Returns the value of attribute platform.
-
#profile_type ⇒ Object
readonly
Returns the value of attribute profile_type.
Class Method Summary collapse
Instance Method Summary collapse
- #bundle_ids ⇒ Object
- #certificates ⇒ Object
- #devices ⇒ Object
- #forget_portal_profile(portal_profile) ⇒ Object
-
#initialize(platform:, profile_type:, additional_cert_types:, bundle_id_identifiers:, needs_profiles_devices:, needs_profiles_certificate_content:, include_mac_in_profiles:) ⇒ Cache
constructor
A new instance of Cache.
- #portal_profile(stored_profile_path:, keychain_path:) ⇒ Object
- #profiles ⇒ Object
- #reset_certificates ⇒ Object
Constructor Details
#initialize(platform:, profile_type:, additional_cert_types:, bundle_id_identifiers:, needs_profiles_devices:, needs_profiles_certificate_content:, include_mac_in_profiles:) ⇒ Cache
Returns a new instance of Cache.
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'match/lib/match/portal_cache.rb', line 31 def initialize(platform:, profile_type:, additional_cert_types:, bundle_id_identifiers:, needs_profiles_devices:, needs_profiles_certificate_content:, include_mac_in_profiles:) @platform = platform @profile_type = profile_type # Bundle Ids @bundle_id_identifiers = bundle_id_identifiers # Certs @additional_cert_types = additional_cert_types # Profiles @needs_profiles_devices = needs_profiles_devices @needs_profiles_certificate_content = needs_profiles_certificate_content # Devices @include_mac_in_profiles = include_mac_in_profiles end |
Instance Attribute Details
#additional_cert_types ⇒ Object (readonly)
Returns the value of attribute additional_cert_types.
29 30 31 |
# File 'match/lib/match/portal_cache.rb', line 29 def additional_cert_types @additional_cert_types end |
#bundle_id_identifiers ⇒ Object (readonly)
Returns the value of attribute bundle_id_identifiers.
29 30 31 |
# File 'match/lib/match/portal_cache.rb', line 29 def bundle_id_identifiers @bundle_id_identifiers end |
#include_mac_in_profiles ⇒ Object (readonly)
Returns the value of attribute include_mac_in_profiles.
29 30 31 |
# File 'match/lib/match/portal_cache.rb', line 29 def include_mac_in_profiles @include_mac_in_profiles end |
#needs_profiles_certificate_content ⇒ Object (readonly)
Returns the value of attribute needs_profiles_certificate_content.
29 30 31 |
# File 'match/lib/match/portal_cache.rb', line 29 def needs_profiles_certificate_content @needs_profiles_certificate_content end |
#needs_profiles_devices ⇒ Object (readonly)
Returns the value of attribute needs_profiles_devices.
29 30 31 |
# File 'match/lib/match/portal_cache.rb', line 29 def needs_profiles_devices @needs_profiles_devices end |
#platform ⇒ Object (readonly)
Returns the value of attribute platform.
29 30 31 |
# File 'match/lib/match/portal_cache.rb', line 29 def platform @platform end |
#profile_type ⇒ Object (readonly)
Returns the value of attribute profile_type.
29 30 31 |
# File 'match/lib/match/portal_cache.rb', line 29 def profile_type @profile_type end |
Class Method Details
.build(params:, bundle_id_identifiers:) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'match/lib/match/portal_cache.rb', line 7 def self.build(params:, bundle_id_identifiers:) require_relative 'profile_includes' require 'sigh' profile_type = Sigh.profile_type_for_distribution_type( platform: params[:platform], distribution_type: params[:type] ) cache = Portal::Cache.new( platform: params[:platform], profile_type: profile_type, additional_cert_types: params[:additional_cert_types], bundle_id_identifiers: bundle_id_identifiers, needs_profiles_devices: ProfileIncludes.can_force_include_all_devices?(params: params, notify: true), needs_profiles_certificate_content: !ProfileIncludes.can_force_include_all_certificates?(params: params, notify: true), include_mac_in_profiles: params[:include_mac_in_profiles] ) return cache end |
Instance Method Details
#bundle_ids ⇒ Object
68 69 70 71 72 73 74 |
# File 'match/lib/match/portal_cache.rb', line 68 def bundle_ids @bundle_ids ||= Match::Portal::Fetcher.bundle_ids( bundle_id_identifiers: @bundle_id_identifiers ) return @bundle_ids.dup end |
#certificates ⇒ Object
76 77 78 79 80 81 82 83 84 |
# File 'match/lib/match/portal_cache.rb', line 76 def certificates @certificates ||= Match::Portal::Fetcher.certificates( platform: @platform, profile_type: @profile_type, additional_cert_types: @additional_cert_types ) return @certificates.dup end |
#devices ⇒ Object
96 97 98 99 100 101 102 103 |
# File 'match/lib/match/portal_cache.rb', line 96 def devices @devices ||= Match::Portal::Fetcher.devices( platform: @platform, include_mac_in_profiles: @include_mac_in_profiles ) return @devices.dup end |
#forget_portal_profile(portal_profile) ⇒ Object
62 63 64 65 66 |
# File 'match/lib/match/portal_cache.rb', line 62 def forget_portal_profile(portal_profile) return unless @profiles && portal_profile @profiles -= [portal_profile] end |
#portal_profile(stored_profile_path:, keychain_path:) ⇒ Object
49 50 51 52 53 54 55 56 |
# File 'match/lib/match/portal_cache.rb', line 49 def portal_profile(stored_profile_path:, keychain_path:) parsed = FastlaneCore::ProvisioningProfile.parse(stored_profile_path, keychain_path) uuid = parsed["UUID"] portal_profile = self.profiles.detect { |i| i.uuid == uuid } portal_profile end |
#profiles ⇒ Object
86 87 88 89 90 91 92 93 94 |
# File 'match/lib/match/portal_cache.rb', line 86 def profiles @profiles ||= Match::Portal::Fetcher.profiles( profile_type: @profile_type, needs_profiles_devices: @needs_profiles_devices, needs_profiles_certificate_content: @needs_profiles_certificate_content ) return @profiles.dup end |
#reset_certificates ⇒ Object
58 59 60 |
# File 'match/lib/match/portal_cache.rb', line 58 def reset_certificates @certificates = nil end |