ppdbiu 0.2.0 → 0.2.1

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: 64dfe154c4eaa4cd871bfbcceb8a520769a9103e
4
- data.tar.gz: a2387144051d8dc4c8a140126d4b9d9fe84b79d4
3
+ metadata.gz: 533508fde455a9cb761ac7a51d701eb7d56c82bb
4
+ data.tar.gz: 92ae1b922b9fd1afc3f6e163be30b5493a54d91c
5
5
  SHA512:
6
- metadata.gz: 4014410edf7febdc59928e4925e78bf052a085972114b4c5df77f883b5a72a9f4a87ddd7a770f64cbab846fdbc8a70b2328aa6f03ac75b5625eff605a6e72af2
7
- data.tar.gz: d4722f1353858c79f7cb213df2247467a0fde71f795ecec011aff874902a09c5db6134e2f885015c4416c9f5509322f1ee6f059f5e308ad70eb89480d49a8698
6
+ metadata.gz: b048a4bd94daac9608ccc99907dabfe817b7d5936992a15b14aaeb11662f42e53b481bad1cd2cddfb888500082e63742a18a4367a35ed6d5d3e338b617b5fe18
7
+ data.tar.gz: 8fcb1a486491443ab1232638273fe7138c4cce8644466356375494d7092392e513f5912a9a9835f6d7a7094c12d4b47c2b0f404c154d535c567696b03f53b881
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ppdbiu (0.2.0)
4
+ ppdbiu (0.2.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -26,7 +26,7 @@ Or install it yourself as:
26
26
 
27
27
  - 删除所有的pod 'xxxxx'
28
28
 
29
- - 添加`makeup_pods(url, params, method)`, 其中url为获取json依赖内容的地址,通过url接口请求得到Podfile中的依赖,来安装依赖内容, params为url的请求参数, method为网络请求的方式,支持GET和POST
29
+ - 添加`makeup_pods(url, params, method, ignores)`, 其中url为获取json依赖内容的地址,通过url接口请求得到Podfile中的依赖,来安装依赖内容, params为url的请求参数, method为网络请求的方式,支持GET和POST, ignores为忽略依赖的数组,在执行依赖安装的过程中会判断依赖名称是否在忽略的数组中,忽略数组一般用来调试本地组件或者指定git地址使用,放弃从配置中安装依赖,再在Podfile中添加本地组件或者git地址。
30
30
 
31
31
  - json内容格式如下:
32
32
 
@@ -66,6 +66,26 @@ Or install it yourself as:
66
66
  }
67
67
  ```
68
68
 
69
+ 实例:
70
+
71
+ ```ruby
72
+ source 'http://git.ppdaicorp.com/wireless/Specs.git'
73
+
74
+ platform :ios, "8.0"
75
+ inhibit_all_warnings!
76
+
77
+ target 'CityLoan' do
78
+ require 'ppdbiu'
79
+
80
+ # 不包含忽略数组
81
+ makeup_pods('http://mplatform.ppdaicorp.com/dep/list', {'applicationVersionId' => '4', 'pageSize' => '99999'}, 'POST')
82
+ # 包含忽略数组
83
+ # makeup_pods('http://mplatform.ppdaicorp.com/dep/list', {'applicationVersionId' => '4', 'pageSize' => '99999'}, 'POST', ['PPDBLNetworking', 'PPDBLUtils'])
84
+
85
+ end
86
+
87
+ ```
88
+
69
89
  ## Development
70
90
 
71
91
  After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -1,3 +1,3 @@
1
1
  module Ppdbiu
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
data/lib/ppdbiu.rb CHANGED
@@ -2,7 +2,7 @@ require "ppdbiu/version"
2
2
 
3
3
  module Pod
4
4
  class Podfile
5
- def makeup_pods(url, params, method)
5
+ def makeup_pods(url, params, method, ignores = [])
6
6
  UI.title "makeup pods dependency from #{url}"
7
7
  file = "dependency.json"
8
8
  dependencies = peform_request(url, params, method)
@@ -11,22 +11,37 @@ module Pod
11
11
  File.delete(file) if File.exist?(file)
12
12
  File.open(file, "w") { |io| io.syswrite(JSON.generate(dependencies))}
13
13
  #2.安装依赖
14
- ppd_pod(dependencies)
14
+ ppd_pod(dependencies, ignores)
15
15
  else
16
16
  #1.读取本地保存的json
17
17
  json = File.read(file) if File.exist?(file)
18
18
  dependencies = JSON.parse(json)
19
19
  #2.安装依赖
20
- ppd_pod(dependencies) if dependencies
20
+ ppd_pod(dependencies, ignores) if dependencies
21
21
  end
22
22
  end
23
23
 
24
- def ppd_pod(dependencies)
24
+ def ppd_pod(dependencies, ignores)
25
25
  dependencies.each { |value|
26
26
  componentName = value.fetch("dependencyName", nil)
27
27
  unless componentName
28
28
  return
29
29
  end
30
+ # 判断依赖是否在ignores中,如果在则略过
31
+ if ignores
32
+ isIgnore = false;
33
+ ignores.each { |ignore|
34
+ if ignore == componentName
35
+ isIgnore = true
36
+ break
37
+ end
38
+ }
39
+ if isIgnore
40
+ return
41
+ end
42
+ end
43
+
44
+
30
45
  version = value.fetch("componentVersion", nil)
31
46
  if version
32
47
  pod(componentName, version)
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.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - wanyakun
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-03-08 00:00:00.000000000 Z
11
+ date: 2018-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler