ppdbiu 0.1.2 → 0.2.0

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: 25992d065d762ca9728ff31ec8d493a08603629e
4
- data.tar.gz: 7d4ca8cc6357e93d18461e53e341d98310807e76
3
+ metadata.gz: 64dfe154c4eaa4cd871bfbcceb8a520769a9103e
4
+ data.tar.gz: a2387144051d8dc4c8a140126d4b9d9fe84b79d4
5
5
  SHA512:
6
- metadata.gz: 3b440a2a4f0b5282bb7fa1102e4cbac1e3225162c6836983fd9e08681e79a05fe5ff133ab4372ecd9d49c9e629fd8e61d0bfca8f84d94c8f17ef68f0550e455f
7
- data.tar.gz: 804505ab33834420cad4561559dc2b90b53acc0b94348381e595002692961132d74d21b3f6831661f3180a9f53e0fd5f45535cab5eca0aad05ebe8799a2d5a54
6
+ metadata.gz: 4014410edf7febdc59928e4925e78bf052a085972114b4c5df77f883b5a72a9f4a87ddd7a770f64cbab846fdbc8a70b2328aa6f03ac75b5625eff605a6e72af2
7
+ data.tar.gz: d4722f1353858c79f7cb213df2247467a0fde71f795ecec011aff874902a09c5db6134e2f885015c4416c9f5509322f1ee6f059f5e308ad70eb89480d49a8698
data/.gitignore CHANGED
@@ -9,6 +9,9 @@
9
9
  /test/tmp/
10
10
  /test/version_tmp/
11
11
  /tmp/
