cert/lib/cert/runner.rb in fastlane-2.74.1 vs cert/lib/cert/runner.rb in fastlane-2.75.0.beta.20180109010003

- old
+ new

@@ -11,21 +11,21 @@ class Runner def launch run installed = FastlaneCore::CertChecker.installed?(ENV["CER_FILE_PATH"]) - UI.message "Verifying the certificate is properly installed locally..." + UI.message("Verifying the certificate is properly installed locally...") UI.user_error!("Could not find the newly generated certificate installed", show_github_issues: true) unless installed - UI.success "Successfully installed certificate #{ENV['CER_CERTIFICATE_ID']}" + UI.success("Successfully installed certificate #{ENV['CER_CERTIFICATE_ID']}") return ENV["CER_FILE_PATH"] end def login - UI.message "Starting login with user '#{Cert.config[:username]}'" + UI.message("Starting login with user '#{Cert.config[:username]}'") Spaceship.login(Cert.config[:username], nil) Spaceship.select_team - UI.message "Successfully logged in" + UI.message("Successfully logged in") end def run FileUtils.mkdir_p(Cert.config[:output_path]) @@ -55,28 +55,28 @@ login to_revoke = expired_certs if to_revoke.empty? - UI.success "No expired certificates were found to revoke! 👍" + UI.success("No expired certificates were found to revoke! 👍") return end revoke_count = 0 to_revoke.each do |certificate| begin - UI.message "#{certificate.id} #{certificate.name} has expired, revoking..." + UI.message("#{certificate.id} #{certificate.name} has expired, revoking...") certificate.revoke! revoke_count += 1 rescue => e - UI.error "An error occurred while revoking #{certificate.id} #{certificate.name}" - UI.error "#{e.message}\n#{e.backtrace.join("\n")}" if FastlaneCore::Globals.verbose? + UI.error("An error occurred while revoking #{certificate.id} #{certificate.name}") + UI.error("#{e.message}\n#{e.backtrace.join("\n")}") if FastlaneCore::Globals.verbose? end end - UI.success "#{revoke_count} expired certificate#{'s' if revoke_count != 1} #{revoke_count == 1 ? 'has' : 'have'} been revoked! 👍" + UI.success("#{revoke_count} expired certificate#{'s' if revoke_count != 1} #{revoke_count == 1 ? 'has' : 'have'} been revoked! 👍") end def expired_certs certificates.select do |certificate| certificate.expires < Time.now.utc @@ -95,11 +95,11 @@ if FastlaneCore::CertChecker.installed?(path) # This certificate is installed on the local machine ENV["CER_CERTIFICATE_ID"] = certificate.id ENV["CER_FILE_PATH"] = path - UI.success "Found the certificate #{certificate.id} (#{certificate.name}) which is installed on the local machine. Using this one." + UI.success("Found the certificate #{certificate.id} (#{certificate.name}) which is installed on the local machine. Using this one.") return path elsif File.exist?(private_key_path) keychain = File.expand_path(Cert.config[:keychain_path]) password = Cert.config[:keychain_password] @@ -107,21 +107,21 @@ FastlaneCore::KeychainImporter.import_file(path, keychain, keychain_password: password) ENV["CER_CERTIFICATE_ID"] = certificate.id ENV["CER_FILE_PATH"] = path - UI.success "Found the cached certificate #{certificate.id} (#{certificate.name}). Using this one." + UI.success("Found the cached certificate #{certificate.id} (#{certificate.name}). Using this one.") return path else - UI.error "Certificate #{certificate.id} (#{certificate.name}) can't be found on your local computer" + UI.error("Certificate #{certificate.id} (#{certificate.name}) can't be found on your local computer") end File.delete(path) # as apparently this certificate is pretty useless without a private key end - UI.important "Couldn't find an existing certificate... creating a new one" + UI.important("Couldn't find an existing certificate... creating a new one") return nil end # All certificates of this type def certificates @@ -180,10 +180,10 @@ # Environment variables for the fastlane action ENV["CER_CERTIFICATE_ID"] = certificate.id ENV["CER_FILE_PATH"] = cert_path - UI.success "Successfully generated #{certificate.id} which was imported to the local machine." + UI.success("Successfully generated #{certificate.id} which was imported to the local machine.") return cert_path end def store_certificate(certificate)