cocoapods-linkline 0.3.3 → 0.3.5

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: 7e92eda2eed04391c77d81c0a28f2e11834062f694573f0eeaf08348bb6da429
4
+ data.tar.gz: 5f414a5290b461c7b3e7fbc4aa0d46fdc0586597c7b49f42c446a3c6d4a5f74c
5
5
  SHA512:
6
- metadata.gz: e5011720de5a848307a2003e4352c0931493959024557b057beb8a9bd698f2086da3e00f9bbd64729e8ace7ea1ae9ed63542f5b268d54bbc69ad4b34d2989993
7
- data.tar.gz: f631de91deebfd4dbb71f632bc10429c49d73b9f44c0cd51441b3135f3dc30810be584ebecc9126c780296d6127400dee19b1f86ed3f3d1e4c29e83f6cdcedb3
6
+ metadata.gz: 4c381263f174fb1a62283609b7c670a6ecc6cf7bbf7afb453ea5fc540891ea3cc15b9e38c5fc66ef889c7390cc0547d48b172eb3ffe7f216bd9f0b42955c06b3
7
+ data.tar.gz: 006a25718432c5c14deaae64cf31bc6430530b8a88fa5878ab0c4c21d5d3f5ec5bc698d9aa0841ff5a01f95257450c2a5f771a4474a08a8c3b51cd280fbcb682
@@ -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,41 @@ 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
+ git('checkout',@ll_stable_branch) #fommate git command
290
+ git('reset','--hard',"origin/#{@ll_stable_branch}") #fommate git command
291
+ elsif defined? @ll_stable_tag
292
+ unless git_tag_exists?(@ll_stable_tag)
293
+ err_msg = "- Error: #{@ll_stable_source} did not exit tag #{@ll_stable_tag}"
294
+ Pod::UI.puts "#{err_msg}".send(:red)
295
+ exit -9007
296
+ end
297
+
298
+ git('checkout',@ll_stable_tag) #fommate git command
299
+ else
300
+ protechBranch = git('symbolic-ref','refs/remotes/origin/HEAD').split("/").last.strip || "main"
301
+ git('checkout',protechBranch)
302
+ git('reset','--hard',"origin/#{protechBranch}") #fommate git command
303
+ end
304
+ end
305
+
306
+ def git_tag_exists?(tag)
307
+ git('tag').split("\n").include?(tag)
308
+ end
309
+
310
+ def git_branch_exists?(branch)
311
+ branchs = git('branch','-a').split("\n")
312
+ branchs.include?(branch) || branchs.include?(' remotes/origin/' + branch) || branchs.include?('remotes/origin/' + branch)
273
313
  end
274
314
 
275
315
  def git_clone(source, path)
@@ -1,3 +1,3 @@
1
1
  module CocoapodsLinkline
2
- VERSION = "0.3.3"
2
+ VERSION = "0.3.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
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.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - youhui
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-21 00:00:00.000000000 Z
11
+ date: 2023-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler