cocoapods-lzsource 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +3 -0
- data/Gemfile +13 -0
- data/LICENSE.txt +22 -0
- data/README.md +11 -0
- data/Rakefile +13 -0
- data/cocoapods-lzsource.gemspec +22 -0
- data/lib/cocoapods-lzsource.rb +1 -0
- data/lib/cocoapods-lzsource/command.rb +1 -0
- data/lib/cocoapods-lzsource/command/gitlab.rb +205 -0
- data/lib/cocoapods-lzsource/command/lzsource.rb +326 -0
- data/lib/cocoapods-lzsource/gem_version.rb +3 -0
- data/lib/cocoapods_plugin.rb +1 -0
- data/spec/command/lzsource_spec.rb +12 -0
- data/spec/spec_helper.rb +50 -0
- metadata +88 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: c164e0d39f4e2fb8c0e2dc04b2ff493c047b23dd
|
4
|
+
data.tar.gz: b99ddeb3cfd89b468d230840c5523d78e179656f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 826806722214bb1c439109c88ee57c280867d49b35e4e5b68a2cbb9beae96cb91f60d526905b859ca3997957649947489d3e201030c6141552192330c7a222a0
|
7
|
+
data.tar.gz: ef2ced95822da4a301391b1f26e4984336e98a02f32c2fdd8d87c2a57cc9de697013a6002ce3cd3b5242b55d5222845f9a024642564529afe60171f5d5faa861
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2019 ningyuan <ningyuan@qiyi.com>
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'cocoapods-lzsource/gem_version.rb'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'cocoapods-lzsource'
|
8
|
+
spec.version = CocoapodsLzsource::VERSION
|
9
|
+
spec.authors = ['ningyuan']
|
10
|
+
spec.email = ['m13811217138@gmail.com']
|
11
|
+
spec.description = %q{cocoapods-lzsource.}
|
12
|
+
spec.summary = %q{cocoapods-lzsource.}
|
13
|
+
spec.homepage = 'https://github.com/Jeremi-LZ'
|
14
|
+
spec.license = 'MIT'
|
15
|
+
spec.files = `git ls-files`.split($/)+Dir.glob("lib/**/*")
|
16
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
17
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
|
+
spec.require_paths = ['lib']
|
19
|
+
|
20
|
+
spec.add_development_dependency 'bundler', '~> 1.3'
|
21
|
+
spec.add_development_dependency 'rake'
|
22
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'cocoapods-lzsource/gem_version'
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'cocoapods-lzsource/command/lzsource'
|
@@ -0,0 +1,205 @@
|
|
1
|
+
require "open-uri"
|
2
|
+
require 'net/https'
|
3
|
+
require 'json'
|
4
|
+
|
5
|
+
$Private_Token = ''
|
6
|
+
|
7
|
+
$GitHTTP_Address = ''
|
8
|
+
|
9
|
+
UserPathFile = File.expand_path('~')+'/.lzsource_user'
|
10
|
+
|
11
|
+
class GitLabHttp
|
12
|
+
|
13
|
+
def checkUserInfo()
|
14
|
+
if File.exist?(UserPathFile)
|
15
|
+
f = File.open(UserPathFile, 'r')
|
16
|
+
a = f.readlines.map! { |line| line.chomp }
|
17
|
+
|
18
|
+
if a[0] && a[1]
|
19
|
+
$Private_Token = a[0]
|
20
|
+
$GitHTTP_Address = a[1]
|
21
|
+
else
|
22
|
+
createUserInfo()
|
23
|
+
end
|
24
|
+
|
25
|
+
f.close
|
26
|
+
else
|
27
|
+
createUserInfo()
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def createUserInfo()
|
32
|
+
|
33
|
+
pt = ''
|
34
|
+
|
35
|
+
while pt.length == 0
|
36
|
+
print "Please enter a gitlab private token:"
|
37
|
+
pt = STDIN.gets.chomp
|
38
|
+
end
|
39
|
+
$Private_Token = pt
|
40
|
+
|
41
|
+
|
42
|
+
if $GitHTTP_Address.size < 1
|
43
|
+
ga = ''
|
44
|
+
while !(ga =~ /(^http|^https)[:][\/][\/][a-zA-Z0-9]/)
|
45
|
+
print "Please enter a gitlab url:"
|
46
|
+
ga = STDIN.gets.chomp
|
47
|
+
end
|
48
|
+
$GitHTTP_Address = ga
|
49
|
+
end
|
50
|
+
|
51
|
+
f=File.new(UserPathFile,"w+")
|
52
|
+
f.puts $Private_Token
|
53
|
+
f.puts $GitHTTP_Address
|
54
|
+
f.close
|
55
|
+
|
56
|
+
puts 'Successful operation!'
|
57
|
+
end
|
58
|
+
|
59
|
+
def resetInfo()
|
60
|
+
if File.exist?(UserPathFile)
|
61
|
+
File.delete(UserPathFile)
|
62
|
+
end
|
63
|
+
f=File.new(UserPathFile,"w+")
|
64
|
+
f.close
|
65
|
+
end
|
66
|
+
|
67
|
+
|
68
|
+
def getSourceCodeInfo(keyword)
|
69
|
+
|
70
|
+
checkUserInfo()
|
71
|
+
|
72
|
+
codeInfo = Array.new
|
73
|
+
|
74
|
+
uri = "#{$GitHTTP_Address}/api/v4/projects?private_token=#{$Private_Token}&search=#{keyword}&per_page=100"
|
75
|
+
|
76
|
+
html_response = nil
|
77
|
+
|
78
|
+
# open(uri) do |http|
|
79
|
+
# html_response = http.read
|
80
|
+
# end
|
81
|
+
|
82
|
+
t = Thread.new {
|
83
|
+
startLoading()
|
84
|
+
}
|
85
|
+
|
86
|
+
begin
|
87
|
+
req = open(uri).read
|
88
|
+
rescue StandardError,Timeout::Error, SystemCallError,SocketError, Errno::ECONNREFUSED
|
89
|
+
print "\r"
|
90
|
+
puts 'URL Access Error!'
|
91
|
+
puts uri
|
92
|
+
exit
|
93
|
+
else
|
94
|
+
print "\r"
|
95
|
+
html_response = req
|
96
|
+
end
|
97
|
+
|
98
|
+
Thread.kill(t)
|
99
|
+
|
100
|
+
data = JSON.parse(html_response)
|
101
|
+
|
102
|
+
info = Array.new
|
103
|
+
|
104
|
+
data.each do |d|
|
105
|
+
ssh = d["ssh_url_to_repo"]
|
106
|
+
forkfrom = d["forked_from_project"]
|
107
|
+
|
108
|
+
if !ssh.include?("Pods") && forkfrom.nil?
|
109
|
+
temp = Array.new
|
110
|
+
temp << d["name"]
|
111
|
+
temp << d["web_url"]
|
112
|
+
temp << ssh
|
113
|
+
temp << d["path"]
|
114
|
+
|
115
|
+
info << temp
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
if info.count > 0
|
120
|
+
print "Search results:\n"
|
121
|
+
i = 1
|
122
|
+
info.each do |temp|
|
123
|
+
puts " #{i}:#{temp[0]} #{temp[2]}\n"
|
124
|
+
i += 1
|
125
|
+
end
|
126
|
+
|
127
|
+
num = 0
|
128
|
+
|
129
|
+
while num >info.count || num == 0
|
130
|
+
print "Please enter the correct number:"
|
131
|
+
num = STDIN.gets.chomp.to_i
|
132
|
+
end
|
133
|
+
codeInfo = info[num-1];
|
134
|
+
end
|
135
|
+
|
136
|
+
return codeInfo
|
137
|
+
end
|
138
|
+
|
139
|
+
|
140
|
+
def getProjectInfo(keyword)
|
141
|
+
|
142
|
+
checkUserInfo()
|
143
|
+
|
144
|
+
uri = "#{$GitHTTP_Address}/api/v4/projects?private_token=#{$Private_Token}&search=#{keyword}&per_page=100"
|
145
|
+
|
146
|
+
html_response = nil
|
147
|
+
|
148
|
+
# open(uri) do |http|
|
149
|
+
# html_response = http.read
|
150
|
+
# end
|
151
|
+
|
152
|
+
t = Thread.new {
|
153
|
+
startLoading()
|
154
|
+
}
|
155
|
+
|
156
|
+
begin
|
157
|
+
req = open(uri).read
|
158
|
+
rescue StandardError,Timeout::Error, SystemCallError,SocketError, Errno::ECONNREFUSED
|
159
|
+
print "\r"
|
160
|
+
puts 'URL Access Error!'
|
161
|
+
puts uri
|
162
|
+
exit
|
163
|
+
else
|
164
|
+
print "\r"
|
165
|
+
html_response = req
|
166
|
+
end
|
167
|
+
|
168
|
+
Thread.kill(t)
|
169
|
+
|
170
|
+
data = JSON.parse(html_response)
|
171
|
+
|
172
|
+
info = Array.new
|
173
|
+
|
174
|
+
data.each do |d|
|
175
|
+
ssh = d["ssh_url_to_repo"]
|
176
|
+
forkfrom = d["forked_from_project"]
|
177
|
+
|
178
|
+
if !ssh.include?("Pods") && forkfrom.nil?
|
179
|
+
temp = Array.new
|
180
|
+
temp << d["name"]
|
181
|
+
temp << d["web_url"]
|
182
|
+
temp << ssh
|
183
|
+
temp << d["path"]
|
184
|
+
|
185
|
+
info << temp
|
186
|
+
|
187
|
+
end
|
188
|
+
end
|
189
|
+
return info
|
190
|
+
end
|
191
|
+
|
192
|
+
def startLoading
|
193
|
+
spin = ['. ','.. ','... ','....']
|
194
|
+
cunt = 0
|
195
|
+
while true
|
196
|
+
cunt +=1
|
197
|
+
str = spin[cunt%4]
|
198
|
+
print "Searching:#{str}"
|
199
|
+
sleep 0.15
|
200
|
+
print "\r"
|
201
|
+
|
202
|
+
end
|
203
|
+
end
|
204
|
+
|
205
|
+
end
|
@@ -0,0 +1,326 @@
|
|
1
|
+
require 'pathname'
|
2
|
+
require 'find'
|
3
|
+
require "#{File.dirname(Pathname.new(__FILE__).realpath)}/gitlab"
|
4
|
+
|
5
|
+
InstallCodePathFile = File.expand_path('~')+'/.lzsource_path'
|
6
|
+
|
7
|
+
SplitWords = 'module_files'
|
8
|
+
|
9
|
+
module Pod
|
10
|
+
class Command
|
11
|
+
|
12
|
+
class Lzsource < Command
|
13
|
+
|
14
|
+
$ProjectDir = 'unknow'
|
15
|
+
$CodeAddr = 'unknow'
|
16
|
+
$LibPath = 'unknow'
|
17
|
+
$CodePath = 'unknow'
|
18
|
+
$CloneFlag = false
|
19
|
+
|
20
|
+
self.summary = 'Debug Source Code.'
|
21
|
+
|
22
|
+
self.arguments = [
|
23
|
+
CLAide::Argument.new('NAME', :optional)
|
24
|
+
]
|
25
|
+
|
26
|
+
# self.arguments = [CLAide::Argument.new(%w(NAME), true)]
|
27
|
+
|
28
|
+
def self.options
|
29
|
+
[
|
30
|
+
['--list', 'Show all items list.'],
|
31
|
+
['--clean', 'Clear all items.'],
|
32
|
+
['--reset', 'Reset token and gitlab url.'],
|
33
|
+
['--info', 'Query a item information.'],
|
34
|
+
]
|
35
|
+
# .concat(super)
|
36
|
+
end
|
37
|
+
|
38
|
+
def initialize(argv)
|
39
|
+
@list = argv.flag?('list')
|
40
|
+
@info = argv.flag?('info')
|
41
|
+
@clean = argv.flag?('clean')
|
42
|
+
@reset = argv.flag?('reset')
|
43
|
+
@name = argv.shift_argument
|
44
|
+
super
|
45
|
+
end
|
46
|
+
|
47
|
+
def validate!
|
48
|
+
super
|
49
|
+
|
50
|
+
# help!
|
51
|
+
end
|
52
|
+
|
53
|
+
def run
|
54
|
+
if @clean != true && @list != true && @reset != true && @info != true && @name.nil?
|
55
|
+
help!
|
56
|
+
log()
|
57
|
+
end
|
58
|
+
if @clean == true
|
59
|
+
checkPod()
|
60
|
+
clean()
|
61
|
+
elsif @list == true
|
62
|
+
checkPod()
|
63
|
+
list()
|
64
|
+
elsif @reset == true
|
65
|
+
checkPod()
|
66
|
+
reset()
|
67
|
+
elsif @info == true
|
68
|
+
if @name.nil?
|
69
|
+
help!
|
70
|
+
log()
|
71
|
+
else
|
72
|
+
checkPod()
|
73
|
+
info(@name)
|
74
|
+
end
|
75
|
+
else
|
76
|
+
|
77
|
+
checkPod()
|
78
|
+
|
79
|
+
getSourceCodeInfo(@name) # CodeAddr ProjectDir
|
80
|
+
|
81
|
+
getLibPath() # LibPath
|
82
|
+
|
83
|
+
getDebugPath() # $CodePath
|
84
|
+
|
85
|
+
createDownloadDir()
|
86
|
+
|
87
|
+
download()
|
88
|
+
|
89
|
+
saveCodePath()
|
90
|
+
|
91
|
+
cleanCache()
|
92
|
+
|
93
|
+
list()
|
94
|
+
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
|
99
|
+
# 下载源代码流程 lzsource
|
100
|
+
def getSourceCodeInfo(keyword)
|
101
|
+
|
102
|
+
gitlabHttp= GitLabHttp.new
|
103
|
+
info = gitlabHttp.getSourceCodeInfo(keyword)
|
104
|
+
if info.count > 0
|
105
|
+
$CodeAddr = info[2]
|
106
|
+
$ProjectDir = info[3]
|
107
|
+
else
|
108
|
+
UI.puts "No search result by the keyword.Please check the parameter."
|
109
|
+
log()
|
110
|
+
end
|
111
|
+
|
112
|
+
if $ProjectDir == 'unknow'
|
113
|
+
UI.puts 'Failed to get lib dir.'
|
114
|
+
log()
|
115
|
+
end
|
116
|
+
if $CodeAddr == 'unknow'
|
117
|
+
UI.puts 'Failed to get git address.'
|
118
|
+
log()
|
119
|
+
end
|
120
|
+
|
121
|
+
end
|
122
|
+
|
123
|
+
def getLibPath
|
124
|
+
podPath = Dir.pwd+'/Pods/'
|
125
|
+
path = Dir.pwd+'/Pods/'+$ProjectDir
|
126
|
+
|
127
|
+
if File.directory?(podPath)
|
128
|
+
if File.directory?(path)
|
129
|
+
traverse_dir(path)
|
130
|
+
if $LibPath == 'unknow'
|
131
|
+
UI.puts 'Failed to get lib path.'
|
132
|
+
log()
|
133
|
+
end
|
134
|
+
else
|
135
|
+
UI.puts "Failed to get pod path.Please check the parameter."
|
136
|
+
log()
|
137
|
+
end
|
138
|
+
else
|
139
|
+
UI.puts "Failed to get pod path.This project directory may be not a cocoapods project."
|
140
|
+
log()
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
def traverse_dir(file_path)
|
145
|
+
Find.find(file_path) do |filename|
|
146
|
+
extn = File.extname filename
|
147
|
+
if extn == '.a'
|
148
|
+
$LibPath = filename
|
149
|
+
break
|
150
|
+
end
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
154
|
+
def getDebugPath
|
155
|
+
|
156
|
+
temp_dir = 'unknow'
|
157
|
+
|
158
|
+
at_name = `dwarfdump -debug-str -arch=arm64 --lookup 0x0000002f #{$LibPath} | grep 'DW_AT_name' | head -1`
|
159
|
+
arr = at_name.split('"')
|
160
|
+
if arr.size > 1
|
161
|
+
if arr[1].include?(SplitWords)
|
162
|
+
temp = arr[1].split(SplitWords)
|
163
|
+
if temp.size > 0
|
164
|
+
temp_dir = temp[0]+SplitWords
|
165
|
+
end
|
166
|
+
end
|
167
|
+
end
|
168
|
+
|
169
|
+
temp_path = 'unknow'
|
170
|
+
|
171
|
+
at_comp_dir = `dwarfdump -debug-str -arch=arm64 --lookup 0x0000002f #{$LibPath} | grep 'DW_AT_comp_dir' | head -1`
|
172
|
+
arr = at_comp_dir.split('"')
|
173
|
+
if arr.size > 1
|
174
|
+
if arr[1].include?(SplitWords)
|
175
|
+
temp = arr[1].split(SplitWords)
|
176
|
+
if temp.size > 1
|
177
|
+
temp_path = temp[1]
|
178
|
+
end
|
179
|
+
end
|
180
|
+
end
|
181
|
+
|
182
|
+
if temp_dir != 'unknow' && temp_path != 'unknow'
|
183
|
+
$CodePath = temp_dir+temp_path
|
184
|
+
else
|
185
|
+
UI.puts 'Failed to get install path.'
|
186
|
+
log()
|
187
|
+
end
|
188
|
+
end
|
189
|
+
|
190
|
+
def createDownloadDir
|
191
|
+
|
192
|
+
if File.directory?($CodePath)
|
193
|
+
`sudo rm -rf #{$CodePath}`
|
194
|
+
end
|
195
|
+
|
196
|
+
`sudo mkdir -p -m 777 #{$CodePath};sudo chown -R $(whoami) #{$CodePath}`
|
197
|
+
|
198
|
+
if !File.directory?($CodePath)
|
199
|
+
UI.puts 'Failed to create install path.'
|
200
|
+
log()
|
201
|
+
end
|
202
|
+
end
|
203
|
+
|
204
|
+
def download
|
205
|
+
t = Thread.new {
|
206
|
+
startLoading()
|
207
|
+
}
|
208
|
+
cloneFlag = system("sudo git clone #{$CodeAddr} #{$CodePath} >/dev/null 2>&1")
|
209
|
+
Thread.kill(t)
|
210
|
+
if cloneFlag == false
|
211
|
+
UI.puts 'Failed to download source code.'
|
212
|
+
log()
|
213
|
+
end
|
214
|
+
print "\rSuccessful download!\n"
|
215
|
+
end
|
216
|
+
|
217
|
+
def checkPod
|
218
|
+
podPath = Dir.pwd+'/Pods/'
|
219
|
+
if File.directory?(podPath)
|
220
|
+
|
221
|
+
else
|
222
|
+
UI.puts "Please check the current directory.This project directory may be not a cocoapods project."
|
223
|
+
log()
|
224
|
+
end
|
225
|
+
end
|
226
|
+
|
227
|
+
def saveCodePath
|
228
|
+
f=File.open(InstallCodePathFile,"a+")
|
229
|
+
f.puts $ProjectDir+"***"+$CodePath
|
230
|
+
f.close
|
231
|
+
|
232
|
+
end
|
233
|
+
|
234
|
+
def cleanCache
|
235
|
+
cachePath = File.expand_path('~')+"/Library/Developer/Xcode/DerivedData/"
|
236
|
+
if File.directory?(cachePath)
|
237
|
+
`rm -r #{cachePath}`
|
238
|
+
end
|
239
|
+
end
|
240
|
+
|
241
|
+
#lzsource --list
|
242
|
+
def list
|
243
|
+
if File.exist?(InstallCodePathFile)
|
244
|
+
UI.puts "Currently installed:"
|
245
|
+
tempNames = Array.new
|
246
|
+
names = Array.new
|
247
|
+
count = 0
|
248
|
+
File.open(InstallCodePathFile,"r").each_line do |line|
|
249
|
+
temp = line.gsub("\n", '')
|
250
|
+
arr = temp.split("***")
|
251
|
+
if !tempNames.include?(arr[0])
|
252
|
+
names << " "+"#{count+1}:"+ arr[0]
|
253
|
+
tempNames << arr[0]
|
254
|
+
count = count +1
|
255
|
+
end
|
256
|
+
end
|
257
|
+
puts names
|
258
|
+
end
|
259
|
+
end
|
260
|
+
|
261
|
+
#lzsource --info
|
262
|
+
def info(keyword)
|
263
|
+
gitlabHttp= GitLabHttp.new
|
264
|
+
info = gitlabHttp.getProjectInfo(keyword)
|
265
|
+
if info.count > 0
|
266
|
+
puts '----------------'
|
267
|
+
end
|
268
|
+
info.each do |d|
|
269
|
+
puts 'Repository name:'+d[0]
|
270
|
+
puts 'Repository web:'+d[1]
|
271
|
+
puts 'Repository ssh:'+d[2]
|
272
|
+
# puts 'Repository path:'+d[3]
|
273
|
+
puts '----------------'
|
274
|
+
end
|
275
|
+
end
|
276
|
+
|
277
|
+
|
278
|
+
#lzsource --clean
|
279
|
+
def clean
|
280
|
+
if File.exist?(InstallCodePathFile)
|
281
|
+
File.open(InstallCodePathFile,"r").each_line do |line|
|
282
|
+
addr = line.gsub("\n", '')
|
283
|
+
arr = addr.split("***")
|
284
|
+
if File.directory?(arr[1])
|
285
|
+
`sudo rm -rf #{arr[1]}`
|
286
|
+
end
|
287
|
+
end
|
288
|
+
end
|
289
|
+
File.delete(InstallCodePathFile)
|
290
|
+
UI.puts 'Successful Clean!'
|
291
|
+
end
|
292
|
+
|
293
|
+
|
294
|
+
#lzsource --reset
|
295
|
+
def reset
|
296
|
+
gitlabHttp= GitLabHttp.new
|
297
|
+
gitlabHttp.resetInfo()
|
298
|
+
end
|
299
|
+
|
300
|
+
|
301
|
+
#tools
|
302
|
+
|
303
|
+
def log
|
304
|
+
# UI.puts ''
|
305
|
+
# UI.puts 'Dir Name:'+$ProjectDir
|
306
|
+
# UI.puts 'Lib Path:'+$LibPath
|
307
|
+
# UI.puts 'Code Path:'+$CodePath
|
308
|
+
# UI.puts 'Code Addr:'+$CodeAddr
|
309
|
+
exit
|
310
|
+
end
|
311
|
+
|
312
|
+
def startLoading
|
313
|
+
spin = ["\\",'|','/','-']
|
314
|
+
cunt = 0
|
315
|
+
while true
|
316
|
+
cunt +=1
|
317
|
+
str = spin[cunt%4]
|
318
|
+
print "downloading:#{str}"
|
319
|
+
sleep 0.12
|
320
|
+
print "\r"
|
321
|
+
end
|
322
|
+
end
|
323
|
+
|
324
|
+
end
|
325
|
+
end
|
326
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'cocoapods-lzsource/command'
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
require 'pathname'
|
2
|
+
ROOT = Pathname.new(File.expand_path('../../', __FILE__))
|
3
|
+
$:.unshift((ROOT + 'lib').to_s)
|
4
|
+
$:.unshift((ROOT + 'spec').to_s)
|
5
|
+
|
6
|
+
require 'bundler/setup'
|
7
|
+
require 'bacon'
|
8
|
+
require 'mocha-on-bacon'
|
9
|
+
require 'pretty_bacon'
|
10
|
+
require 'pathname'
|
11
|
+
require 'cocoapods'
|
12
|
+
|
13
|
+
Mocha::Configuration.prevent(:stubbing_non_existent_method)
|
14
|
+
|
15
|
+
require 'cocoapods_plugin'
|
16
|
+
|
17
|
+
#-----------------------------------------------------------------------------#
|
18
|
+
|
19
|
+
module Pod
|
20
|
+
|
21
|
+
# Disable the wrapping so the output is deterministic in the tests.
|
22
|
+
#
|
23
|
+
UI.disable_wrap = true
|
24
|
+
|
25
|
+
# Redirects the messages to an internal store.
|
26
|
+
#
|
27
|
+
module UI
|
28
|
+
@output = ''
|
29
|
+
@warnings = ''
|
30
|
+
|
31
|
+
class << self
|
32
|
+
attr_accessor :output
|
33
|
+
attr_accessor :warnings
|
34
|
+
|
35
|
+
def puts(message = '')
|
36
|
+
@output << "#{message}\n"
|
37
|
+
end
|
38
|
+
|
39
|
+
def warn(message = '', actions = [])
|
40
|
+
@warnings << "#{message}\n"
|
41
|
+
end
|
42
|
+
|
43
|
+
def print(message)
|
44
|
+
@output << message
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
#-----------------------------------------------------------------------------#
|
metadata
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: cocoapods-lzsource
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- ningyuan
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-11-28 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.3'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description: cocoapods-lzsource.
|
42
|
+
email:
|
43
|
+
- m13811217138@gmail.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- ".gitignore"
|
49
|
+
- Gemfile
|
50
|
+
- LICENSE.txt
|
51
|
+
- README.md
|
52
|
+
- Rakefile
|
53
|
+
- cocoapods-lzsource.gemspec
|
54
|
+
- lib/cocoapods-lzsource.rb
|
55
|
+
- lib/cocoapods-lzsource/command.rb
|
56
|
+
- lib/cocoapods-lzsource/command/gitlab.rb
|
57
|
+
- lib/cocoapods-lzsource/command/lzsource.rb
|
58
|
+
- lib/cocoapods-lzsource/gem_version.rb
|
59
|
+
- lib/cocoapods_plugin.rb
|
60
|
+
- spec/command/lzsource_spec.rb
|
61
|
+
- spec/spec_helper.rb
|
62
|
+
homepage: https://github.com/Jeremi-LZ
|
63
|
+
licenses:
|
64
|
+
- MIT
|
65
|
+
metadata: {}
|
66
|
+
post_install_message:
|
67
|
+
rdoc_options: []
|
68
|
+
require_paths:
|
69
|
+
- lib
|
70
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
75
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
76
|
+
requirements:
|
77
|
+
- - ">="
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: '0'
|
80
|
+
requirements: []
|
81
|
+
rubyforge_project:
|
82
|
+
rubygems_version: 2.5.2.3
|
83
|
+
signing_key:
|
84
|
+
specification_version: 4
|
85
|
+
summary: cocoapods-lzsource.
|
86
|
+
test_files:
|
87
|
+
- spec/command/lzsource_spec.rb
|
88
|
+
- spec/spec_helper.rb
|