class Pod::PrebuildSandbox

Public Class Methods

from_standard_sanbox_path(path) click to toggle source
String

standard_sandbox_path

# File lib/cocoapods-binary-cache/pod-binary/helper/prebuild_sandbox.rb, line 6
def self.from_standard_sanbox_path(path)
  prebuild_sandbox_path = Pathname.new(path).realpath + ".." + PodPrebuild.config.prebuild_sandbox_path
  new(prebuild_sandbox_path)
end
from_standard_sandbox(sandbox) click to toggle source
# File lib/cocoapods-binary-cache/pod-binary/helper/prebuild_sandbox.rb, line 11
def self.from_standard_sandbox(sandbox)
  from_standard_sanbox_path(sandbox.root)
end

Public Instance Methods

existed_target_names_for_pod_name(pod_name) click to toggle source
# File lib/cocoapods-binary-cache/pod-binary/helper/prebuild_sandbox.rb, line 37
def existed_target_names_for_pod_name(pod_name)
  existed_framework_name_pairs.select { |pair| pair[1] == pod_name }.map { |pair| pair[0] }
end
exsited_framework_pod_names() click to toggle source
# File lib/cocoapods-binary-cache/pod-binary/helper/prebuild_sandbox.rb, line 33
def exsited_framework_pod_names
  existed_framework_name_pairs.map { |pair| pair[1] }.uniq
end
exsited_framework_target_names() click to toggle source
# File lib/cocoapods-binary-cache/pod-binary/helper/prebuild_sandbox.rb, line 29
def exsited_framework_target_names
  existed_framework_name_pairs.map { |pair| pair[0] }.uniq
end
framework_folder_path_for_target_name(name) click to toggle source

@param name [String] pass the target.name (may containing platform suffix) @return [Pathname] the folder containing the framework file.

# File lib/cocoapods-binary-cache/pod-binary/helper/prebuild_sandbox.rb, line 25
def framework_folder_path_for_target_name(name)
  generate_framework_path + name
end
generate_framework_path() click to toggle source
# File lib/cocoapods-binary-cache/pod-binary/helper/prebuild_sandbox.rb, line 19
def generate_framework_path
  root + "GeneratedFrameworks"
end
save_pod_name_for_target(target) click to toggle source
# File lib/cocoapods-binary-cache/pod-binary/helper/prebuild_sandbox.rb, line 41
def save_pod_name_for_target(target)
  folder = framework_folder_path_for_target_name(target.name)
  return unless folder.exist?

  flag_file_path = folder + "#{target.pod_name}.pod_name"
  File.write(flag_file_path.to_s, "")
end
standard_sanbox_path() click to toggle source
# File lib/cocoapods-binary-cache/pod-binary/helper/prebuild_sandbox.rb, line 15
def standard_sanbox_path
  root.parent
end

Private Instance Methods

existed_framework_name_pairs() click to toggle source

Array<[target_name, pod_name]>

# File lib/cocoapods-binary-cache/pod-binary/helper/prebuild_sandbox.rb, line 61
def existed_framework_name_pairs
  return [] unless generate_framework_path.exist?

  generate_framework_path.children.map do |framework_path|
    if framework_path.directory? && !framework_path.children.empty?
      [framework_path.basename.to_s, pod_name_for_target_folder(framework_path)]
    end
  end.reject(&:nil?).uniq
end
pod_name_for_target_folder(target_folder_path) click to toggle source
# File lib/cocoapods-binary-cache/pod-binary/helper/prebuild_sandbox.rb, line 51
def pod_name_for_target_folder(target_folder_path)
  name = Pathname.new(target_folder_path).children.find do |child|
    child.to_s.end_with? ".pod_name"
  end
  name = name.basename(".pod_name").to_s unless name.nil?
  name ||= Pathname.new(target_folder_path).basename.to_s # for compatibility with older version
  name
end