-
Notifications
You must be signed in to change notification settings - Fork 349
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
Improve error messages for podspec dependencies #474
Improve error messages for podspec dependencies #474
Conversation
raise Informative, 'Unsupported version requirements' | ||
unless version_requirements.is_a?(Hash) | ||
version_requirements.each do |requirement| | ||
raise Informative, "Podspecs can only use remote pods as dependencies. :path is not supported" if requirement[:path] != nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would prefer if/elseif
here
Needs tests for each path and a changelog entry |
Nice idea 👍 |
if !requirement[:path].nil? | ||
raise Informative, 'Podspecs can only use remote pods as dependencies. :path is not supported' | ||
elsif !requirement[:git].nil? | ||
raise Informative, 'Podspecs can only use remote pods as dependencies. :git is not supported' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message isn't technically correct - you can use :git
dependencies, but they cannot be specified by the podspec itself (ex. if the Podfile contains pod 'MyPod', :git => '...'
, a podspec with the dependency 'MyPod'
will be fulfilled by that installation)
What about the following:
Podspecs cannot specify the source of dependencies. The
:git
option is not supported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After rereading this for a couple of times, I think In understand what you mean.
Will change the message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it the same with path?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup :path
behaves the same as far as I'm aware
CHANGELOG.md
Outdated
@@ -4,6 +4,10 @@ | |||
|
|||
##### Enhancements | |||
|
|||
* Better error messages, if unallowed version requirement is specified in Podspec. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add two extra spaces after .
for formatting
LGTM once lint warnings are addressed |
version_requirements.each do |requirement| | ||
if requirement.is_a?(Hash) | ||
if !requirement[:path].nil? | ||
raise Informative, 'Podspecs cannot specify the source of dependencies. The :path option is not supported.'\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit can you wrap :path with backticks ``? Same for :git below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
ping @Lutzifer needs a rebase and a comment addressed |
Improves the error message ’Unsupported version requirements' if it is caused by specifying :git or :path in the podspec file.
implemented the nit and did the rebase |
Thanks @Lutzifer! |
Improves the error message ’Unsupported version requirements' if it is caused by specifying :git or :path in the podspec file.