12
+ /test/Pods
13
+ /test/*.xcworkspace
14
+ /test/*.xcodeproj
12
15
 
13
16
  # Used by dotenv library to load environment variables.
14
17
  # .env
data/Gemfile.lock CHANGED
@@ -1,8 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ppdbiu (0.1.0)
5
- cocoapods (>= 1.1.1, < 2.0)
4
+ ppdbiu (0.2.0)
6
5
 
7
6
  GEM
8
7
  remote: https://rubygems.org/
@@ -13,31 +12,35 @@ GEM
13
12
  minitest (~> 5.1)
14
13
  thread_safe (~> 0.3, >= 0.3.4)
15
14
  tzinfo (~> 1.1)
15
+ addressable (2.5.2)
16
+ public_suffix (>= 2.0.2, < 4.0)
17
+ atomos (0.1.2)
18
+ babosa (1.0.2)
16
19
  claide (1.0.2)
17
- cocoapods (1.3.1)
20
+ cocoapods (1.4.0)
18
21
  activesupport (>= 4.0.2, < 5)
19
22
  claide (>= 1.0.2, < 2.0)
20
- cocoapods-core (= 1.3.1)
21
- cocoapods-deintegrate (>= 1.0.1, < 2.0)
23
+ cocoapods-core (= 1.4.0)
24
+ cocoapods-deintegrate (>= 1.0.2, < 2.0)
22
25
  cocoapods-downloader (>= 1.1.3, < 2.0)
23
26
  cocoapods-plugins (>= 1.0.0, < 2.0)
24
27
  cocoapods-search (>= 1.0.0, < 2.0)
25
28
  cocoapods-stats (>= 1.0.0, < 2.0)
26
- cocoapods-trunk (>= 1.2.0, < 2.0)
29
+ cocoapods-trunk (>= 1.3.0, < 2.0)
27
30
  cocoapods-try (>= 1.1.0, < 2.0)
28
31
  colored2 (~> 3.1)
29
32
  escape (~> 0.0.4)
30
33
  fourflusher (~> 2.0.1)
31
34
  gh_inspector (~> 1.0)
32
- molinillo (~> 0.5.7)
35
+ molinillo (~> 0.6.4)
33
36
  nap (~> 1.0)
34
37
  ruby-macho (~> 1.1)
35
- xcodeproj (>= 1.5.1, < 2.0)
36
- cocoapods-core (1.3.1)
38
+ xcodeproj (>= 1.5.4, < 2.0)
39
+ cocoapods-core (1.4.0)
37
40
  activesupport (>= 4.0.2, < 6)
38
41
  fuzzy_match (~> 2.0.4)
39
42
  nap (~> 1.0)
40
- cocoapods-deintegrate (1.0.1)
43
+ cocoapods-deintegrate (1.0.2)
41
44
  cocoapods-downloader (1.1.3)
42
45
  cocoapods-plugins (1.0.0)
43
46
  nap
@@ -47,37 +50,159 @@ GEM
47
50
  nap (>= 0.8, < 2.0)
48
51
  netrc (~> 0.11)
49
52
  cocoapods-try (1.1.0)
53
+ colored (1.2)
50
54
  colored2 (3.1.2)
55
+ commander-fastlane (4.4.6)
56
+ highline (~> 1.7.2)
51
57
  concurrent-ruby (1.0.5)
58
+ declarative (0.0.10)
59
+ declarative-option (0.1.0)
60
+ domain_name (0.5.20170404)
61
+ unf (>= 0.0.5, < 1.0.0)
62
+ dotenv (2.2.1)
52
63
  escape (0.0.4)
64
+ excon (0.60.0)
65
+ faraday (0.14.0)
66
+ multipart-post (>= 1.2, < 3)
67
+ faraday-cookie_jar (0.0.6)
68
+ faraday (>= 0.7.4)
69
+ http-cookie (~> 1.0.0)
70
+ faraday_middleware (0.12.2)
71
+ faraday (>= 0.7.4, < 1.0)
72
+ fastimage (2.1.1)
73
+ fastlane (2.84.0)
74
+ CFPropertyList (>= 2.3, < 4.0.0)
75
+ addressable (>= 2.3, < 3.0.0)
76
+ babosa (>= 1.0.2, < 2.0.0)
77
+ bundler (>= 1.12.0, < 2.0.0)
78
+ colored
79
+ commander-fastlane (>= 4.4.6, < 5.0.0)
80
+ dotenv (>= 2.1.1, < 3.0.0)
81
+ excon (>= 0.45.0, < 1.0.0)
82
+ faraday (~> 0.9)
83
+ faraday-cookie_jar (~> 0.0.6)
84
+ faraday_middleware (~> 0.9)
85
+ fastimage (>= 2.1.0, < 3.0.0)
86
+ gh_inspector (>= 1.1.2, < 2.0.0)
87
+ google-api-client (>= 0.13.1, < 0.14.0)
88
+ highline (>= 1.7.2, < 2.0.0)
89
+ json (< 3.0.0)
90
+ mini_magick (~> 4.5.1)
91
+ multi_json
92
+ multi_xml (~> 0.5)
93
+ multipart-post (~> 2.0.0)
94
+ plist (>= 3.1.0, < 4.0.0)
95
+ public_suffix (~> 2.0.0)
96
+ rubyzip (>= 1.1.0, < 2.0.0)
97
+ security (= 0.1.3)
98
+ slack-notifier (>= 2.0.0, < 3.0.0)
99
+ terminal-notifier (>= 1.6.2, < 2.0.0)
100
+ terminal-table (>= 1.4.5, < 2.0.0)
101
+ tty-screen (>= 0.6.3, < 1.0.0)
102
+ tty-spinner (>= 0.8.0, < 1.0.0)
103
+ word_wrap (~> 1.0.0)
104
+ xcodeproj (>= 1.5.2, < 2.0.0)
105
+ xcpretty (>= 0.2.4, < 1.0.0)
106
+ xcpretty-travis-formatter (>= 0.0.3)
53
107
  fourflusher (2.0.1)
54
108
  fuzzy_match (2.0.4)
55
- gh_inspector (1.0.3)
56
- i18n (0.9.1)
109
+ gh_inspector (1.1.3)
110
+ google-api-client (0.13.6)
111
+ addressable (~> 2.5, >= 2.5.1)
112
+ googleauth (~> 0.5)
113
+ httpclient (>= 2.8.1, < 3.0)
114
+ mime-types (~> 3.0)
115
+ representable (~> 3.0)
116
+ retriable (>= 2.0, < 4.0)
117
+ googleauth (0.6.2)
118
+ faraday (~> 0.12)
119
+ jwt (>= 1.4, < 3.0)
120
+ logging (~> 2.0)
121
+ memoist (~> 0.12)
122
+ multi_json (~> 1.11)
123
+ os (~> 0.9)
124
+ signet (~> 0.7)
125
+ highline (1.7.10)
126
+ http-cookie (1.0.3)
127
+ domain_name (~> 0.5)
128
+ httpclient (2.8.3)
129
+ i18n (0.9.5)
57
130
  concurrent-ruby (~> 1.0)
58
- minitest (5.10.3)
59
- molinillo (0.5.7)
131
+ json (2.1.0)
132
+ jwt (2.1.0)
133
+ little-plugger (1.1.4)
134
+ logging (2.2.2)
135
+ little-plugger (~> 1.1)
136
+ multi_json (~> 1.10)
137
+ memoist (0.16.0)
138
+ mime-types (3.1)
139
+ mime-types-data (~> 3.2015)
140
+ mime-types-data (3.2016.0521)
141
+ mini_magick (4.5.1)
142
+ minitest (5.11.3)
143
+ molinillo (0.6.4)
144
+ multi_json (1.13.1)
145
+ multi_xml (0.6.0)
146
+ multipart-post (2.0.0)
60
147
  nanaimo (0.2.3)
61
148
  nap (1.1.0)
62
149
  netrc (0.11.0)
150
+ os (0.9.6)
151
+ plist (3.4.0)
152
+ public_suffix (2.0.5)
63
153
  rake (10.4.2)
154
+ representable (3.0.4)
155
+ declarative (< 0.1.0)
156
+ declarative-option (< 0.2.0)
157
+ uber (< 0.2.0)
158
+ retriable (3.1.1)
159
+ rouge (2.0.7)
64
160
  ruby-macho (1.1.0)
161
+ rubyzip (1.2.1)
162
+ security (0.1.3)
163
+ signet (0.8.1)
164
+ addressable (~> 2.3)
165
+ faraday (~> 0.9)
166
+ jwt (>= 1.5, < 3.0)
167
+ multi_json (~> 1.10)
168
+ slack-notifier (2.3.2)
169
+ terminal-notifier (1.8.0)
170
+ terminal-table (1.8.0)
171
+ unicode-display_width (~> 1.1, >= 1.1.1)
65
172
  thread_safe (0.3.6)
66
- tzinfo (1.2.4)
173
+ tty-cursor (0.5.0)
174
+ tty-screen (0.6.4)
175
+ tty-spinner (0.8.0)
176
+ tty-cursor (>= 0.5.0)
177
+ tzinfo (1.2.5)
67
178
  thread_safe (~> 0.1)
68
- xcodeproj (1.5.4)
179
+ uber (0.1.0)
180
+ unf (0.1.4)
181
+ unf_ext
182
+ unf_ext (0.0.7.5)
183
+ unicode-display_width (1.3.0)
184
+ word_wrap (1.0.0)
185
+ xcodeproj (1.5.6)
69
186
  CFPropertyList (~> 2.3.3)
187
+ atomos (~> 0.1.2)
70
188
  claide (>= 1.0.2, < 2.0)
71
189
  colored2 (~> 3.1)
72
190
  nanaimo (~> 0.2.3)
191
+ xcpretty (0.2.8)
192
+ rouge (~> 2.0.7)
193
+ xcpretty-travis-formatter (1.0.0)
194
+ xcpretty (~> 0.2, >= 0.0.7)
73
195
 
74
196
  PLATFORMS
75
197
  ruby
76
198
 
77
199
  DEPENDENCIES
78
200
  bundler (~> 1.15)
201
+ cocoapods
202
+ dotenv
203
+ fastlane
79
204
  ppdbiu!
80
205
  rake (~> 10.0)
81
206
 
82
207
  BUNDLED WITH
83
- 1.15.3
208
+ 1.16.1
data/README.md CHANGED
@@ -26,17 +26,43 @@ Or install it yourself as:
26
26
 
27
27
  - 删除所有的pod 'xxxxx'
28
28
 
29
- - 添加`makeup_pods(url)`, 其中url为获取json依赖内容的地址,通过url接口请求得到Podfile中的依赖,来安装依赖内容。
29
+ - 添加`makeup_pods(url, params, method)`, 其中url为获取json依赖内容的地址,通过url接口请求得到Podfile中的依赖,来安装依赖内容, params为url的请求参数, method为网络请求的方式,支持GET和POST。
30
30
 
31
31
  - json内容格式如下:
32
32
 
33
33
  ```json
34
34
  {
35
- "PPDBLUtils":{"version":"~> 1.2.0"},
36
- "PPDBLRouter":{"version":"~> 1.1.0"},
37
- "PPDBLOpenSSL":{"git":"http://git.xxxx.com/wireless/PPDBLOpenSSL.git"},
38
- "PPDBLCore":{"git":"http://git.xxxx.com/wireless/PPDBLCore.git", "branch":"master"},
39
- "PPDBLWebViewJSBridge":{"git":"http://git.xxxx.com/wireless/PPDBLWebViewJSBridge.git", "tag":"1.1.0"}
35
+ "result": 0,
36
+ "codeMsg": "",
37
+ "resultMessage": "响应成功",
38
+ "content": [
39
+ {
40
+ "dependencyName": "PPDBLUtils",
41
+ "componentVersion": "~> 1.2.0"
42
+ },
43
+ {
44
+ "dependencyName": "PPDBLRouter",
45
+ "componentVersion": "1.1.0"
46
+ },
47
+ {
48
+ "dependencyName": "PPDBLOpenSSL",
49
+ "gitUrl": "http://xxxx.com/wireless/PPDBLOpenSSL.git"
50
+ },
51
+ {
52
+ "dependencyName": "PPDBLCore",
53
+ "gitUrl": "http://xxxx.com/wireless/PPDBLCore.git",
54
+ "componentBranch": "master"
55
+ },
56
+ {
57
+ "dependencyName": "PPDBLWebViewJSBridge",
58
+ "gitUrl": "http://xxxx.com/wireless/PPDBLWebViewJSBridge.git",
59
+ "tag": "1.1.0"
60
+ }
61
+ ],
62
+ "pageNo": 1,
63
+ "pageSize": 10,
64
+ "totalCount": 5,
65
+ "totalPageCount": 1
40
66
  }
41
67
  ```
42
68
 
data/Rakefile CHANGED
@@ -4,7 +4,7 @@ task :default => :spec
4
4
 
5
5
  require "ppdbiu"
6
6
 
7
- desc "测试makeup_pods"
7
+ desc "测试pod install命令"
8
8
  task :ppdpod do
9
- sh 'pod install'
10
- end
9
+ sh 'cd test && pod install'
10
+ end
@@ -1,3 +1,3 @@
1
1
  module Ppdbiu
2
- VERSION = "0.1.2"
2
+ VERSION = "0.2.0"
3
3
  end
data/lib/ppdbiu.rb CHANGED
@@ -1,60 +1,83 @@
1
1
  require "ppdbiu/version"
2
2
 
3
3
  module Pod
4
- class Podfile
5
- def makeup_pods(url)
6
- UI.title "makeup pods dependency from #{url}"
7
- file = "dependency.json"
8
- dependencies = peform_request(url)
9
- if dependencies
10
- #1.保存json
11
- File.delete(file) if File.exist?(file)
12
- File.open(file, "w") { |io| io.syswrite(JSON.generate(dependencies))}
13
- #2.安装依赖
14
- ppd_pod(dependencies)
15
- else
16
- #1.读取本地保存的json
17
- json = File.read(file) if File.exist?(file)
18
- dependencies = JSON.parse(json)
19
- #2.安装依赖
20
- ppd_pod(dependencies) if dependencies
21
- end
22
- end
4
+ class Podfile
5
+ def makeup_pods(url, params, method)
6
+ UI.title "makeup pods dependency from #{url}"
7
+ file = "dependency.json"
8
+ dependencies = peform_request(url, params, method)
9
+ if dependencies
10
+ #1.保存json
11
+ File.delete(file) if File.exist?(file)
12
+ File.open(file, "w") { |io| io.syswrite(JSON.generate(dependencies))}
13
+ #2.安装依赖
14
+ ppd_pod(dependencies)
15
+ else
16
+ #1.读取本地保存的json
17
+ json = File.read(file) if File.exist?(file)
18
+ dependencies = JSON.parse(json)
19
+ #2.安装依赖
20
+ ppd_pod(dependencies) if dependencies
21
+ end
22
+ end
23
23
 
24
- def ppd_pod(dependencies)
25
- dependencies.each { |key, value|
26
- version = value.fetch("version", nil)
27
- if version
28
- pod(key, version)
29
- else
30
- hash = {}
31
- value.each{ |rKey, rValue|
32
- hash[:git] = rValue if rKey == "git"
33
- hash[:branch] = rValue if rKey == "branch"
34
- hash[:tag] = rValue if rKey == "tag"
35
- hash[:commit] = rValue if rKey == "commit"
36
- hash[:configuration] = rValue if rKey == "configuration"
37
- hash[:path] = rValue if rKey == "path"
38
- hash[:podspec] = rValue if rKey == "podspec"
39
- hash[:subspecs] = rValue if rKey == "subspecs"
40
- }
41
- pod(key, hash)
42
- end
43
- }
44
- end
24
+ def ppd_pod(dependencies)
25
+ dependencies.each { |value|
26
+ componentName = value.fetch("dependencyName", nil)
27
+ unless componentName
28
+ return
29
+ end
30
+ version = value.fetch("componentVersion", nil)
31
+ if version
32
+ pod(componentName, version)
33
+ else
34
+ hash = {}
35
+ value.each{ |rKey, rValue|
36
+ hash[:git] = rValue if rKey == "gitUrl"
37
+ hash[:branch] = rValue if rKey == "componentBranch"
38
+ hash[:tag] = rValue if rKey == "tag"
39
+ hash[:commit] = rValue if rKey == "commit"
40
+ hash[:configuration] = rValue if rKey == "configuration"
41
+ hash[:path] = rValue if rKey == "path"
42
+ hash[:podspec] = rValue if rKey == "podspec"
43
+ hash[:subspecs] = rValue if rKey == "subspecs"
44
+ }
45
+ pod(componentName, hash)
46
+ end
47
+ }
48
+ end
45
49
 
46
- def peform_request(url)
47
- require 'rest'
48
- require 'json'
49
- headers = { 'Content-Type' => 'application/json' }
50
- response = REST.get(url, headers)
51
- if response.ok?
52
- body = JSON.parse(response.body)
53
- body
54
- else
55
- CoreUI.warn "Request to #{url} failed - #{response.status_code}"
56
- nil
57
- end
58
- end
59
- end
60
- end
50
+ def peform_request(url, params, method)
51
+ require 'rest'
52
+ require 'json'
53
+
54
+ headers = {'Accept' => 'application/json, */*', 'Content-Type' => 'application/json; charset=utf-8'}
55
+ if 'GET' == method || 'get' == method
56
+ response = REST.get(url, headers, params)
57
+ handleResponse(url, response)
58
+ elsif 'POST' == method || 'post' == method
59
+ response = REST.post(url, params.to_json, headers)
60
+ handleResponse(url, response)
61
+ end
62
+ end
63
+
64
+ def handleResponse(url, response)
65
+ if response.ok?
66
+ body = JSON.parse(response.body)
67
+ result = body["result"]
68
+ if result == 0
69
+ content = body["content"]
70
+ UI.title content
71
+ content
72
+ else
73
+ resultMessage = body["resultMessage"]
74
+ CoreUI.warn "Request to #{url} has error - #{resultMessage}"
75
+ nil
76
+ end
77
+ else
78
+ CoreUI.warn "Request to #{url} failed - #{response.status_code}"
79
+ nil
80
+ end
81
+ end
82
+ end
83
+ end
data/ppdbiu.gemspec CHANGED
@@ -23,4 +23,8 @@ Gem::Specification.new do |spec|
23
23
 
24
24
  spec.add_development_dependency "bundler", "~> 1.15"
25
25
  spec.add_development_dependency "rake", "~> 10.0"
26
+ spec.add_development_dependency "cocoapods"
27
+ spec.add_development_dependency "fastlane"
28
+ spec.add_development_dependency "dotenv"
29
+
26
30
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ppdbiu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - wanyakun
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-12-28 00:00:00.000000000 Z
11
+ date: 2018-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -38,6 +38,48 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: cocoapods
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: fastlane
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: dotenv
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
41
83
  description: 用来处理iOS应用的CocoaPods依赖关系,根据远程依赖配置数据自动安装配置.
42
84
  email:
43
85
  - wanyakun@vip.qq.com