Class: PodPrebuild::Lockfile
- Inherits:
-
Object
- Object
- PodPrebuild::Lockfile
- Defined in:
- lib/cocoapods-binary-ht/helper/lockfile.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#lockfile ⇒ Object
readonly
Returns the value of attribute lockfile.
Instance Method Summary collapse
-
#dev_pod_hash(pod_name) ⇒ Object
Return content hash (Hash the directory at source path) of a dev_pod Return nil if it's not a dev_pod.
- #dev_pod_names ⇒ Object
- #dev_pod_sources ⇒ Object
- #dev_pods ⇒ Object
- #external_sources ⇒ Object
-
#initialize(lockfile) ⇒ Lockfile
constructor
A new instance of Lockfile.
- #non_dev_pods ⇒ Object
- #pods ⇒ Object
- #subspec_vendor_pods ⇒ Object
Constructor Details
#initialize(lockfile) ⇒ Lockfile
Returns a new instance of Lockfile.
7 8 9 10 |
# File 'lib/cocoapods-binary-ht/helper/lockfile.rb', line 7 def initialize(lockfile) @lockfile = lockfile @data = lockfile.to_hash end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
5 6 7 |
# File 'lib/cocoapods-binary-ht/helper/lockfile.rb', line 5 def data @data end |
#lockfile ⇒ Object (readonly)
Returns the value of attribute lockfile.
5 6 7 |
# File 'lib/cocoapods-binary-ht/helper/lockfile.rb', line 5 def lockfile @lockfile end |
Instance Method Details
#dev_pod_hash(pod_name) ⇒ Object
Return content hash (Hash the directory at source path) of a dev_pod Return nil if it's not a dev_pod
56 57 58 |
# File 'lib/cocoapods-binary-ht/helper/lockfile.rb', line 56 def dev_pod_hash(pod_name) dev_pod_hashes_map[pod_name] end |
#dev_pod_names ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/cocoapods-binary-ht/helper/lockfile.rb', line 24 def dev_pod_names # There are 2 types of external sources: # - Development pods: declared with `:path` option in Podfile, corresponding to `:path` in the Lockfile # - External remote pods: declared with `:git` option in Podfile, corresponding to `:git` in the Lockfile # -------------------- # EXTERNAL SOURCES: # ADevPod: # :path: path/to/dev_pod # AnExternalRemotePod: # :git: git@remote_url # :commit: abc1234 # -------------------- @dev_pod_names ||= dev_pod_sources.keys.to_set end |
#dev_pod_sources ⇒ Object
20 21 22 |
# File 'lib/cocoapods-binary-ht/helper/lockfile.rb', line 20 def dev_pod_sources @dev_pod_sources ||= external_sources.select { |_, attributes| attributes.key?(:path) } || {} end |
#dev_pods ⇒ Object
39 40 41 42 |
# File 'lib/cocoapods-binary-ht/helper/lockfile.rb', line 39 def dev_pods dev_pod_names_ = dev_pod_names @dev_pods ||= pods.select { |name, _| dev_pod_names_.include?(name) } end |
#external_sources ⇒ Object
16 17 18 |
# File 'lib/cocoapods-binary-ht/helper/lockfile.rb', line 16 def external_sources @data["EXTERNAL SOURCES"] || {} end |
#non_dev_pods ⇒ Object
44 45 46 47 |
# File 'lib/cocoapods-binary-ht/helper/lockfile.rb', line 44 def non_dev_pods dev_pod_names_ = dev_pod_names @non_dev_pods ||= pods.reject { |name, _| dev_pod_names_.include?(name) } end |
#pods ⇒ Object
12 13 14 |
# File 'lib/cocoapods-binary-ht/helper/lockfile.rb', line 12 def pods @pods ||= (@data["PODS"] || []).map { |v| pod_from(v) }.to_h end |
#subspec_vendor_pods ⇒ Object
49 50 51 52 |
# File 'lib/cocoapods-binary-ht/helper/lockfile.rb', line 49 def subspec_vendor_pods dev_pod_names_ = dev_pod_names @subspec_vendor_pods ||= subspec_pods.reject { |name, _| dev_pod_names_.include?(name) } end |