Class: Pod::Hooks::InstallerRepresentation

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods/hooks/installer_representation.rb

Overview

The installer representation to pass to the hooks.

Unsafe Hooks API collapse

Public Hooks API collapse

Unsafe Hooks API collapse

Private implementation collapse

Constructor Details

#initialize(installer) ⇒ InstallerRepresentation

Returns a new instance of InstallerRepresentation.

Parameters:



124
125
126
# File 'lib/cocoapods/hooks/installer_representation.rb', line 124

def initialize(installer)
  @installer = installer
end

Instance Attribute Details

#installerInstaller (readonly)

Returns The installer described by this instance.

Returns:

  • (Installer)

    The installer described by this instance.



116
117
118
# File 'lib/cocoapods/hooks/installer_representation.rb', line 116

def installer
  @installer
end

Instance Method Details

#configConfig

Returns The config singleton used for the installation.

Returns:

  • (Config)

    The config singleton used for the installation.



110
111
112
# File 'lib/cocoapods/hooks/installer_representation.rb', line 110

def config
  Config.instance
end

#librariesArray<LibraryRepresentation> Also known as: target_installers

Returns The representation of the libraries.

Returns:



53
54
55
# File 'lib/cocoapods/hooks/installer_representation.rb', line 53

def libraries
  installer.library_reps
end

#podsArray<PodRepresentation>

Returns The representation of the Pods.

Returns:



46
47
48
# File 'lib/cocoapods/hooks/installer_representation.rb', line 46

def pods
  installer.pod_reps
end

#pods_by_libHash{LibraryRepresentation => Array<PodRepresentation>} Also known as: local_pods_by_target

Returns The local pod instances grouped by target.

Returns:



71
72
73
74
75
76
77
78
79
# File 'lib/cocoapods/hooks/installer_representation.rb', line 71

def pods_by_lib
  result = {}
  installer.libraries.each do |lib|
    pod_names = lib.specs.map { |spec| spec.root.name }.uniq
    pod_reps = pods.select { |rep| pod_names.include?(rep.name) }
    result[lib.target_definition] = pod_reps
  end
  result
end

#projectPod::Project

Note:

This value is not yet set in the pre install callbacks.

Returns the ‘Pods/Pods.xcodeproj` project.

Returns:



40
41
42
# File 'lib/cocoapods/hooks/installer_representation.rb', line 40

def project
  installer.pods_project
end

#sandboxSandbox

Returns sandbox the sandbox where the support files should be generated.

Returns:

  • (Sandbox)

    sandbox the sandbox where the support files should be generated.



104
105
106
# File 'lib/cocoapods/hooks/installer_representation.rb', line 104

def sandbox
  installer.sandbox
end

#sandbox_rootPathname

Returns The root of the sandbox.

Returns:

  • (Pathname)

    The root of the sandbox.



32
33
34
# File 'lib/cocoapods/hooks/installer_representation.rb', line 32

def sandbox_root
  installer.sandbox.root
end

#specs_by_libHash{LibraryRepresentation => Array<Specification>} Also known as: specs_by_target

Returns The specifications grouped by target definition.

Returns:



60
61
62
63
64
65
66
# File 'lib/cocoapods/hooks/installer_representation.rb', line 60

def specs_by_lib
  result = {}
  installer.libraries.each do |lib|
    result[installer.library_rep(lib)] = lib.specs
  end
  result
end