CocoaPods/CocoaPods — pull request #1130 by HBehrens (2013-06-21 08:28:17+00:00)
Title: fix for errornous linting on 0.21.0.rc1

Linting the apparently valid podspec (Transit 0.0.2)[https://github.com/BeamApp/Transit/commit/c2b6a3f3c83f99890e8aa42b9a36f982b9d06338] fails on 0.21.0.rc1 and hinders publishing the spec since (travis aborts the build)[https://travis-ci.org/CocoaPods/Specs/builds/8286425] consequently.

The output
```
NoMethodError - undefined method `spec_consumer' for nil:NilClass
/Library/Ruby/Gems/1.8/gems/cocoapods-0.21.0.rc1/lib/cocoapods/validator.rb:253:in `check_file_patterns'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.21.0.rc1/lib/cocoapods/validator.rb:251:in `each'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.21.0.rc1/lib/cocoapods/validator.rb:251:in `check_file_patterns'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.21.0.rc1/lib/cocoapods/validator.rb:179:in `perform_extensive_analysis'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.21.0.rc1/lib/cocoapods/validator.rb:173:in `each'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.21.0.rc1/lib/cocoapods/validator.rb:173:in `perform_extensive_analysis'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.21.0.rc1/lib/cocoapods/validator.rb:63:in `validate'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.21.0.rc1/lib/cocoapods/command/spec.rb:86:in `run'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.21.0.rc1/lib/cocoapods/command/spec.rb:80:in `each'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.21.0.rc1/lib/cocoapods/command/spec.rb:80:in `run'
/Library/Ruby/Gems/1.8/gems/claide-0.3.2/lib/claide/command.rb:206:in `run'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.21.0.rc1/lib/cocoapods/command.rb:49:in `run'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.21.0.rc1/bin/pod:19
/usr/bin/pod:23:in `load'
/usr/bin/pod:23
```

is caused by and empty `@file_accessor` instance variable in the validator since `install_pod` expects a specific order when building `file_accessors`:

```ruby
def install_pod
podfile = podfile_from_spec(consumer.platform_name, spec.deployment_target(consumer.platform_name))
sandbox = Sandbox.new(config.sandbox_root)
installer = Installer.new(sandbox, podfile)
installer.install!

# here: value of installer.aggregate_targets.first.pod_targets is
# [, ]

file_accessors = installer.aggregate_targets.first.pod_targets.first.file_accessors
@file_accessor = file_accessors.find { |accessor| accessor.spec == spec }
config.silent
end
```

At least in my case, the desired target (Pods-Transit) cames last not first. Building `file_accessors` as combined list of all `files_accessors` of every target seems to solve this.