class Fastlane::Actions::VerifyPodKeysAction

Public Class Methods

author() click to toggle source
# File fastlane/lib/fastlane/actions/verify_pod_keys.rb, line 36
def self.author
  "ashfurrow"
end
category() click to toggle source
# File fastlane/lib/fastlane/actions/verify_pod_keys.rb, line 62
def self.category
  :building
end
description() click to toggle source

@!group Documentation

# File fastlane/lib/fastlane/actions/verify_pod_keys.rb, line 44
def self.description
  "Verifies all keys referenced from the Podfile are non-empty"
end
details() click to toggle source
# File fastlane/lib/fastlane/actions/verify_pod_keys.rb, line 48
def self.details
  "Runs a check against all keys specified in your Podfile to make sure they're more than a single character long. This is to ensure you don't deploy with stubbed keys."
end
example_code() click to toggle source
# File fastlane/lib/fastlane/actions/verify_pod_keys.rb, line 56
def self.example_code
  [
    'verify_pod_keys'
  ]
end
is_supported?(platform) click to toggle source
# File fastlane/lib/fastlane/actions/verify_pod_keys.rb, line 52
def self.is_supported?(platform)
  [:ios, :mac].include?(platform)
end
plugin_options() click to toggle source
# File fastlane/lib/fastlane/actions/verify_pod_keys.rb, line 16
def self.plugin_options
  require 'cocoapods-core'
  podfile = Pod::Podfile.from_file("Podfile")
  podfile.plugins["cocoapods-keys"]
end
run(params) click to toggle source
# File fastlane/lib/fastlane/actions/verify_pod_keys.rb, line 4
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
validate(key, target) click to toggle source
# File fastlane/lib/fastlane/actions/verify_pod_keys.rb, line 22
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
value(key, target) click to toggle source
# File fastlane/lib/fastlane/actions/verify_pod_keys.rb, line 31
def self.value(key, target)
  value = `pod keys get #{key} #{target}`
  value.split("]").last.strip
end