Sha256: 2ca7d1b7a937359563b7a1bdfe142df00d2e1d112e0ee442b34994fda8bf926e

Contents?: true

Size: 1.35 KB

Versions: 35

Compression:

Stored size: 1.35 KB

Contents

module Fastlane
  module Actions
    class VerifyPodKeysAction < Action
      def self.run(params)
        UI.message("Validating CocoaPods Keys")

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

        options["keys"].each do |key|
          UI.message(" - #{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

35 entries across 35 versions & 1 rubygems

Version Path
fastlane-1.102.0 lib/fastlane/actions/verify_pod_keys.rb
fastlane-1.101.0 lib/fastlane/actions/verify_pod_keys.rb
fastlane-1.100.0 lib/fastlane/actions/verify_pod_keys.rb
fastlane-1.99.0 lib/fastlane/actions/verify_pod_keys.rb
fastlane-1.98.0 lib/fastlane/actions/verify_pod_keys.rb
fastlane-1.97.2 lib/fastlane/actions/verify_pod_keys.rb
fastlane-1.97.1 lib/fastlane/actions/verify_pod_keys.rb
fastlane-1.97.0 lib/fastlane/actions/verify_pod_keys.rb
fastlane-1.96.0 lib/fastlane/actions/verify_pod_keys.rb
fastlane-1.95.0 lib/fastlane/actions/verify_pod_keys.rb
fastlane-1.94.1 lib/fastlane/actions/verify_pod_keys.rb
fastlane-1.94.0 lib/fastlane/actions/verify_pod_keys.rb
fastlane-1.93.1 lib/fastlane/actions/verify_pod_keys.rb
fastlane-1.93.0 lib/fastlane/actions/verify_pod_keys.rb
fastlane-1.92.0 lib/fastlane/actions/verify_pod_keys.rb
fastlane-1.92.0.beta2 lib/fastlane/actions/verify_pod_keys.rb
fastlane-1.92.0.beta1 lib/fastlane/actions/verify_pod_keys.rb
fastlane-1.91.0 lib/fastlane/actions/verify_pod_keys.rb
fastlane-1.90.0 lib/fastlane/actions/verify_pod_keys.rb
fastlane-1.89.0 lib/fastlane/actions/verify_pod_keys.rb