Class: Luna::Binary::Update

Inherits:
Object
  • Object
show all
Defined in:
lib/luna/binary/update.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#binary_pathObject

Returns the value of attribute binary_path.



8
9
10
# File 'lib/luna/binary/update.rb', line 8

def binary_path
  @binary_path
end

#request_result_hashObject

Returns the value of attribute request_result_hash.



9
10
11
# File 'lib/luna/binary/update.rb', line 9

def request_result_hash
  @request_result_hash
end

Instance Method Details

#runObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/luna/binary/update.rb', line 11

def run 
    spec_repo_binary = Common.instance.createNeedFrameworkMapper
    failList = []
    successList = []
    dependenciesMapper = Common.instance.dependenciesMapper
    spec_repo_binary.each { |k,v|
        if request_result_hash[k] == nil || request_result_hash[k].include?(v) == false
            begin
                uploader = Common.instance.upload_lockitem(dependenciesMapper, k, binary_path)
                if uploader != nil
                    successList << uploader
                else
                    failList << "#{k} #{v} 失败,请确保在非二进制状态下"
                end
                
            rescue => exception
                failList << "#{k} exception: #{exception}"
            ensure
                
            end
        else   
          failList << "已存在name: #{k} version #{v} 的framework"
        end 
    } 
    puts "-=-=-=-=-=-=-=-=framework制作中-=-=-=-=-=-=-=-=-=-=".yellow
    successList.each { |item|
        puts "#{item.podspecName} 制作中".yellow
        item.upload
    }

    puts "-=-=-=-=-=-=-=-=更新成功名单-=-=-=-=-=-=-=-=-=-=".yellow
    successList.each { |item|
        puts "#{item.podspecName}".yellow
    }

    puts "-=-=-=-=-=-=-=-=update 失败名单-=-=-=-=-=-=-=-=-=-=".yellow if failList.length > 0
    failList.each {|item|
        puts item.red
    }

end