cocoapods-dongjia 1.0.3 → 1.0.4

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
  SHA256:
3
- metadata.gz: 20e84142456adb1a7aafa2395706f044bb374b6afd2c2a9e0cc3543a202f3c7e
4
- data.tar.gz: 64d4f993f3637cff64296e9e4616f889543a985c531e6a1ad39c589d540a4560
3
+ metadata.gz: f18bc9b7c748f76da031b3c7399e77fa0cc7d0de5f9ce4ee35081e82cdf4fa0a
4
+ data.tar.gz: 0535a37844a08856aa30e77820d5ab8ee15364997521aee38b6d71ec1ef86052
5
5
  SHA512:
6
- metadata.gz: ab2c71217234370fc4648d13711d1e88a3a1be68310e9084ff27b90b8cf207b6e533f97f41c62e4abe3a4a8397e8f6c24c6363eb47d93d13bb46bfcea2724854
7
- data.tar.gz: 90acc42e03382bcf0f8f47da18a51630c9bd09bfbd6e6a622f0af8017ecff2116c17e865890947284ed4bd3b129b752090fdad49b47ceae4ba9c8892ca4152a1
6
+ metadata.gz: f4ad0844ad88e3c0f1e911c54f924e4f0117d63ada80009a769ed77688ec14435932b5653f05157274a826d14c6c3866fd3ead7e493b825e4f3cd186727c4d54
7
+ data.tar.gz: a89af33980896a67d37f4517a9f12e3d6d93386e11cb25b4ad1f0d081e6f8eee428285eefe92d5dcb6ee627cad68f584ae9bcc0b50f3905ffdd5fa18b0d182e0
@@ -1,3 +1,4 @@
1
1
  module CocoapodsDongjia
2
- VERSION = "1.0.3"
2
+ VERSION = "1.0.4"
3
+ UPDATE_DESC = " - 远程仓库支持 :branch / :tag / :commit 直接指定"
3
4
  end
@@ -9,12 +9,18 @@ module Dongjia
9
9
 
10
10
  Pod::UI.puts 'Done.'
11
11
 
12
- info = Gems.info 'cocoapods-dongjia'
13
- latest_version = info['version']
14
- v = CocoapodsDongjia::VERSION
15
-
16
- if v < latest_version
17
- Pod::UI.warn "发现新版本插件(#{latest_version}),更新:[sudo] gem install cocoapods-dongjia"
12
+ begin
13
+ info = Gems.info 'cocoapods-dongjia'
14
+ latest_version = info['version']
15
+ v = CocoapodsDongjia::VERSION
16
+
17
+ if v < latest_version
18
+ update_desc = info['metadata']['update_desc']
19
+ Pod::UI.warn "cocoapods-dongjia #{latest_version} is available."
20
+ Pod::UI.warn "#{update_desc}"
21
+ Pod::UI.warn "to upgrade: [sudo] gem install cocoapods-dongjia"
22
+ end
23
+ rescue
18
24
  end
19
25
  end
20
26
 
data/lib/helper/pod.rb CHANGED
@@ -9,4 +9,26 @@ module Pod
9
9
  ret
10
10
  end
11
11
 
12
- end
12
+ # 注入本地路径
13
+ def self.inject_local_path(name, requirements)
14
+ local_path = nil
15
+ local_root = ENV['POD_LOCAL_ROOT']
16
+ if !local_root
17
+ UI.warn '环境变量中未发现 POD_LOCAL_ROOT 定义'
18
+ elsif local_root.length
19
+ local_path = File.join(local_root, repo_name(name))
20
+ end
21
+ if local_path
22
+ requirements.pop
23
+ requirements.push({:path => local_path})
24
+ end
25
+ end
26
+
27
+ # 注入远程仓库地址
28
+ def self.inject_remote_git(name, requirements)
29
+ options = requirements.pop
30
+ options[:git] = "git@code.kaipao.cc:ios-team/components/#{name}.git"
31
+ requirements.push(options)
32
+ end
33
+
34
+ end
@@ -1,4 +1,5 @@
1
1
  require_relative 'pod'
2
+ require 'pry'
2
3
 
3
4
  module Pod
4
5
 
@@ -6,17 +7,7 @@ module Pod
6
7
 
7
8
  module DSL
8
9
  def localpod(name = nil, *requirements)
9
- local_path = nil
10
- local_root = ENV['POD_LOCAL_ROOT']
11
- if !local_root
12
- UI.warn '环境变量中未发现 POD_LOCAL_ROOT 定义'
13
- elsif local_root.length
14
- local_path = File.join(local_root, Pod::repo_name(name))
15
- end
16
- if local_path
17
- requirements.pop
18
- requirements.push({:path => local_path})
19
- end
10
+ Pod::inject_local_path(name, requirements)
20
11
  pod(name, *requirements)
21
12
  end
22
13
 
@@ -27,22 +18,14 @@ module Pod
27
18
 
28
19
  def parse_requirements(name, requirements)
29
20
 
30
- local_path = nil
31
-
32
21
  options = requirements.last
33
- if options.is_a?(Hash) && options[:local] == true
34
- local_root = ENV['POD_LOCAL_ROOT']
35
- if !local_root
36
- UI.warn '环境变量中未发现 POD_LOCAL_ROOT 定义'
37
- elsif local_root.length
38
- local_path = File.join(local_root, Pod::repo_name(name))
22
+ if options.is_a?(Hash)
23
+ if options[:local] == true
24
+ Pod::inject_local_path(name, requirements)
25
+ elsif not ([:branch, :commit, :tag] & options.keys).empty? and options[:git] == nil
26
+ Pod::inject_remote_git(name, requirements)
39
27
  end
40
28
  end
41
-
42
- if local_path
43
- requirements.pop
44
- requirements.push({:path => local_path})
45
- end
46
29
  end
47
30
 
48
31
  old_method = instance_method(:parse_inhibit_warnings)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-dongjia
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - jiangzhuoyi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-21 00:00:00.000000000 Z
11
+ date: 2019-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -75,7 +75,8 @@ files:
75
75
  homepage: https://github.com/EXAMPLE/cocoapods-dongjia
76
76
  licenses:
77
77
  - MIT
78
- metadata: {}
78
+ metadata:
79
+ update_desc: " - 远程仓库支持 :branch / :tag / :commit 直接指定"
79
80
  post_install_message:
80
81
  rdoc_options: []
81
82
  require_paths: