podfileDep 2.3.3 → 2.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: 491f4a383b768a448297d15aa5fc6d1a20579e45ddf1deba7c1f692c72f6505a
4
- data.tar.gz: a5c91fe5e5e5453905ea83ca0a8c51a510c81478f3386c93ee32c79c7a74a6f7
3
+ metadata.gz: 3f39bc168ff13749da842aee74a8cf17c9629466a6d9b20a61ea47020977398b
4
+ data.tar.gz: 80cb1d3a0d4af1bcc285c1720b63c4f8749c027c5909dbd0f2f9a768f4333130
5
5
  SHA512:
6
- metadata.gz: bb54718fa3fd8b876793a5e9c2d0b8638aaf8c7a7b4481357f9bd9d030732da9cb52947ac6a1128f8f4ad41d2d7c73efffe94553f53dcdf896379941eaf32a2c
7
- data.tar.gz: 864acce6a07eda525076f9397d6ad815b337b435a91681e7efcee9c206379b85dcf8cf85b6b419c31cf27c8c759f1881f971963d0c0b20181d951331c8f538d8
6
+ metadata.gz: e1466d1c0e209a0ff7796401b915729ba370fd5b9bf1f0f320a0e895ff98531904c13b8c41be4a42cdc45f997c98361e2bc981d2dd8f25d7c348cf7903cec0a3
7
+ data.tar.gz: 72e2e307e376fab8e9f99d6f7ebac1287820b4764310981637fafddcbc5052e5ff7e660c902171095eebc28e422a353f89e0093b2c9da0f01b38e3494a89307c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  ## [Released]
2
2
 
3
+ ### [2.3.5] - 2023-7-24
4
+ - pod依赖打印仓库是否被修改
5
+
6
+ ### [2.3.4] - 2023-7-24
7
+ - pod依赖打印排序
8
+ - pod依赖打印路径依赖时增加打印分支名
9
+
3
10
  ### [2.3.3] - 2023-7-24
4
11
  - import规范检查逻辑优化
5
12
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PodfileDep
4
- VERSION = "2.3.3"
4
+ VERSION = "2.3.5"
5
5
  end
@@ -333,12 +333,28 @@ module Pod
333
333
  end
334
334
  puts "➡️ 解析后依赖总数共计:#{all_deps.size}个\n"
335
335
 
336
+ sort_deps = all_deps.sort do |arr1, arr2|
337
+ dep1 = arr1[1]
338
+ dep2 = arr2[1]
339
+ if dep1.path and not dep2.path
340
+ 1
341
+ elsif not dep1.path and dep2.path
342
+ -1
343
+ else
344
+ dep1.pod.downcase <=> dep2.pod.downcase
345
+ end
346
+ end
347
+
336
348
  puts '⬇️ 打印依赖'
337
- all_deps.each_value { |dependency|
349
+ current_dir = Dir.pwd
350
+ sort_deps.each { |sort_dep|
351
+ dependency = sort_dep[1]
338
352
  puts_result = "pod '#{dependency.pod}'"
339
353
 
340
354
  if dependency.path #路径引用
341
- puts_result += ", :path => '#{dependency.path}'"
355
+ branch = repo_branch(dependency.path)
356
+ modify = repo_modify(dependency.path)
357
+ puts_result += ", :path => '#{dependency.path}'#{branch} #{modify}"
342
358
  elsif dependency.podspec #podspec引用
343
359
  puts_result += ", :podspec => '#{dependency.podspec}'"
344
360
  elsif dependency.version #版本号引用
@@ -372,6 +388,7 @@ module Pod
372
388
  end
373
389
 
374
390
  }
391
+ Dir.chdir(current_dir)
375
392
  puts "⬆️ 打印完毕"
376
393
  end
377
394
 
@@ -457,6 +474,48 @@ module Pod
457
474
  }
458
475
  end
459
476
 
477
+ # 获取某个目录下的当前分支
478
+ def repo_branch(path)
479
+ full_path = File.expand_path(path)
480
+ git_path = "#{full_path}/.git"
481
+ unless Dir.exist?(git_path)
482
+ return ""
483
+ end
484
+ head_path = "#{git_path}/HEAD"
485
+ unless File.exist?(head_path)
486
+ return ""
487
+ end
488
+
489
+ content = File.read(head_path)
490
+ content = content.gsub("\n", "")
491
+
492
+ branch_key_word = "ref: refs/heads/"
493
+ if content.include?(branch_key_word)
494
+ branch = content.gsub(branch_key_word, "")
495
+ return "(#{branch})"
496
+ end
497
+
498
+ if content.size >= 8
499
+ short_sha = content.slice(0, 7)
500
+ return "(#{short_sha})"
501
+ end
502
+
503
+ "(#{content})"
504
+ end
505
+
506
+ # 获取仓库状态是否有修改
507
+ def repo_modify(path)
508
+ full_path = File.expand_path(path)
509
+ git_path = "#{full_path}/.git"
510
+ unless Dir.exist?(git_path)
511
+ return ""
512
+ end
513
+
514
+ Dir.chdir(full_path)
515
+ status = %x(git status -suno)
516
+ status.size > 0 ? "[modified]" : ""
517
+ end
518
+
460
519
  # 读取主工程target列表
461
520
  def init_main_targets
462
521
  project_manager = XCProject::XcodeprojManager.share_manager
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: podfileDep
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.3
4
+ version: 2.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - 王帅朋