Class: Pod::Hooks::InstallerRepresentation
- Inherits:
-
Object
- Object
- Pod::Hooks::InstallerRepresentation
- Defined in:
- lib/cocoapods/hooks/installer_representation.rb
Overview
The installer representation to pass to the hooks.
Unsafe Hooks API collapse
-
#installer ⇒ Installer
readonly
The installer described by this instance.
Public Hooks API collapse
-
#libraries ⇒ Array<LibraryRepresentation>
(also: #target_installers)
The representation of the libraries.
-
#pods ⇒ Array<PodRepresentation>
The representation of the Pods.
-
#pods_by_lib ⇒ Hash{LibraryRepresentation => Array<PodRepresentation>}
(also: #local_pods_by_target)
The local pod instances grouped by target.
-
#project ⇒ Pod::Project
The ‘Pods/Pods.xcodeproj` project.
-
#sandbox_root ⇒ Pathname
The root of the sandbox.
-
#specs_by_lib ⇒ Hash{LibraryRepresentation => Array<Specification>}
(also: #specs_by_target)
The specifications grouped by target definition.
Unsafe Hooks API collapse
-
#config ⇒ Config
The config singleton used for the installation.
-
#sandbox ⇒ Sandbox
Sandbox the sandbox where the support files should be generated.
Private implementation collapse
-
#initialize(installer) ⇒ InstallerRepresentation
constructor
A new instance of InstallerRepresentation.
Constructor Details
#initialize(installer) ⇒ InstallerRepresentation
Returns a new instance of InstallerRepresentation.
124 125 126 |
# File 'lib/cocoapods/hooks/installer_representation.rb', line 124 def initialize(installer) @installer = installer end |
Instance Attribute Details
#installer ⇒ Installer (readonly)
Returns 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
#config ⇒ Config
Returns The config singleton used for the installation.
110 111 112 |
# File 'lib/cocoapods/hooks/installer_representation.rb', line 110 def config Config.instance end |
#libraries ⇒ Array<LibraryRepresentation> Also known as: target_installers
Returns The representation of the libraries.
53 54 55 |
# File 'lib/cocoapods/hooks/installer_representation.rb', line 53 def libraries installer.library_reps end |
#pods ⇒ Array<PodRepresentation>
Returns The representation of the Pods.
46 47 48 |
# File 'lib/cocoapods/hooks/installer_representation.rb', line 46 def pods installer.pod_reps end |
#pods_by_lib ⇒ Hash{LibraryRepresentation => Array<PodRepresentation>} Also known as: local_pods_by_target
Returns The local pod instances grouped by target.
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 |
#project ⇒ Pod::Project
This value is not yet set in the pre install callbacks.
Returns the ‘Pods/Pods.xcodeproj` project.
40 41 42 |
# File 'lib/cocoapods/hooks/installer_representation.rb', line 40 def project installer.pods_project end |
#sandbox ⇒ Sandbox
Returns 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_root ⇒ Pathname
Returns 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_lib ⇒ Hash{LibraryRepresentation => Array<Specification>} Also known as: specs_by_target
Returns The specifications grouped by target definition.
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 |