CocoaPods/CocoaPods — pull request #1030 by rivera-ernesto (2013-05-07 08:02:25+00:00)
Title: [In progress] Fix copy resources script for iOS < 6 and OS X < 10.8

Remove the following flag from the script to avoid crashes

```
man ibtool:

--reference-external-strings-file
When combined with the --compile option, this flag indicates that the files in the Base.lproj locale folder should be
compiled to reference the matching external strings files found in the other locales when loaded. Available on 10.8 and
later.
```

New to cocoa pods (and Ruby!) so **I need some help to evaluate `greaterorquealto_osx10_8_or_ios6 `**:

``` ruby
# target_installer.rb

def create_copy_resources_script
path = library.copy_resources_script_path
UI.message "- Generating copy resources script at #{UI.path(path)}" do
resources = library.file_accessors.map { |accessor| accessor.resources.flatten.map {|res| project.relativize(res)} }.flatten
resources << bridge_support_file if bridge_support_file
# @todo inspect library.platform to see if it is osx 10.8+ or 6.0+
greaterorquealto_osx10_8_or_ios6 = true
generator = Generator::CopyResourcesScript.new(resources, greaterorquealto_osx10_8_or_ios6)
generator.save_as(path)
add_file_to_support_group(path)
end
end
```

Which in turn will remove the offending `--reference-external-strings-file` flag:

``` ruby
# copy_resources_script.rb

def save_as(pathname)
pathname.open('w') do |script|
script.puts @reference_external_strings_file ? CONTENT : CONTENT.gsub(' --reference-external-strings-file', '')
@resources.each do |resource|
script.puts "install_resource '#{resource}'"
end
end
# @todo use File api
system("chmod +x '#{pathname}'")
end
```