cocoapods-sync-podspecs 0.1.9 → 0.2.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: 1b1b2b81372c2ca12b4259f1a260873f3de93e8649945c39ae3cb891787d65ea
4
- data.tar.gz: 6b1372504d4f1e31b1f124da1a32a4c7fa117b53b89cfffc707c4f1c00bfeab8
3
+ metadata.gz: 9de345a627797c763a42d8b00ae11c8ed0ac6d790d929396542e476ec0050839
4
+ data.tar.gz: e326567beb4b6c3beee0afe8848cef3cda75656b2837258e50d710d5b4792423
5
5
  SHA512:
6
- metadata.gz: '0413886e0cccff9a7bb3d669a90df6c1f34e28d432b19c117f8b4cd1c9fd5d2089468bfd908538271c37089f1f504c39afaf1002e372b5d1cd4531bf24c131c9'
7
- data.tar.gz: d5b2d4d06718c4f40614b87932270f3ee7b9cc2b48f9c596b37c5a53e1994cad8b8b85ee607e21749defcb9c14b42a13fba96ce17f5755d6c6abcf6ff566bb08
6
+ metadata.gz: 5982e216e64e04ac6531519eeb63f46425d0118312d34a5f98e6206c374ca06d58f29413c0427640df74506f00d147899b7225cb4140503b163acdaf1969627b
7
+ data.tar.gz: 1412ef4aca07b10262b9a859bc4fd0934a3e7c7429f0e5d41382bb991997a2f0b1f269041c4ac64528951875a705150990b6745f32c445354f8c2a0d54a6a32a
@@ -48,10 +48,11 @@ module Pod
48
48
  end
49
49
 
50
50
  def modify_podspec(path, version)
51
- unless version =~ /^\d{1,}.\d.\d$|^\d{1,}.\d$|^\d{1,}$/
52
- UI.puts "s.version: not found"
51
+ unless version =~ /^(\d+\.)?(\d+\.)?(\*|\d+)$/
52
+ UI.puts "Invalid version #{version}"
53
53
  return
54
54
  end
55
+
55
56
  unless File.exist?path
56
57
  UI.puts "Podspec file not found"
57
58
  return
@@ -60,13 +61,13 @@ module Pod
60
61
  File.open(path, "r+") do |f|
61
62
  s = ""
62
63
  f.each_line do |line|
63
- if line.to_s =~ /s\.version\s*=\s*"(\d{1,}.\d.\d|\d{1,}.\d|\d{1,})"/
64
- line = line.sub(/\d{1,}.\d.\d|\d{1,}.\d|\d{1,}/) do |match|
64
+ if line.to_s =~ /s\.version\s*=\s*'(\d+\.)?(\d+\.)?(\*|\d+)'/
65
+ line = line.sub(/(\d+\.)?(\d+\.)?(\*|\d+)/) do |match|
65
66
  version.to_s
66
67
  end
67
68
  end
68
- if line.to_s =~ /s\.version\s*=\s*'(\d{1,}.\d.\d|\d{1,}.\d|\d{1,})'/
69
- line = line.sub(/\d{1,}.\d.\d|\d{1,}.\d|\d{1,}/) do |match|
69
+ if line.to_s =~ /s\.version\s*=\s*"(\d+\.)?(\d+\.)?(\*|\d+)"/
70
+ line = line.sub(/(\d+\.)?(\d+\.)?(\*|\d+)/) do |match|
70
71
  version.to_s
71
72
  end
72
73
  end
@@ -74,7 +75,6 @@ module Pod
74
75
  end
75
76
  File.open(path, "w+") do |f| f.write(s) end
76
77
  end
77
-
78
78
  end
79
79
 
80
80
  # @return [Array<Pathname>] The path of the specifications to push.
@@ -15,16 +15,18 @@ module Pod
15
15
 
16
16
  def self.options
17
17
  [
18
- ['--local-only', 'Does not perform the step of pushing REPO to its remote'],
19
- ['--ignore-exists', 'Ignore exists tag'],
20
- ['--force', 'Force create new tag'],
18
+ ['--commit-local', 'Make commit for bump version'],
19
+ ['--push-remote', 'Perform the step of pushing REPO to its remote'],
20
+ ['--continue-if-exists', 'Continues running when tag is existed'],
21
+ ['--tag-on-change', 'Just push tag when podspec is changed'],
21
22
  ].concat(super)
22
23
  end
23
24
 
24
25
  def initialize(argv)
25
- @force_create_tag = argv.flag?('force')
26
- @ignore_exists = argv.flag?('ignore-exists')
27
- @local_only = argv.flag?('local-only')
26
+ @commit_local = argv.flag?('commit-local', false)
27
+ @tag_on_change = argv.flag?('tag-on-change', false)
28
+ @continue_if_exists = argv.flag?('continue-if-exists', false)
29
+ @push_remote = argv.flag?('push-remote', false)
28
30
  @tag_version = argv.shift_argument
29
31
  @current_repo_dir = ''
30
32
  super
@@ -41,17 +43,23 @@ module Pod
41
43
  end
42
44
 
43
45
  def run
46
+ processedPaths = Array.new
47
+
44
48
  podspec_files.each do |spec_file|
45
49
  spec = Pod::Specification.from_file(spec_file)
46
50
 
47
51
  @tag_version = spec.version.to_s unless !@tag_version.nil?
48
52
  @current_repo_dir = Pathname(spec_file).dirname
49
53
 
54
+ next if processedPaths.include?(@current_repo_dir)
55
+
56
+ processedPaths.push(@current_repo_dir)
57
+
50
58
  # check_repo_status(spec.name, Pathname(spec_file).dirname)
51
59
  # update_repo(spec.name, Pathname(spec_file).dirname)
52
60
 
53
61
  exists_tag = pod_repo_git('tag').include?(@tag_version)
54
- if exists_tag && !@ignore_exists
62
+ if exists_tag && !@continue_if_exists
55
63
  raise Informative, "#{spec.name}: tag #{@tag_version} already exists"
56
64
  end
57
65
 
@@ -67,13 +75,13 @@ module Pod
67
75
 
68
76
  # only commit if modified
69
77
  if pod_repo_git('status', '--porcelain').include?(podspec_name)
70
- pod_repo_git('add', '*.podspec')
71
- pod_repo_git('commit', '--no-verify', '-m', message)
72
- push_pod_repo(name) unless @local_only
78
+ pod_repo_git('add', '*.podspec') unless !@commit_local
79
+ pod_repo_git('commit', '--no-verify', '-m', message) unless !@commit_local
80
+ push_pod_repo(name) unless !@push_remote
73
81
 
74
82
  pod_repo_git('tag', '-a', @tag_version, '-m', message)
75
83
  push_tag_repo
76
- elsif @force_create_tag
84
+ elsif !@tag_on_change
77
85
  check_repo_status(name, @current_repo_dir)
78
86
  update_repo(name, @current_repo_dir)
79
87
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-sync-podspecs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - quangmv
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-05 00:00:00.000000000 Z
11
+ date: 2021-01-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cocoapods