Class: Pod::DyInstaller::PodSourceInstaller
- Inherits:
-
Object
- Object
- Pod::DyInstaller::PodSourceInstaller
- Defined in:
- lib/pod/installer/pod_source_installer.rb
Overview
This class needs to consider all the activated specs of a Pod.
Controller class responsible of installing the activated specifications of a single Pod.
Installation collapse
- #specific_source ⇒ Hash readonly
Instance Attribute Summary collapse
-
#can_cache ⇒ Boolean
(also: #can_cache?)
readonly
Whether the installer is allowed to touch the cache.
-
#sandbox ⇒ Sandbox
readonly
The installation target.
-
#specs_by_platform ⇒ Hash{Symbol=>Array}
readonly
The specifications that need to be installed grouped by platform.
Installation collapse
-
#clean! ⇒ void
Cleans the installations if appropriate.
-
#install! ⇒ void
Creates the target in the Pods project and the relative support files.
-
#lock_files!(file_accessors) ⇒ void
Locks the source files if appropriate.
-
#unlock_files!(file_accessors) ⇒ void
Unlocks the source files if appropriate.
Instance Method Summary collapse
-
#initialize(sandbox, specs_by_platform, can_cache: true) ⇒ PodSourceInstaller
constructor
Initialize a new instance.
-
#inspect ⇒ String
A string suitable for debugging.
-
#name ⇒ String
The name of the pod this installer is installing.
Constructor Details
#initialize(sandbox, specs_by_platform, can_cache: true) ⇒ PodSourceInstaller
Initialize a new instance
31 32 33 34 35 |
# File 'lib/pod/installer/pod_source_installer.rb', line 31 def initialize(sandbox, specs_by_platform, can_cache: true) @sandbox = sandbox @specs_by_platform = specs_by_platform @can_cache = can_cache end |
Instance Attribute Details
#can_cache ⇒ Boolean (readonly) Also known as: can_cache?
Returns Whether the installer is allowed to touch the cache.
22 23 24 |
# File 'lib/pod/installer/pod_source_installer.rb', line 22 def can_cache @can_cache end |
#sandbox ⇒ Sandbox (readonly)
Returns The installation target.
13 14 15 |
# File 'lib/pod/installer/pod_source_installer.rb', line 13 def sandbox @sandbox end |
#specific_source ⇒ Hash (readonly)
Returns @see Downloader#checkout_options.
105 106 107 |
# File 'lib/pod/installer/pod_source_installer.rb', line 105 def specific_source @specific_source end |
#specs_by_platform ⇒ Hash{Symbol=>Array} (readonly)
Returns The specifications that need to be installed grouped by platform.
18 19 20 |
# File 'lib/pod/installer/pod_source_installer.rb', line 18 def specs_by_platform @specs_by_platform end |
Instance Method Details
#clean! ⇒ void
As the pre install hooks need to run before cleaning this method should be refactored.
This method returns an undefined value.
Cleans the installations if appropriate.
71 72 73 |
# File 'lib/pod/installer/pod_source_installer.rb', line 71 def clean! clean_installation unless local? end |
#inspect ⇒ String
Returns A string suitable for debugging.
39 40 41 |
# File 'lib/pod/installer/pod_source_installer.rb', line 39 def inspect "<#{self.class} sandbox=#{sandbox.root} pod=#{root_spec.name}" end |
#install! ⇒ void
This method returns an undefined value.
Creates the target in the Pods project and the relative support files.
59 60 61 62 |
# File 'lib/pod/installer/pod_source_installer.rb', line 59 def install! download_source unless predownloaded? || local? PodSourcePreparer.new(root_spec, root).prepare! if local? end |
#lock_files!(file_accessors) ⇒ void
As the pre install hooks need to run before cleaning this method should be refactored.
This method returns an undefined value.
Locks the source files if appropriate.
82 83 84 85 86 87 |
# File 'lib/pod/installer/pod_source_installer.rb', line 82 def lock_files!(file_accessors) return if local? each_source_file(file_accessors) do |source_file| FileUtils.chmod('u-w', source_file) end end |
#name ⇒ String
Returns The name of the pod this installer is installing.
45 46 47 |
# File 'lib/pod/installer/pod_source_installer.rb', line 45 def name root_spec.name end |
#unlock_files!(file_accessors) ⇒ void
As the pre install hooks need to run before cleaning this method should be refactored.
This method returns an undefined value.
Unlocks the source files if appropriate.
96 97 98 99 100 101 |
# File 'lib/pod/installer/pod_source_installer.rb', line 96 def unlock_files!(file_accessors) return if local? each_source_file(file_accessors) do |source_file| FileUtils.chmod('u+w', source_file) end end |