Class: Pod::Podfile::TargetDefinition
- Inherits:
-
Object
- Object
- Pod::Podfile::TargetDefinition
- Defined in:
- lib/cocoapods-cafswitcher/podfile_switch.rb
Instance Method Summary collapse
- #clean(name, requirements) ⇒ Object
- #deep_copy(o) ⇒ Object
- #parse_debug_release_package(name, requirements) ⇒ Object
- #parse_git_path(name, requirements) ⇒ Object
- #parse_source_framework_key(name, requirements) ⇒ Object
Instance Method Details
#clean(name, requirements) ⇒ Object
154 155 156 157 158 159 160 161 162 163 164 165 |
# File 'lib/cocoapods-cafswitcher/podfile_switch.rb', line 154 def clean(name, requirements) tmp_hash = deep_copy(requirements) = tmp_hash.last return tmp_hash unless .is_a?(Hash) isFramework = .delete(Pod::Podfile.isFramework) isSource = .delete(Pod::Podfile.isSource) isDebugPackage = .delete(Pod::Podfile.isDebugPackage) isReleasePackage = .delete(Pod::Podfile.isReleasePackage) tmp_hash.pop if .empty? tmp_hash end |
#deep_copy(o) ⇒ Object
150 151 152 |
# File 'lib/cocoapods-cafswitcher/podfile_switch.rb', line 150 def deep_copy(o) Marshal.load(Marshal.dump(o)) end |
#parse_debug_release_package(name, requirements) ⇒ Object
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
# File 'lib/cocoapods-cafswitcher/podfile_switch.rb', line 109 def parse_debug_release_package(name, requirements) = requirements.last if not .is_a?(Hash) Pod::Podfile.debugPackageList << name return requirements end isDebugPackage = .key?(Pod::Podfile.isDebugPackage) isReleasePackage = .key?(Pod::Podfile.isReleasePackage) if (isDebugPackage and isReleasePackage) or isReleasePackage Pod::Podfile.releasePackageList << name else Pod::Podfile.debugPackageList << name end requirements.pop if .empty? end |
#parse_git_path(name, requirements) ⇒ Object
125 126 127 128 129 130 131 132 133 134 135 |
# File 'lib/cocoapods-cafswitcher/podfile_switch.rb', line 125 def parse_git_path(name, requirements) = requirements.last return requirements unless .is_a?(Hash) isGitPath = .key?(:git) Pod::Podfile.gitPathList << name if isGitPath isPath = .key?(:path) Pod::Podfile.gitPathList << name if isPath requirements.pop if .empty? end |
#parse_source_framework_key(name, requirements) ⇒ Object
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/cocoapods-cafswitcher/podfile_switch.rb', line 91 def parse_source_framework_key(name, requirements) = requirements.last if not .is_a?(Hash) Pod::Podfile.unspecifiedList << name return requirements end isFramework = .key?(Pod::Podfile.isFramework) isSource = .key?(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 .empty? end |