class TYCiCore::TYDependencies

Attributes

content[RW]
path[RW]

Public Class Methods

new(path) click to toggle source
# File lib/tuya/ci/core/dependencies.rb, line 6
def initialize(path)
        @path = path
        @content = ''
end

Public Instance Methods

analysis() click to toggle source
# File lib/tuya/ci/core/dependencies.rb, line 31
def analysis
        content = File.read @path

        podfile_lock = TYPodFileLock.new content

        analysis = TYPodAnalyse.new podfile_lock
        analysis.sorted_pods
end
sort_pods(pods) click to toggle source
# File lib/tuya/ci/core/dependencies.rb, line 11
def sort_pods(pods)
        if File.exist? @path
                lock_pods = analysis
                pods_hash = Hash.new
                pods.each do |pod|
                        pods_hash[pod["name"]] = pod
                end
                result = []
                lock_pods.each do |lock_pod|
                        if pods_hash.keys.include? lock_pod
                                result.push pods_hash[lock_pod]
                        end
                end
                result
        else
                puts "Can not find file: #{@path}".red
                pods
        end
end