Class: Pod::Podfile::TargetDefinition

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

Instance Method Summary collapse

Instance Method Details

#parse_debug_release_package(name, requirements) ⇒ Object



106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/cocoapods-cafswitcher/podfile_switch.rb', line 106

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

  isDebugPackage = options.delete(Pod::Podfile.isDebugPackage)
  isReleasePackage = options.delete(Pod::Podfile.isReleasePackage)
  if (isDebugPackage and isReleasePackage) or isReleasePackage
    Pod::Podfile.releasePackageList << name
  else
    Pod::Podfile.debugPackageList << name
  end
  requirements.pop if options.empty?
end

#parse_git_path(name, requirements) ⇒ Object



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

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

  isGitPath = options.key?(:git)
  Pod::Podfile.gitPathList << name if isGitPath

  isPath = options.key?(:path)
  Pod::Podfile.gitPathList << name if isPath
  requirements.pop if options.empty?
end

#parse_source_framework_key(name, requirements) ⇒ Object



91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/cocoapods-cafswitcher/podfile_switch.rb', line 91

def parse_source_framework_key(name, requirements)
  options = requirements.last
  return requirements unless options.is_a?(Hash)
  isFramework = options.delete(Pod::Podfile.isFramework)
  isSource = options.delete(Pod::Podfile.isSource)
  if isSource or (isSource and isFramework)
    Pod::Podfile.sourceList << name
  elsif isFramework
    Pod::Podfile.frameworkList << name
  else
    Pod::Podfile.unspecifiedList << name
  end
  requirements.pop if options.empty?
end