Class: Pod::Installer::Analyzer::SandboxAnalyzer
- Inherits:
-
Object
- Object
- Pod::Installer::Analyzer::SandboxAnalyzer
- Defined in:
- lib/cocoapods/installer/analyzer/sandbox_analyzer.rb
Overview
Analyze the sandbox to detect which Pods should be removed, and which ones should be reinstalled.
The logic is the following:
Added
-
If not present in the sandbox lockfile.
-
The directory of the Pod doesn’t exits.
Changed
-
The version of the Pod changed.
-
The SHA of the specification file changed.
-
The specific installed (sub)specs of the same Pod changed.
-
The specification is in head mode or from an external source and the installation process is in update mode.
-
The directory of the Pod is empty.
-
The Pod has been pre-downloaded.
Removed
-
If a specification is present in the lockfile but not in the resolved specs.
Unchanged
-
If none of the above conditions match.
Instance Attribute Summary collapse
-
#lockfile ⇒ Lockfile
readonly
The lockfile of the installation as a fall-back if there is no sandbox manifest.
-
#sandbox ⇒ Sandbox
readonly
The sandbox to analyze.
-
#specs ⇒ Array<Specifications>
readonly
The specifications returned by the resolver.
-
#update_mode ⇒ Bool
readonly
Whether the installation is performed in update mode.
Instance Method Summary collapse
-
#analyze ⇒ SpecsState
Performs the analysis to the detect the state of the sandbox respect to the resolved specifications.
-
#initialize(sandbox, specs, update_mode, lockfile = nil) ⇒ SandboxAnalyzer
constructor
A new instance of SandboxAnalyzer.
Constructor Details
#initialize(sandbox, specs, update_mode, lockfile = nil) ⇒ SandboxAnalyzer
Returns a new instance of SandboxAnalyzer.
59 60 61 62 63 64 |
# File 'lib/cocoapods/installer/analyzer/sandbox_analyzer.rb', line 59 def initialize(sandbox, specs, update_mode, lockfile = nil) @sandbox = sandbox @specs = specs @update_mode = update_mode @lockfile = lockfile end |
Instance Attribute Details
#lockfile ⇒ Lockfile (readonly)
Remove for CP 0.18.
Returns The lockfile of the installation as a fall-back if there is no sandbox manifest. This is indented as a temporary solution to prevent the full re-installation from users which are upgrading from CP < 0.17.
52 53 54 |
# File 'lib/cocoapods/installer/analyzer/sandbox_analyzer.rb', line 52 def lockfile @lockfile end |
#sandbox ⇒ Sandbox (readonly)
Returns The sandbox to analyze.
34 35 36 |
# File 'lib/cocoapods/installer/analyzer/sandbox_analyzer.rb', line 34 def sandbox @sandbox end |
#specs ⇒ Array<Specifications> (readonly)
Returns The specifications returned by the resolver.
39 40 41 |
# File 'lib/cocoapods/installer/analyzer/sandbox_analyzer.rb', line 39 def specs @specs end |
#update_mode ⇒ Bool (readonly)
Returns Whether the installation is performed in update mode.
43 44 45 |
# File 'lib/cocoapods/installer/analyzer/sandbox_analyzer.rb', line 43 def update_mode @update_mode end |
Instance Method Details
#analyze ⇒ SpecsState
Performs the analysis to the detect the state of the sandbox respect to the resolved specifications.
71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/cocoapods/installer/analyzer/sandbox_analyzer.rb', line 71 def analyze state = SpecsState.new if sandbox_manifest all_names = (resolved_pods + sandbox_pods).uniq.sort all_names.sort.each do |name| state.add_name(name, pod_state(name)) end else state.added.concat(resolved_pods) end state end |