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 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
-
#podfile ⇒ Podfile
readonly
The Podfile to analyze dependencies.
-
#sandbox ⇒ Sandbox
readonly
The sandbox to analyze.
-
#specs ⇒ Array<Specifications>
readonly
The specifications returned by the resolver.
-
#update_mode ⇒ Boolean
(also: #update_mode?)
readonly
Whether the installation is performed in update mode.
Instance Method Summary collapse
-
#analyze ⇒ void
Performs the analysis to the detect the state of the sandbox respect to the resolved specifications.
-
#initialize(sandbox, podfile, specs, update_mode) ⇒ SandboxAnalyzer
constructor
Init a new SandboxAnalyzer.
Constructor Details
#initialize(sandbox, podfile, specs, update_mode) ⇒ SandboxAnalyzer
Init a new SandboxAnalyzer
56 57 58 59 60 61 |
# File 'lib/cocoapods/installer/analyzer/sandbox_analyzer.rb', line 56 def initialize(sandbox, podfile, specs, update_mode) @sandbox = sandbox @podfile = podfile @specs = specs @update_mode = update_mode end |
Instance Attribute Details
#podfile ⇒ Podfile (readonly)
Returns The Podfile to analyze dependencies.
36 37 38 |
# File 'lib/cocoapods/installer/analyzer/sandbox_analyzer.rb', line 36 def podfile @podfile end |
#sandbox ⇒ Sandbox (readonly)
Returns The sandbox to analyze.
32 33 34 |
# File 'lib/cocoapods/installer/analyzer/sandbox_analyzer.rb', line 32 def sandbox @sandbox end |
#specs ⇒ Array<Specifications> (readonly)
Returns The specifications returned by the resolver.
41 42 43 |
# File 'lib/cocoapods/installer/analyzer/sandbox_analyzer.rb', line 41 def specs @specs end |
#update_mode ⇒ Boolean (readonly) Also known as: update_mode?
Returns Whether the installation is performed in update mode.
45 46 47 |
# File 'lib/cocoapods/installer/analyzer/sandbox_analyzer.rb', line 45 def update_mode @update_mode end |
Instance Method Details
#analyze ⇒ void
This method returns an undefined value.
Performs the analysis to the detect the state of the sandbox respect to the resolved specifications.
68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/cocoapods/installer/analyzer/sandbox_analyzer.rb', line 68 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.merge(resolved_pods) end state end |