spaceship/lib/spaceship/portal/provisioning_profile.rb in fastlane-2.74.1 vs spaceship/lib/spaceship/portal/provisioning_profile.rb in fastlane-2.75.0.beta.20180109010003

- old
+ new

@@ -191,11 +191,10 @@ end # Create a new object based on a hash. # This is used to create a new object based on the server response. def factory(attrs) - # rubocop:disable Lint/MissingRequireStatement # available values of `distributionMethod` at this point: ['adhoc', 'store', 'limited', 'direct'] klass = case attrs['distributionMethod'] when 'limited' Development when 'store' @@ -205,11 +204,10 @@ when 'direct' Direct # Mac-only else raise "Can't find class '#{attrs['distributionMethod']}'" end - # rubocop:enable Lint/MissingRequireStatement # Parse the dates # rubocop:disable Style/RescueModifier attrs['dateExpire'] = (Time.parse(attrs['dateExpire']) rescue attrs['dateExpire']) # rubocop:enable Style/RescueModifier @@ -267,23 +265,23 @@ raise "Invalid sub_platform #{sub_platform}, valid values are tvOS" if !sub_platform.nil? and sub_platform != 'tvOS' # Fill in sensible default values name ||= [bundle_id, self.pretty_type].join(' ') - if self == AppStore || self == InHouse || self == Direct # rubocop:disable Lint/MissingRequireStatement + if self == AppStore || self == InHouse || self == Direct # Distribution Profiles MUST NOT have devices devices = [] end - certificate_parameter = certificate.collect(&:id) if certificate.kind_of? Array + certificate_parameter = certificate.collect(&:id) if certificate.kind_of?(Array) certificate_parameter ||= [certificate.id] # Fix https://github.com/KrauseFx/fastlane/issues/349 certificate_parameter = certificate_parameter.first if certificate_parameter.count == 1 if devices.nil? or devices.count == 0 - if self == Development or self == AdHoc # rubocop:disable Lint/MissingRequireStatement + if self == Development or self == AdHoc # For Development and AdHoc we usually want all compatible devices by default if mac devices = Spaceship::Portal::Device.all_macs elsif sub_platform == 'tvOS' devices = Spaceship::Portal::Device.all_apple_tvs @@ -442,20 +440,20 @@ # sigh handles more specific filtering and validation steps that make this logic OK # # This is the minimum protection needed for people using spaceship directly unless certificate_valid? if mac? - if self.kind_of? Development + if self.kind_of?(Development) self.certificates = [Spaceship::Portal::Certificate::MacDevelopment.all.first] - elsif self.kind_of? Direct + elsif self.kind_of?(Direct) self.certificates = [Spaceship::Portal::Certificate::DeveloperIDApplication.all.first] else self.certificates = [Spaceship::Portal::Certificate::MacAppDistribution.all.first] end else - if self.kind_of? Development + if self.kind_of?(Development) self.certificates = [Spaceship::Portal::Certificate::Development.all.first] - elsif self.kind_of? InHouse + elsif self.kind_of?(InHouse) self.certificates = [Spaceship::Portal::Certificate::InHouse.all.first] else self.certificates = [Spaceship::Portal::Certificate::Production.all.first] end end