Class: Pod::Podfile::TargetDefinition

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods-cafswitcher/podfile_switch.rb

Instance Method Summary collapse

Instance Method Details

#clean(name, requirements) ⇒ Object



218
219
220
221
222
223
224
225
226
227
228
229
230
# File 'lib/cocoapods-cafswitcher/podfile_switch.rb', line 218

def clean(name, requirements)
  tmp_hash = deep_copy(requirements)
  options = tmp_hash.last
  return tmp_hash unless options.is_a?(Hash)

  isFramework = options.delete(Pod::Podfile.isFramework)
  isSource = options.delete(Pod::Podfile.isSource)
  isArchive = options.delete(Pod::Podfile.isArchive)
  # isDebugPackage = options.delete(Pod::Podfile.isDebugPackage)
  # isReleasePackage = options.delete(Pod::Podfile.isReleasePackage)
  tmp_hash.pop if options.empty?
  tmp_hash
end

#deep_copy(o) ⇒ Object



214
215
216
# File 'lib/cocoapods-cafswitcher/podfile_switch.rb', line 214

def deep_copy(o)
  Marshal.load(Marshal.dump(o))
end

#parse_isArchive(name, requirements) ⇒ Object



141
142
143
144
145
146
147
148
149
150
# File 'lib/cocoapods-cafswitcher/podfile_switch.rb', line 141

def parse_isArchive(name, requirements)
  options = requirements.last
  return requirements unless options.is_a?(Hash)

  isArchive = options.key?(Pod::Podfile.isArchive)
  # pod_name = Specification.root_name(name)
  Pod::Podfile.archiveList << name if isArchive

  requirements.pop if options.empty?
end

#parse_isFramework(name, requirements) ⇒ Object



122
123
124
125
126
127
128
129
# File 'lib/cocoapods-cafswitcher/podfile_switch.rb', line 122

def parse_isFramework(name, requirements)
  options = requirements.last
  return requirements unless options.is_a?(Hash)
  isFramework = options.key?(Pod::Podfile.isFramework)
  # pod_name = Specification.root_name(name)
  Pod::Podfile.frameworkList << name if isFramework
  requirements.pop if options.empty?
end

#parse_isSource(name, requirements) ⇒ Object



131
132
133
134
135
136
137
138
139
# File 'lib/cocoapods-cafswitcher/podfile_switch.rb', line 131

def parse_isSource(name, requirements)
  options = requirements.last
  return requirements unless options.is_a?(Hash)

  isSource = options.key?(Pod::Podfile.isSource)
  # pod_name = Specification.root_name(name)
  Pod::Podfile.sourceList << name if isSource
  requirements.pop if options.empty?
end

#parse_needUpdatePod_git(name, requirements) ⇒ Object

def parse_debug_package(name, requirements)

options = requirements.last
return requirements unless options.is_a?(Hash)

isDebugPackage = options.has_key?(Pod::Podfile.isDebugPackage)
# pod_name = Specification.root_name(name)
if isDebugPackage
  Pod::Podfile.debugPackageList << name.gsub(/[\/]/, '_')
end
requirements.pop if options.empty?

end

def parse_release_package(name, requirements)

options = requirements.last
return requirements unless options.is_a?(Hash)

isReleasePackage = options.has_key?(Pod::Podfile.isReleasePackage)
# pod_name = Specification.root_name(name)
if isReleasePackage
  Pod::Podfile.releasePackageList << name.gsub(/[\/]/, '_')
end
requirements.pop if options.empty?

end



176
177
178
179
180
181
182
183
184
# File 'lib/cocoapods-cafswitcher/podfile_switch.rb', line 176

def parse_needUpdatePod_git(name, requirements)
  options = requirements.last
  return requirements unless options.is_a?(Hash)

  isGitPath = options.key?(:git)
  # pod_name = Specification.root_name(name)
  Pod::Podfile.needUpdatePodList << name if isGitPath
  requirements.pop if options.empty?
end

#parse_needUpdatePod_path(name, requirements) ⇒ Object



186
187
188
189
190
191
192
193
194
# File 'lib/cocoapods-cafswitcher/podfile_switch.rb', line 186

def parse_needUpdatePod_path(name, requirements)
  options = requirements.last
  return requirements unless options.is_a?(Hash)

  isPath = options.key?(:path)
  # pod_name = Specification.root_name(name)
  Pod::Podfile.needUpdatePodList << name if isPath
  requirements.pop if options.empty?
end