Skip to content

Conversation

@barakwei
Copy link
Contributor

@barakwei barakwei commented Mar 22, 2017

This PR fixes a bug that when a reference proxy doesn't have a name, it's display name doesn't fall back to "ReferenceProxy" but to the path.
This is manifested if you have a framework object in your project and it's referenced (usually by a build file) in a build phase. In this case, the display name was "ReferenceProxy" and not "XXX.framework".
Fixes #472

@segiddins
Copy link
Member

Can you confirm this fixes the issue?

@barakwei
Copy link
Contributor Author

I actually have no idea how to test this when the gem source in on my machine, but if I open the class as I show in the bug, this issue is fixed.
Also colored2 version 3.1.1 doesn't exist (3.1.2 does) and I can't run rspec for some reason.

@segiddins
Copy link
Member

@barakwei
Copy link
Contributor Author

Works great.

@segiddins
Copy link
Member

👍🏻

@benasher44
Copy link
Member

@barakwei thanks for doing this! Would you mind adding a unit test/spec and a CHANGELOG entry?

@barakwei
Copy link
Contributor Author

I'd love to add tests, but just running rspec fails. I'm using ruby 2.4.0, can that be the problem?

/usr/local/lib/ruby/gems/2.4.0/gems/rspec-expectations-3.5.0/lib/rspec/matchers/dsl.rb:19:in `warn_about_block_args': undefined method `parameters' for nil:NilClass (NoMethodError)
	from /usr/local/lib/ruby/gems/2.4.0/gems/rspec-expectations-3.5.0/lib/rspec/matchers/dsl.rb:8:in `define'
	from /Users/barakwei/Code/Xcodeproj/spec/project/project_helper_integration_spec.rb:81:in `block (3 levels) in <module:ProjectHelperSpecs>'
	from /usr/local/lib/ruby/gems/2.4.0/gems/rspec-core-3.5.4/lib/rspec/core/example_group.rb:385:in `module_exec'
	from /usr/local/lib/ruby/gems/2.4.0/gems/rspec-core-3.5.4/lib/rspec/core/example_group.rb:385:in `subclass'
	from /usr/local/lib/ruby/gems/2.4.0/gems/rspec-core-3.5.4/lib/rspec/core/example_group.rb:258:in `block in define_example_group_method'
	from /Users/barakwei/Code/Xcodeproj/spec/project/project_helper_integration_spec.rb:80:in `block (2 levels) in <module:ProjectHelperSpecs>'
	from /usr/local/lib/ruby/gems/2.4.0/gems/rspec-core-3.5.4/lib/rspec/core/example_group.rb:385:in `module_exec'
	from /usr/local/lib/ruby/gems/2.4.0/gems/rspec-core-3.5.4/lib/rspec/core/example_group.rb:385:in `subclass'
	from /usr/local/lib/ruby/gems/2.4.0/gems/rspec-core-3.5.4/lib/rspec/core/example_group.rb:258:in `block in define_example_group_method'
	from /Users/barakwei/Code/Xcodeproj/spec/project/project_helper_integration_spec.rb:79:in `block in <module:ProjectHelperSpecs>'
	from /usr/local/lib/ruby/gems/2.4.0/gems/rspec-core-3.5.4/lib/rspec/core/example_group.rb:385:in `module_exec'
	from /usr/local/lib/ruby/gems/2.4.0/gems/rspec-core-3.5.4/lib/rspec/core/example_group.rb:385:in `subclass'
	from /usr/local/lib/ruby/gems/2.4.0/gems/rspec-core-3.5.4/lib/rspec/core/example_group.rb:258:in `block in define_example_group_method'
	from /usr/local/lib/ruby/gems/2.4.0/gems/rspec-core-3.5.4/lib/rspec/core/dsl.rb:43:in `block in expose_example_group_alias'
	from /usr/local/lib/ruby/gems/2.4.0/gems/rspec-core-3.5.4/lib/rspec/core/dsl.rb:84:in `block (2 levels) in expose_example_group_alias_globally'
	from /Users/barakwei/Code/Xcodeproj/spec/project/project_helper_integration_spec.rb:6:in `<module:ProjectHelperSpecs>'
	from /Users/barakwei/Code/Xcodeproj/spec/project/project_helper_integration_spec.rb:5:in `<top (required)>'
	from /usr/local/lib/ruby/gems/2.4.0/gems/rspec-core-3.5.4/lib/rspec/core/configuration.rb:1435:in `load'
	from /usr/local/lib/ruby/gems/2.4.0/gems/rspec-core-3.5.4/lib/rspec/core/configuration.rb:1435:in `block in load_spec_files'
	from /usr/local/lib/ruby/gems/2.4.0/gems/rspec-core-3.5.4/lib/rspec/core/configuration.rb:1433:in `each'
	from /usr/local/lib/ruby/gems/2.4.0/gems/rspec-core-3.5.4/lib/rspec/core/configuration.rb:1433:in `load_spec_files'
	from /usr/local/lib/ruby/gems/2.4.0/gems/rspec-core-3.5.4/lib/rspec/core/runner.rb:100:in `setup'
	from /usr/local/lib/ruby/gems/2.4.0/gems/rspec-core-3.5.4/lib/rspec/core/runner.rb:86:in `run'
	from /usr/local/lib/ruby/gems/2.4.0/gems/rspec-core-3.5.4/lib/rspec/core/runner.rb:71:in `run'
	from /usr/local/lib/ruby/gems/2.4.0/gems/rspec-core-3.5.4/lib/rspec/core/runner.rb:45:in `invoke'
	from /usr/local/lib/ruby/gems/2.4.0/gems/rspec-core-3.5.4/exe/rspec:4:in `<top (required)>'
	from /usr/local/bin/rspec:22:in `load'
	from /usr/local/bin/rspec:22:in `<main>'

@benasher44
Copy link
Member

@barakwei that's interesting. What command are you using to run the tests?

@barakwei
Copy link
Contributor Author

Just rspec.

@segiddins
Copy link
Member

Try running bundle exec rake, I believe this project still uses bacon

@benasher44
Copy link
Member

Yep that, and you can do bundle exec bacon <path_to_spec> to run a specific one.

This commit fixes a bug that when a reference proxy doesn't have a
name, it's display name doesn't fall back to "ReferenceProxy" but
to the path.
This is manifested if you have a framework object in your project
and it's referenced (usually by a build file) in a build phase.
@barakwei barakwei force-pushed the reference-proxy-display-name branch from 6a14ac9 to 786215c Compare March 27, 2017 08:06
@barakwei
Copy link
Contributor Author

Done

@benasher44 benasher44 merged commit 284d9d4 into CocoaPods:master Mar 27, 2017
@benasher44
Copy link
Member

@barakwei thank you!

@barakwei barakwei deleted the reference-proxy-display-name branch March 27, 2017 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PBXReferenceProxy missing display_name attribute.

3 participants