Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warnings in dependency.rb #720

Merged
merged 3 commits into from
Mar 21, 2022
Merged

Fix warnings in dependency.rb #720

merged 3 commits into from
Mar 21, 2022

Conversation

ncooke3
Copy link
Contributor

@ncooke3 ncooke3 commented Mar 21, 2022

dependency.rb has a few warnings that are showing up locally and in CI when pod lib linting.

For example, see https://github.com/firebase/firebase-ios-sdk/runs/5619185788?check_suite_focus=true.

  1. warning: method redefined; discarding old ...
/usr/local/lib/ruby/gems/2.7.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/dependency.rb:117: warning: method redefined; discarding old specific_version=
  1. warning: instance variable ... not initialized
/usr/local/lib/ruby/gems/2.7.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/dependency.rb:112: warning: instance variable @specific_requirement not initialized

/usr/local/lib/ruby/gems/2.7.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/dependency.rb:133: warning: instance variable @external_source not initialized

cc: @paulb777

Copy link
Contributor Author

@ncooke3 ncooke3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fwiw, I've never written ruby

Comment on lines -106 to +108
attr_accessor :specific_version
attr_reader :specific_version
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes warning: method redefined; discarding old ... warning.

Comment on lines +102 to +103
@specific_requirement ||= nil
@external_source ||= nil
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes both warning: instance variable ... not initialized warnings.

@dnkoutso dnkoutso added this to the 1.12.0 milestone Mar 21, 2022
@dnkoutso
Copy link
Contributor

The CI issue we have not yet identified. Its for Ruby 3.0, going to merge this for now. Thank you!

@dnkoutso dnkoutso merged commit 90f1738 into CocoaPods:master Mar 21, 2022
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.

2 participants