title: Cocoapods RUBY undefined local variable or method
body: <p>I am still quite a beginner on Ruby. I am trying to write some extra code to handle our 50 targets Cocoapods dependencies.</p>
  <p>With the following code:</p>
  <pre><code>testString = &quot;TEST!!!&quot;
  
  def processPods(platform_name)
      project = Xcodeproj::Project.open &quot;./WhiteLabel.xcodeproj&quot;
      project.targets.each { |target| 
          target_name = target.name
          if target.platform_name == platform_name
              puts &quot;Processing #{target_name} for Platform #{platform_name}&quot;
              puts testString #--&gt;Error ...
          end 
      }
  end
  
  #Cocoapods methods
  abstract_target 'iOS' do
      puts testString #--&gt;Executes
      processPods(:ios)
  end
  </code></pre>
  <p>For the sake of the question, &quot;testString&quot; replaces a bigger variable.</p>
  <p>When I run the code I get:</p>
  <pre><code>TEST!!!
  Processing WhiteLabel for Platform ios
  
  [!] Invalid `Podfile` file: undefined local variable or method `testString' for #&lt;Pod::Podfile:0x00007f8fe11cc2d0&gt;.
  
   #  from ~/Documents/Developer/Xcode/WhiteLabelApple/Podfile:124
   #  -------------------------------------------
   #              puts &quot;Processing #{target_name} for Platform #{platform_name}&quot;
   &gt;              puts testString
   #          end 
   #  -------------------------------------------
  </code></pre>
  <p>Any idea why?</p>