class TYCiCore::TYPodFileLock

Attributes

all_pods[RW]
pods[RW]

Public Class Methods

new(text) click to toggle source
# File lib/tuya/ci/core/dependencies/podfile_lock.rb, line 6
def initialize(text)
         all_pods_temp = text.scan /^\s+(\w+-*\w+): [0-9a-zA-Z]*$/

         @all_pods = []

         all_pods_temp.each do |pod|
                 @all_pods << pod[0]
         end

         @pods = Hash.new
         @all_pods.each do |pod|
                 pod_dependencies = []
                 pod_scan = text.scan /^\s{2}-\s+#{pod}\s+.*:((\n\s{4}-\s+.*)*)/
                 pod_scan.each do |pod_item|
                         if pod_item.size > 0
                                 item = pod_item[0]
                                 item.gsub!(/\n/, '')
                                 item.split('    - ').each do |item_content|
                                         if item_content != ""
                                                 item_content_clean = item_content.gsub!(/\s\(.*\s.*\)/, '')
                                                 if item_content_clean
                                                         pod_dependencies.push item_content_clean
                                                 else
                                                         pod_dependencies.push item_content
                                                 end
                                         end
                                 end
                         end
                 end
                 @pods[pod] = pod_dependencies if pod_dependencies.size > 0
         end
end