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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7a3f0ef41b7151fa3df116d2e8921c8de937128d
4
- data.tar.gz: 67af8d3a196a6631f99e6b5aeac0a0e777667807
3
+ metadata.gz: 5fcec84f74a1419df18ec1f93c5420b3df4032b9
4
+ data.tar.gz: 6d7b8f2b01774eaf47c19c2f4a3bf66080ac21f6
5
5
  SHA512:
6
- metadata.gz: 33fd6fbe3886168383562a211ffa7f6ea8f46a8f82f017b28f444a1eb504d38415c88349bd3e8122d47bd7f7fe57ab3797acc0cea66993ec922e0b4f2a94bd5e
7
- data.tar.gz: b5986d5e8cb87676f7b53f8339594084639cdc469f8abfa7ec3cb90421a1b4bd0b7c716feb39dc0693595911317ceeb0de3cc03545b299a7ba2f18b152b73aa2
6
+ metadata.gz: a56ab38eec565cd7dede52b3e389fb049707984fa457221b1efc402c676cb04c42446a63b47be088dcf5dbe350245895e92f0e21f4f9305dc4920d64d0e738d9
7
+ data.tar.gz: 63d7595209260736809f1d6e48defc153215c1bdf06f4a87cbdc31cb8b390faef5de01254a2dc75d13c5139015c2206293e0f82ff5eb4f540c85cc1421b20c44
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pod_updater (0.4.0)
4
+ pod_updater (0.4.1)
5
5
  colorize
6
6
 
7
7
  GEM
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('-cp', '--cp_path [cp_path]', String, 'the path where the podspec file need to copy') do |cp_path|
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
+
@@ -19,18 +19,21 @@ module PodUpdater
19
19
 
20
20
  modifyPodspec(path:podFilePath,version:version) #将podspec文件的版本号进行修改
21
21
 
22
- copy_podspec(podFilePath,cp_path,version)
23
-
24
- git_tag_flow(path,msg,version)
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
- IO.popen(cmd.join('')) do |io|
30
- io.each do |line|
31
- UI.msg(line)
32
- end
33
- end
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
 
@@ -1,3 +1,3 @@
1
1
  module PodUpdater
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.2"
3
3
  end
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.1
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: 2017-12-31 00:00:00.000000000 Z
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