42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
|
# File 'lib/cocoapods-dist/command/dist.rb', line 42
def run
validate!
cloneToCache
fetchGit
outdated = Pod::Command::Outdated.parse([])
updates = outdated.public_updates
updates = updates.select {|subArr| subArr[0] == @name} unless updates.empty?
if updates.empty?
UI.puts 'No pod updates are available.'.yellow
else
UI.section 'The color indicates what happens when you run `pod update`' do
UI.puts "#{'<green>'.green}\t - Will be updated to the newest version"
UI.puts "#{'<blue>'.blue}\t - Will be updated, but not to the newest version because of specified version in Podfile"
UI.puts "#{'<red>'.red}\t - Will not be updated because of specified version in Podfile"
UI.puts ''
end if ansi_output?
UI.section "The following pod update #{@name} are available:" do
updates.each do |(name, from_version, matching_version, to_version)|
color = :blue
if matching_version == to_version
color = :green
elsif from_version == matching_version
color = :red
end
UI.puts "- #{name} #{from_version.to_s.send(color)} -> #{matching_version.to_s.send(color)} " \
"(latest version #{to_version.to_s})"
unless matching_version.version.empty? || from_version.version.empty?
if @commit
commit_sha_start = git('rev-parse',from_version).chomp
commit_sha_end = git('rev-parse',matching_version).chomp
log = git('log','--pretty=format:"%h %s"',"#{commit_sha_start}...#{commit_sha_end}").chomp
UI.puts "#{log}"
else
Dir.chdir(env_git) {
tags = (git! ['tag']).split("\n")
tags.each do |tag|
if versionGreat(tag.to_s,from_version.to_s) && versionGreatOrEqual(matching_version.to_s,tag.to_s)
commit_sha = git('rev-parse',tag).chomp
log = git('log','--pretty=format:"%s"','-n 1',commit_sha).chomp
UI.puts "[#{tag}]: ".send(color) + "#{log}"
end
end
}
end
end
end
end
end
end
|