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.47.0 lib/fastlane/actions/verify_pod_keys.rb
fastlane-1.46.1 lib/fastlane/actions/verify_pod_keys.rb
fastlane-1.46.0 lib/fastlane/actions/verify_pod_keys.rb
fastlane-1.45.0 lib/fastlane/actions/verify_pod_keys.rb
fastlane-1.44.0 lib/fastlane/actions/verify_pod_keys.rb
fastlane-1.43.0 lib/fastlane/actions/verify_pod_keys.rb
fastlane-1.42.0 lib/fastlane/actions/verify_pod_keys.rb
fastlane-1.41.1 lib/fastlane/actions/verify_pods_keys.rb
fastlane-1.41.0 lib/fastlane/actions/verify_pods_keys.rb
fastlane-1.40.0 lib/fastlane/actions/verify_pods_keys.rb
fastlane-1.39.0 lib/fastlane/actions/verify_pods_keys.rb
fastlane-1.38.1 lib/fastlane/actions/verify_pods_keys.rb
fastlane-1.38.0 lib/fastlane/actions/verify_pods_keys.rb
fastlane-1.37.0 lib/fastlane/actions/verify_pods_keys.rb
fastlane-1.36.4 lib/fastlane/actions/verify_pods_keys.rb
fastlane-1.36.3 lib/fastlane/actions/verify_pods_keys.rb
fastlane-1.36.2 lib/fastlane/actions/verify_pods_keys.rb
fastlane-1.36.1 lib/fastlane/actions/verify_pods_keys.rb
fastlane-1.36.0 lib/fastlane/actions/verify_pods_keys.rb
fastlane-1.35.0 lib/fastlane/actions/verify_pods_keys.rb