cocoapods-sync-podspecs 0.1.7 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dfc8e42e680dd38829c65f59424181ca505c9fc3e7f052c8bc93a84dee0b4609
4
- data.tar.gz: c3296f5cb47eda5c14f5107413b0d6b1edd79ad58c938875d63eb332769c16df
3
+ metadata.gz: f26259b60b12d37487fb3f5eed55e8425cb0536a12be09978700511be0899300
4
+ data.tar.gz: 3392666245c85972d731603e9e74c2acc3695d20c2df8943dbed280da65826ad
5
5
  SHA512:
6
- metadata.gz: db993638153b0c4215666eacaae095784462dcf7b79d521e4e312ba4fb4d20c07ecfcd9b9944b1a55320b9fea8c55d5f4ee355b1584c30996a579bbadd7087bc
7
- data.tar.gz: f733256a0f7d53759555df4ffc1b64818572a6208c572f71dba84691f983ff481486875c939c3326cdcf72d6b0cc382d7837b2bd73dffccec1672328dd35dffc
6
+ metadata.gz: 94c3e91eda44a7ec63a422b9c3b57965e80f8b512038b07a9bcef23050f8d8d67c72023c8709cb1d97576b8b170f1b5977eb1a4108a668da75a05b8acba97b06
7
+ data.tar.gz: 93da4d5eb7bd46239183212cf86ecc75e065286642ca09200d5eefae7cca54c4d7ae8d416a95e8256c997a3c6eda9236f4faac2cd3cec14f1285e9921b29b8b5
@@ -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,8 @@ 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|
65
- version.to_s
66
- end
67
- 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|
64
+ if line.to_s =~ /s\.version\s*=\s*'|"(\d+\.)?(\d+\.)?(\*|\d+)'|"/
65
+ line = line.sub(/(\d+\.)?(\d+\.)?(\*|\d+)/) do |match|
70
66
  version.to_s
71
67
  end
72
68
  end
@@ -74,7 +70,6 @@ module Pod
74
70
  end
75
71
  File.open(path, "w+") do |f| f.write(s) end
76
72
  end
77
-
78
73
  end
79
74
 
80
75
  # @return [Array<Pathname>] The path of the specifications to push.
@@ -15,14 +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'],
18
+ ['--commit-local', 'Make commit for bump version'],
19
+ ['--push-remote', 'Perform the step of pushing REPO to its remote'],
20
+ ['--stop-on-exists', 'Stop running when tag is existed'],
21
+ ['--tag-on-change', 'Just push tag when podspec is changed'],
20
22
  ].concat(super)
21
23
  end
22
24
 
23
25
  def initialize(argv)
24
- @ignore_exists = argv.flag?('ignore-exists')
25
- @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
+ @stop_on_exists = argv.flag?('stop-on-exists', false)
29
+ @push_remote = argv.flag?('push-remote', false)
26
30
  @tag_version = argv.shift_argument
27
31
  @current_repo_dir = ''
28
32
  super
@@ -49,7 +53,7 @@ module Pod
49
53
  # update_repo(spec.name, Pathname(spec_file).dirname)
50
54
 
51
55
  exists_tag = pod_repo_git('tag').include?(@tag_version)
52
- if exists_tag && !@ignore_exists
56
+ if exists_tag && @stop_on_exists
53
57
  raise Informative, "#{spec.name}: tag #{@tag_version} already exists"
54
58
  end
55
59
 
@@ -65,9 +69,15 @@ module Pod
65
69
 
66
70
  # only commit if modified
67
71
  if pod_repo_git('status', '--porcelain').include?(podspec_name)
68
- pod_repo_git('add', '*.podspec')
69
- pod_repo_git('commit', '--no-verify', '-m', message)
70
- push_pod_repo(name) unless @local_only
72
+ pod_repo_git('add', '*.podspec') unless !@commit_local
73
+ pod_repo_git('commit', '--no-verify', '-m', message) unless !@commit_local
74
+ push_pod_repo(name) unless !@push_remote
75
+
76
+ pod_repo_git('tag', '-a', @tag_version, '-m', message)
77
+ push_tag_repo
78
+ elsif !@tag_on_change
79
+ check_repo_status(name, @current_repo_dir)
80
+ update_repo(name, @current_repo_dir)
71
81
 
72
82
  pod_repo_git('tag', '-a', @tag_version, '-m', message)
73
83
  push_tag_repo
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.7
4
+ version: 0.2.2
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