cocoapods-linkline 0.3.3 → 0.3.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d117490d018435edb6595c5154d1a7b04c3f279c86c12f66b1b5b54c311271bb
4
- data.tar.gz: 503ffc8974e2ba3890a86fb90d8d20a0d87e0c52a2574f09ea422666d1164faa
3
+ metadata.gz: 44ce7d66915ab09fb0578104356b94e292f6838a273be57d81f9398ee0fa69c4
4
+ data.tar.gz: 90b2cc8a039a8ef0d14ebe095879ff8d1e198da9c3e2357b1e7631852083af5d
5
5
  SHA512:
6
- metadata.gz: e5011720de5a848307a2003e4352c0931493959024557b057beb8a9bd698f2086da3e00f9bbd64729e8ace7ea1ae9ed63542f5b268d54bbc69ad4b34d2989993
7
- data.tar.gz: f631de91deebfd4dbb71f632bc10429c49d73b9f44c0cd51441b3135f3dc30810be584ebecc9126c780296d6127400dee19b1f86ed3f3d1e4c29e83f6cdcedb3
6
+ metadata.gz: 37d0810df7d0ed87b2d59ede1c28da87c1c7398b4880e6121a0765f0ae69485b79f8d72d7c7c4f9cc511467136efefc0cfd3f46aa82de5748a9231920793f1f8
7
+ data.tar.gz: 0c38e25f326762c8c45e115049a2ffe161e7e2636e0a124397b11dd19e77c824e000e4841176aa907e04e32d01d2c8dff4cadb6b5e41e0e7a240cb21ce1568fd
@@ -48,7 +48,8 @@ module Pod
48
48
 
49
49
  #3、fetch newest code
50
50
  git_reset
51
- git_pull
51
+ git_fetch
52
+ git_checkout_and_pull
52
53
 
53
54
  local = ll_fetch_local_stable_datas
54
55
  origin = ll_fetch_origin_stable_datas
@@ -68,15 +69,21 @@ module Pod
68
69
  Pod::UI.puts "#{err_msg}".send(:red)
69
70
  exit -9001
70
71
  end
71
-
72
- matches = File.read(File.join(Pathname.pwd, "Podfile")).match(/^\s*stable!\s*'([^']+)'(?:,\s*(\w+):\s*'([^']+)')*/m)
73
- unless matches
74
- err_msg = "- Error: not stable define in the podfile! you can define like【stable 'https://git.babybus.co/babybus/ios/Specs/stable-specs.git', specs:'global_stable_specs'】in podfile"
72
+
73
+ #获取podfile 内容
74
+ #1、删除所有注释行,避免干扰
75
+ #2、正则匹配,筛选出stable 方法
76
+ #3、执行stable 方法,获取配置
77
+ podfileContent = File.read(File.join(Pathname.pwd, "Podfile"))
78
+ podfileContent_vaild = podfileContent.lines.reject { |line| line.strip.start_with?("#") }.join
79
+ stableCommand = podfileContent_vaild.match(/^\s*stable!\s*'([^']+)'(?:,\s*(\w+):\s*'([^']+)')*/m)
80
+ unless stableCommand
81
+ err_msg = "- Error: not stable define in the podfile! you can define like【stable! 'https://git.babybus.co/babybus/ios/Specs/stable-specs.git', specs:'global_stable_specs'】in podfile"
75
82
  Pod::UI.puts "#{err_msg}".send(:red)
76
83
  exit -9002
77
84
  end
78
85
 
79
- eval(matches.to_s)
86
+ eval(stableCommand.to_s)
80
87
  end
81
88
 
82
89
  def ll_cloneStable
@@ -268,8 +275,42 @@ module Pod
268
275
  git('reset','--hard') #fommate git command
269
276
  end
270
277
 
271
- def git_pull
272
- git('pull','origin','main','-f') #fommate git command
278
+ def git_fetch
279
+ git('fetch') #fommate git command
280
+ end
281
+
282
+ def git_checkout_and_pull
283
+ if defined? @ll_stable_branch
284
+ unless git_branch_exists?(@ll_stable_branch)
285
+ err_msg = "- Error: #{@ll_stable_source} did not exit branch #{@ll_stable_branch}"
286
+ Pod::UI.puts "#{err_msg}".send(:red)
287
+ exit -9006
288
+ end
289
+
290
+ git('checkout',@ll_stable_branch) #fommate git command
291
+ git('pull','origin',@ll_stable_branch,'-f') #fommate git command
292
+ elsif defined? @ll_stable_tag
293
+ unless git_tag_exists?(@ll_stable_tag)
294
+ err_msg = "- Error: #{@ll_stable_source} did not exit tag #{@ll_stable_tag}"
295
+ Pod::UI.puts "#{err_msg}".send(:red)
296
+ exit -9007
297
+ end
298
+
299
+ git('checkout',@ll_stable_tag) #fommate git command
300
+ else
301
+ protechBranch = git('symbolic-ref','refs/remotes/origin/HEAD').split("/").last.strip || "main"
302
+ git('checkout',protechBranch)
303
+ git('pull','origin',protechBranch,'-f')
304
+ end
305
+ end
306
+
307
+ def git_tag_exists?(tag)
308
+ git('tag').split("\n").include?(tag)
309
+ end
310
+
311
+ def git_branch_exists?(branch)
312
+ branchs = git('branch','-a').split("\n")
313
+ branchs.include?(branch) || branchs.include?(' remotes/origin/' + branch) || branchs.include?('remotes/origin/' + branch)
273
314
  end
274
315
 
275
316
  def git_clone(source, path)
@@ -1,3 +1,3 @@
1
1
  module CocoapodsLinkline
2
- VERSION = "0.3.3"
2
+ VERSION = "0.3.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-linkline
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - youhui