cocoapods-cafswitcher 0.0.4 → 0.0.6

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: 31445be2abcb86433759ab74dd951d2090dad8dac324dbf1cea32fcf7642b88f
4
- data.tar.gz: ee481b6def3b8d54d8eac95109491bbcd6c12f4b4c34d29647e9db1f03c16f34
3
+ metadata.gz: ab22ddae4087c4c1bdee9b9db70decbb129d0a5d23d36c2ed42be628457f3bb0
4
+ data.tar.gz: ef0da8784ff372f864a6aff89162e11b95b82ce3c85d049b1085b9a71fa0313b
5
5
  SHA512:
6
- metadata.gz: 3942eae6620ed3afc82981fc50ed67822f3d0bab59b5727b3508b60c79480730cdcf002510e24fe338469b6bdca764ea501eff71294540e5f3885c6681b26635
7
- data.tar.gz: 1d911a9b193b6dd1b54ee1a98f45991eecc2b42e8470265157adde3062458772ffb05463bbe926bbb7104d16cbded81d533afc3139dbfb9052c01a1bbc0b0f14
6
+ metadata.gz: 97801e574bdfe43f3cbf4a1d30e3a825985eab3d408f805df8f2908cfa2399893702942eed9d466c35888cc087858382157226060b92a82b435eabddbae48eb4
7
+ data.tar.gz: 3ddbcc7e595317b9651b5eb3a3bce0875e14c925f880f89a7e72dcf3463140635b5d6699b37470a96ccd6030ff8473683a571533a571bef42ec06633f36fe103
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cocoapods-cafswitcher (0.0.4)
4
+ cocoapods-cafswitcher (0.0.5)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -141,6 +141,8 @@ Pod::HooksManager.register('cocoapods-cafswitcher', :pre_install) do |installer_
141
141
  cafConfig = YAML.load(File.open(configFile))
142
142
  else
143
143
  FileUtils.touch configFile
144
+ cafConfig = Hash["sourceList" => [], "archiveList" => [], "frameworkList" => [],
145
+ "debugPackageList" => [], "releasePackageList" => []]
144
146
  end
145
147
  # 比较不同
146
148
  changedSubPods = Array.new
@@ -157,18 +159,19 @@ Pod::HooksManager.register('cocoapods-cafswitcher', :pre_install) do |installer_
157
159
  changedSubPods |= (value | frameworkList) - (value & frameworkList)
158
160
  end
159
161
  end
160
- changedSubPods = changedSubPods | needUpdatePodList
161
162
  Pod::UI.puts "\nchanged sub Pod is:\n " + changedSubPods.to_s if changedSubPods.length > 0
162
163
  # changedPod 里是根据subspec来存的,需要进行合并,找到pod库而不是含有subspec的库
163
164
  changedPods = Array.new
164
165
  changedSubPods.each {|subPod| changedPods << subPod.split("_")[0]}
166
+ # changedPods = changedPods | needUpdatePodList
165
167
  changedPods.uniq!
168
+
166
169
  Pod::UI.puts "\nchanged Pod is:\n " + changedPods.to_s if changedPods.length > 0
167
170
 
168
171
  # 根据不同删除cache
169
172
  podRoot = config.project_pods_root
170
173
  changedPods.each do |changedPod|
171
- if changedPod =~ /^(?i)LJ/ or changedPod =~ /^(?i)Lianjia/
174
+ if needUpdatePodList.delete(changedPod)
172
175
  # TODO如果pod 里没有用到preserve_paths,需要清除 pod cache clean
173
176
  cacheCleanCMD = "pod cache clean #{changedPod} --all"
174
177
  out = `#{cacheCleanCMD}`.lines.to_a
@@ -1,3 +1,3 @@
1
1
  module CocoapodsCafswitcher
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -31,16 +31,6 @@ module Pod
31
31
  :isReleasePackage
32
32
  end
33
33
 
34
- def self.git
35
- :git
36
- end
37
-
38
- def self.path
39
- :path
40
- end
41
-
42
-
43
-
44
34
  @@sourceList = Array.new
45
35
 
46
36
  def Podfile.sourceList
@@ -169,15 +159,26 @@ module Pod
169
159
  requirements.pop if options.empty?
170
160
  end
171
161
 
172
- def parse_needUpdatePod(name, requirements)
162
+ def parse_needUpdatePod_git(name, requirements)
163
+ options = requirements.last
164
+ return requirements unless options.is_a?(Hash)
165
+
166
+ isGitPath = options.has_key?(:git)
167
+ # pod_name = Specification.root_name(name)
168
+ if isGitPath
169
+ Pod::Podfile.needUpdatePodList << name[0,name=~/[\/]/]
170
+ end
171
+ requirements.pop if options.empty?
172
+ end
173
+
174
+ def parse_needUpdatePod_path(name, requirements)
173
175
  options = requirements.last
174
176
  return requirements unless options.is_a?(Hash)
175
177
 
176
- isGit = options.has_key?(Pod::Podfile.git)
177
- isPath = options.has_key?(Pod::Podfile.path)
178
+ isPath = options.has_key?(:path)
178
179
  # pod_name = Specification.root_name(name)
179
- if isGit or isPath
180
- Pod::Podfile.needUpdatePodList << name.gsub(/[\/]/, '_')
180
+ if isPath
181
+ Pod::Podfile.needUpdatePodList << name[0,name=~/[\/]/]
181
182
  end
182
183
  requirements.pop if options.empty?
183
184
  end
@@ -193,7 +194,8 @@ module Pod
193
194
  parse_isArchive(name, requirements)
194
195
  parse_debug_package(name, requirements)
195
196
  parse_release_package(name, requirements)
196
- parse_needUpdatePod(name, requirements)
197
+ parse_needUpdatePod_git(name, requirements)
198
+ parse_needUpdatePod_path(name, requirements)
197
199
  # pod_name = Specification.root_name(name)
198
200
  Pod::Podfile.allPodName << name.gsub(/[\/]/, '_')
199
201
  old_method.bind(self).(name, requirements)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-cafswitcher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - handa