cocoapods-sync-podspecs 0.1.6 → 0.2.1
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 +4 -4
- data/lib/pod/command/bump-version.rb +5 -10
- data/lib/pod/command/push-tag.rb +14 -6
- data/lib/pod/command/sync-podspec.rb +0 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f0de672055103fbe0dcfbf3403e20ffa9fd813bc1f38dd5b2b23a6e8dfecb682
|
4
|
+
data.tar.gz: 635efb0ad6c7ffca1acc1ae81e4cbec295e11378266eda1c24bf4ca399d2a529
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b1faf7947b048860d32af8aff454bbcaa3bcae643220e7a29044dd7204a801438d123bf88aad75998a1a9d6b16f09b18c5f11956102efbe590c1bbda5d0e862
|
7
|
+
data.tar.gz: ae17ba30a36e14d6ba36fde922748f2aa59c3ab034a6b55475a4929fd8585af39c6328cf622b928f8425ed12def267262056832233eb827a4d5f8ff90e3ba6c8
|
@@ -48,10 +48,11 @@ module Pod
|
|
48
48
|
end
|
49
49
|
|
50
50
|
def modify_podspec(path, version)
|
51
|
-
unless version =~
|
52
|
-
UI.puts "
|
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
|
64
|
-
line = line.sub(
|
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.
|
data/lib/pod/command/push-tag.rb
CHANGED
@@ -15,14 +15,16 @@ module Pod
|
|
15
15
|
|
16
16
|
def self.options
|
17
17
|
[
|
18
|
-
['--
|
19
|
-
['--
|
18
|
+
['--push-remote', 'Perform the step of pushing REPO to its remote'],
|
19
|
+
['--stop-on-exists', 'Stop running when tag is existed'],
|
20
|
+
['--tag-on-change', 'Just push tag when podspec is changed'],
|
20
21
|
].concat(super)
|
21
22
|
end
|
22
23
|
|
23
24
|
def initialize(argv)
|
24
|
-
@
|
25
|
-
@
|
25
|
+
@tag_on_change = argv.flag?('tag-on-change', false)
|
26
|
+
@stop_on_exists = argv.flag?('stop-on-exists', false)
|
27
|
+
@push_remote = argv.flag?('push-remote', false)
|
26
28
|
@tag_version = argv.shift_argument
|
27
29
|
@current_repo_dir = ''
|
28
30
|
super
|
@@ -49,7 +51,7 @@ module Pod
|
|
49
51
|
# update_repo(spec.name, Pathname(spec_file).dirname)
|
50
52
|
|
51
53
|
exists_tag = pod_repo_git('tag').include?(@tag_version)
|
52
|
-
if exists_tag &&
|
54
|
+
if exists_tag && @stop_on_exists
|
53
55
|
raise Informative, "#{spec.name}: tag #{@tag_version} already exists"
|
54
56
|
end
|
55
57
|
|
@@ -67,7 +69,13 @@ module Pod
|
|
67
69
|
if pod_repo_git('status', '--porcelain').include?(podspec_name)
|
68
70
|
pod_repo_git('add', '*.podspec')
|
69
71
|
pod_repo_git('commit', '--no-verify', '-m', message)
|
70
|
-
push_pod_repo(name) unless
|
72
|
+
push_pod_repo(name) unless !@push_remote
|
73
|
+
|
74
|
+
pod_repo_git('tag', '-a', @tag_version, '-m', message)
|
75
|
+
push_tag_repo
|
76
|
+
elsif !@tag_on_change
|
77
|
+
check_repo_status(name, @current_repo_dir)
|
78
|
+
update_repo(name, @current_repo_dir)
|
71
79
|
|
72
80
|
pod_repo_git('tag', '-a', @tag_version, '-m', message)
|
73
81
|
push_tag_repo
|
@@ -28,7 +28,6 @@ module Pod
|
|
28
28
|
['--commit-message="Fix bug in pod"', 'Add custom commit message. Opens default editor if no commit ' \
|
29
29
|
'message is specified'],
|
30
30
|
['--use-json', 'Convert the podspec to JSON before pushing it to the repo'],
|
31
|
-
'This takes precedence over the Swift versions specified by the spec or a `.swift-version` file'],
|
32
31
|
['--no-overwrite', 'Disallow pushing that would overwrite an existing spec'],
|
33
32
|
].concat(super)
|
34
33
|
end
|
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
|
4
|
+
version: 0.2.1
|
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-
|
11
|
+
date: 2021-01-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cocoapods
|