Sha256: 83717044468dd05e5206086598d3b8ad3804b7358ed012ae647765983a922776

Contents?: true

Size: 1.36 KB

Versions: 40

Compression:

Stored size: 1.36 KB

Contents

module Fastlane
  module Actions
    class VerifyPodKeysAction < Action
      def self.run(params)
        Helper.log.info "Validating CocoaPods Keys"

        options = plugin_options
        target = options["target"] || ""

        options["keys"].each do |key|
          Helper.log.info " - #{key}"
          validate(key, target)
        end
      end

      def self.plugin_options
        require 'cocoapods-core'
        podfile = Pod::Podfile.from_file "Podfile"
        podfile.plugins["cocoapods-keys"]
      end

      def self.validate(key, target)
        if value(key, target).length < 2
          message = "Did not pass validation for key #{key}. " \
            "Run `[bundle exec] pod keys get #{key} #{target}` to see what it is. " \
            "It's likely this is running with empty/OSS keys."
          raise message
        end
      end

      def self.value(key, target)
        value = `pod keys get #{key} #{target}`
        value.split("]").last.strip
      end

      def self.author
        "ashfurrow"
      end

      #####################################################
      # @!group Documentation
      #####################################################

      def self.description
        "Verifies all keys referenced from the Podfile are non-empty"
      end

      def self.is_supported?(platform)
        return true
      end
    end
  end
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
fastlane-1.66.0 lib/fastlane/actions/verify_pod_keys.rb
fastlane-1.65.0 lib/fastlane/actions/verify_pod_keys.rb
fastlane-1.64.0 lib/fastlane/actions/verify_pod_keys.rb
fastlane-1.63.1 lib/fastlane/actions/verify_pod_keys.rb
fastlane-1.63.0 lib/fastlane/actions/verify_pod_keys.rb
fastlane-1.62.0 lib/fastlane/actions/verify_pod_keys.rb
fastlane-1.61.0 lib/fastlane/actions/verify_pod_keys.rb
fastlane-1.60.0 lib/fastlane/actions/verify_pod_keys.rb
fastlane-1.59.0 lib/fastlane/actions/verify_pod_keys.rb
fastlane-1.58.0 lib/fastlane/actions/verify_pod_keys.rb
fastlane-1.57.0 lib/fastlane/actions/verify_pod_keys.rb
fastlane-1.56.0 lib/fastlane/actions/verify_pod_keys.rb
fastlane-1.55.0 lib/fastlane/actions/verify_pod_keys.rb
fastlane-1.54.0 lib/fastlane/actions/verify_pod_keys.rb
fastlane-1.53.0 lib/fastlane/actions/verify_pod_keys.rb
fastlane-1.52.0 lib/fastlane/actions/verify_pod_keys.rb
fastlane-1.51.0 lib/fastlane/actions/verify_pod_keys.rb
fastlane-1.50.0 lib/fastlane/actions/verify_pod_keys.rb
fastlane-1.49.0 lib/fastlane/actions/verify_pod_keys.rb
fastlane-1.48.0 lib/fastlane/actions/verify_pod_keys.rb