class Fastlane::Helper::Certificate
Public Class Methods
certificate(params)
click to toggle source
# File lib/fastlane/plugin/push_cert_alert/helper/certificate_helper.rb, line 6 def self.certificate(params) if params[:development] Spaceship.certificate.development_push elsif params[:website_push] Spaceship.certificate.website_push else Spaceship.certificate.production_push end end
certificate_sorted(params)
click to toggle source
# File lib/fastlane/plugin/push_cert_alert/helper/certificate_helper.rb, line 26 def self.certificate_sorted(params) certificate(params).all.sort { |x, y| y.expires <=> x.expires } end
certificate_type(params)
click to toggle source
# File lib/fastlane/plugin/push_cert_alert/helper/certificate_helper.rb, line 16 def self.certificate_type(params) if params[:development] 'development' elsif params[:website_push] 'website' else 'production' end end
existing_certificate(params)
click to toggle source
# File lib/fastlane/plugin/push_cert_alert/helper/certificate_helper.rb, line 30 def self.existing_certificate(params) certificate_sorted(params).detect do |c| c.owner_name == params[:app_identifier] end end
remaining_days(certificate)
click to toggle source
# File lib/fastlane/plugin/push_cert_alert/helper/certificate_helper.rb, line 36 def self.remaining_days(certificate) ((certificate.expires - Time.now) / 60 / 60 / 24).round(2) end