pod_updater 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/bin/pod_updater +4 -1
- data/lib/.DS_Store +0 -0
- data/lib/pod_updater/cp_podspec.rb +54 -0
- data/lib/pod_updater/pod_push.rb +13 -10
- data/lib/pod_updater/version.rb +1 -1
- data/lib/pod_updater.rb +2 -5
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5fcec84f74a1419df18ec1f93c5420b3df4032b9
|
4
|
+
data.tar.gz: 6d7b8f2b01774eaf47c19c2f4a3bf66080ac21f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a56ab38eec565cd7dede52b3e389fb049707984fa457221b1efc402c676cb04c42446a63b47be088dcf5dbe350245895e92f0e21f4f9305dc4920d64d0e738d9
|
7
|
+
data.tar.gz: 63d7595209260736809f1d6e48defc153215c1bdf06f4a87cbdc31cb8b390faef5de01254a2dc75d13c5139015c2206293e0f82ff5eb4f540c85cc1421b20c44
|
data/Gemfile.lock
CHANGED
data/bin/pod_updater
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
+
# lib = File.expand_path("../../lib", __FILE__)
|
4
|
+
# $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
|
3
6
|
require 'pod_updater'
|
4
7
|
require 'optparse'
|
5
8
|
|
@@ -13,7 +16,7 @@ option_parser = OptionParser.new do |opts|
|
|
13
16
|
end
|
14
17
|
|
15
18
|
options[:cp_path] = nil
|
16
|
-
opts.on('-
|
19
|
+
opts.on('-c', '--cp_path [cp_path]', String, 'the path where the podspec file need to copy') do |cp_path|
|
17
20
|
options[:cp_path] = cp_path
|
18
21
|
end
|
19
22
|
|
data/lib/.DS_Store
CHANGED
Binary file
|
@@ -0,0 +1,54 @@
|
|
1
|
+
require "fileutils"
|
2
|
+
require 'pod_updater/ui'
|
3
|
+
|
4
|
+
module PodUpdater
|
5
|
+
|
6
|
+
module_function
|
7
|
+
# 将podspec文件拷贝到备份的文件目录
|
8
|
+
def copy_podspec(from_path, distination, pod_version)
|
9
|
+
|
10
|
+
return unless distination
|
11
|
+
|
12
|
+
unless File.exist?(distination)
|
13
|
+
UI.msg("cp_path:#{distination}不存在,请提供正确的路径:")
|
14
|
+
distination = gets.to_s.chomp
|
15
|
+
copy_podspec(from_path, distination, pod_version)
|
16
|
+
return
|
17
|
+
end
|
18
|
+
unless File.directory?(distination)
|
19
|
+
UI.msg("cp_path:#{distination}不是目录,请提供正确的路径")
|
20
|
+
distination = gets.to_s.chomp
|
21
|
+
copy_podspec(from_path, distination, pod_version)
|
22
|
+
return
|
23
|
+
end
|
24
|
+
|
25
|
+
pod_name = File.basename(from_path, '.podspec')
|
26
|
+
destination_path = destination_path_from(distination, pod_name, pod_version)
|
27
|
+
|
28
|
+
unless destination_path
|
29
|
+
UI.err('无法计算出正确的copy路径,podspec文件复制失败')
|
30
|
+
else
|
31
|
+
FileUtils.cp(from_path, destination_path)
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
# desc:负责对cp路径进行检查修正,保证目的路径是包含了以库名为名称的目录,并且在下面新建一个对应版本的文件夹
|
37
|
+
def destination_path_from(to_path, pod_name, pod_version)
|
38
|
+
destination_path = ''
|
39
|
+
#检查给定的path是否存在pod_name的路径
|
40
|
+
if to_path =~ %r(#{pod_name})
|
41
|
+
destination_path = File.join(to_path,pod_version)
|
42
|
+
else
|
43
|
+
destination_path = File.join(to_path, pod_name, pod_version)
|
44
|
+
end
|
45
|
+
|
46
|
+
FileUtils.mkdir_p(destination_path) unless File.exist?(destination_path)
|
47
|
+
|
48
|
+
destination_path = nil unless File.exist?(destination_path)
|
49
|
+
|
50
|
+
destination_path
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
54
|
+
|
data/lib/pod_updater/pod_push.rb
CHANGED
@@ -19,18 +19,21 @@ module PodUpdater
|
|
19
19
|
|
20
20
|
modifyPodspec(path:podFilePath,version:version) #将podspec文件的版本号进行修改
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
|
22
|
+
if cp_path
|
23
|
+
copy_podspec(podFilePath, cp_path,version)
|
24
|
+
end
|
25
25
|
|
26
|
-
cmd = []
|
27
|
-
cmd << %(pod trunk push #{podFilePath} --allow-warnings)
|
28
26
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
27
|
+
# git_tag_flow(path,msg,version)
|
28
|
+
#
|
29
|
+
# cmd = []
|
30
|
+
# cmd << %(pod trunk push #{podFilePath} --allow-warnings)
|
31
|
+
#
|
32
|
+
# IO.popen(cmd.join('')) do |io|
|
33
|
+
# io.each do |line|
|
34
|
+
# UI.msg(line)
|
35
|
+
# end
|
36
|
+
# end
|
34
37
|
|
35
38
|
end
|
36
39
|
|
data/lib/pod_updater/version.rb
CHANGED
data/lib/pod_updater.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
|
2
|
-
# lib = File.expand_path("../lib", __FILE__)
|
1
|
+
# lib = File.expand_path("../../lib", __FILE__)
|
3
2
|
# $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
3
|
|
5
4
|
require "pod_updater/version"
|
@@ -8,11 +7,9 @@ require "pod_updater/pod_push"
|
|
8
7
|
module PodUpdater
|
9
8
|
|
10
9
|
def self.run(version, cp_path)
|
11
|
-
path = File.expand_path(Dir.pwd)
|
10
|
+
path = File.expand_path(Dir.pwd)
|
12
11
|
pushPodToSevice(path, version, cp_path)
|
13
12
|
end
|
14
13
|
|
15
14
|
end
|
16
15
|
|
17
|
-
# PodUpdater.run('3.0.2', 'Users/qwkj/Desktop/IOS_Pod_Spec_Repo/千网PodRepo/')
|
18
|
-
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pod_updater
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- hwzss
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|
@@ -82,6 +82,7 @@ files:
|
|
82
82
|
- bin/setup
|
83
83
|
- lib/.DS_Store
|
84
84
|
- lib/pod_updater.rb
|
85
|
+
- lib/pod_updater/cp_podspec.rb
|
85
86
|
- lib/pod_updater/git_tag_flow.rb
|
86
87
|
- lib/pod_updater/modify_podspec.rb
|
87
88
|
- lib/pod_updater/pod_push.rb
|