podUpdater 0.1.2 → 0.1.3

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
  SHA1:
3
- metadata.gz: f1ae9a6247a61473fc232a15f42335c348568ac8
4
- data.tar.gz: f291dda0ab86836624279170080e5bfc44718f93
3
+ metadata.gz: 1eb4772a75c771e6ebcf319491798af263370cac
4
+ data.tar.gz: e6dbe00058d79d65290f11b03d19fb55db58b2bd
5
5
  SHA512:
6
- metadata.gz: 7f412d07353d56bdcf3a5de55cf24ff09e2ef5d82d391b08d61f87dfce7e4ee59457e2419d6ad68c7f7eb47767962e98ba6ee80f9531b66d2b610c96587df940
7
- data.tar.gz: c7741ce4cd19d2377e08cf47a1c7e8a5b4bdf4c639328d66c9e0bc0e4dce6684debed203a7e356c366ff14d01a63331228b445f389ff915f97efcfc1857f3c6c
6
+ metadata.gz: 7839977e99bf6cd4e7b9647b3f0847a28ba762c3acd1dd6c861fe035bcf25779ea61e3fc3de6b6e35d7cc26defe5fd7bcf3a7749af9364e88bcd289b20e3c3c0
7
+ data.tar.gz: dd85f341c223886e18be014f6622f1ae64611a25acc00fe8708df26813df325ba07de8b708d755bfdbc71790b747a40c2b6d2340bd2a7c57bff08023ebfbf131
data/.DS_Store ADDED
Binary file
data/bin/.DS_Store ADDED
Binary file
data/lib/.DS_Store ADDED
Binary file
Binary file
@@ -0,0 +1,25 @@
1
+
2
+ module PodUpdater
3
+
4
+ # 提供路径,然后将项目打包上git,标记tag
5
+ def git_tag_flow(path,msg,tag_version)
6
+
7
+ cmd = []
8
+
9
+ cmd << %(cd #{path})
10
+ cmd << 'git add .'
11
+ cmd << %(git commit -m "#{msg}")
12
+ cmd << 'git push'
13
+ cmd << %(git tag -a #{tag_version} -m "#{msg}")
14
+ cmd << 'git push --tags'
15
+
16
+ # TODO: 尝试在每次即将执行该命令时,打印出这次的命令
17
+ IO.popen(cmd.join(" && ")) do |io|
18
+ io.each do |line|
19
+ puts line
20
+ end
21
+ io.close
22
+ end
23
+
24
+ end
25
+ end
@@ -0,0 +1,44 @@
1
+
2
+ module PodUpdater
3
+
4
+ # 修改podspec的s.verison的值
5
+ def modifyPodspec(path:"",version:"0.0.0")
6
+
7
+ if version == "0.0.0"
8
+ puts "请指定版本好的值,如 modifyPodspec version:#{version}"
9
+ return
10
+ end
11
+ unless version =~ /^\d{1,}.\d.\d$|^\d{1,}.\d$|^\d{1,}$/
12
+ puts "version:#{version}的格式不对"
13
+ return 
14
+ end
15
+
16
+ # DEBUG:这里写死了路径是为了方便调试,正式用的话需去掉
17
+ # path = "/Users/qwkj/Documents/WZ_GitHub/Ruby_Learning/day_7/QW_Http.podspec"
18
+ # END
19
+
20
+ unless File.exist?path
21
+ puts "路径不存在"
22
+ return
23
+ end
24
+
25
+ puts "***修改podspec文件***"
26
+ File.open(path, "r+") do |f|
27
+ s = ""
28
+ f.each_line do |line|
29
+ # puts "#{line}"
30
+ if line.to_s =~ /s\.version\s*=\s*"(\d{1,}.\d.\d|\d{1,}.\d|\d{1,})"/
31
+ # puts "匹配到了"
32
+ temp = $1.to_s
33
+ line = line.sub(/\d{1,}.\d.\d|\d{1,}.\d|\d{1,}/) do |match|
34
+ version.to_s
35
+ end
36
+ end
37
+ s += line
38
+ end
39
+ puts "#{s}"
40
+ File.open(path, "w+") do |f| f.write(s) end
41
+ end
42
+
43
+ end
44
+ end
@@ -0,0 +1,36 @@
1
+
2
+ require "git_tag_flow"
3
+ require "modifyPodspec"
4
+
5
+ module PodUpdater
6
+
7
+ # 给定pod库项目的路径,以及新版pod库的版本,将自己的pod提交到git,然后打上tag,再push trunk到pod服务器去
8
+ def pushPodToSevice(path,version)
9
+ # FOR_DEBUG:
10
+ # path = "/Users/qwkj/Documents/WZ_GitHub/WZ_Framework"
11
+ # END
12
+
13
+ podFilePath = pathWithPodspecSuffix(path)
14
+
15
+ unless podFilePath
16
+ puts "未找到相应的podspec文件"
17
+ return
18
+ end
19
+
20
+ msg = "for pod version:#{version}"
21
+
22
+ modifyPodspec(path:podFilePath,version:version)
23
+
24
+ git_tag_flow(path,msg,version)
25
+
26
+ cmd = []
27
+ cmd << %(pod trunk push #{podFilePath} --allow-warnings)
28
+
29
+ IO.popen(cmd.join('')) do |io|
30
+ io.each do |line|
31
+ puts line
32
+ end
33
+ end
34
+
35
+ end
36
+ end
@@ -1,3 +1,3 @@
1
1
  module PodUpdater
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
Binary file
Binary file
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: podUpdater
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - hwzss
@@ -46,18 +46,28 @@ executables:
46
46
  extensions: []
47
47
  extra_rdoc_files: []
48
48
  files:
49
+ - .DS_Store
49
50
  - .gitignore
50
51
  - CODE_OF_CONDUCT.md
51
52
  - Gemfile
52
53
  - LICENSE.txt
53
54
  - README.md
54
55
  - Rakefile
56
+ - bin/.DS_Store
55
57
  - bin/console
58
+ - bin/podUpdater
56
59
  - bin/setup
60
+ - lib/.DS_Store
57
61
  - lib/podUpdater.rb
62
+ - lib/podUpdater/.DS_Store
63
+ - lib/podUpdater/git_tag_flow.rb
64
+ - lib/podUpdater/modify_podspec.rb
65
+ - lib/podUpdater/pod_push.rb
58
66
  - lib/podUpdater/version.rb
67
+ - podUpdater-0.1.0.gem
68
+ - podUpdater-0.1.1.gem
69
+ - podUpdater-0.1.2.gem
59
70
  - podUpdater.gemspec
60
- - bin/podUpdater
61
71
  homepage: https://github.com/hwzss/podUpdater
62
72
  licenses:
63
73
  - MIT