-
-
Notifications
You must be signed in to change notification settings - Fork 105
added support for tilde-initial paths #309
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
Conversation
Please use |
Please not that #308 may not be considered a bug. |
That was my first attempted solution. Technically i just replaced the calls to BUT doing that converted there are 2 problems with this:
The using |
I.e. specifying the home directory by starting the path with a tilde. Additionally added extra info to the error message when a shard.yml file isn't found.
additional issues resolved. corrected. rebased pushed. it just needed to be expanded in |
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.
Don't use Path
. We don't need it and it leads ro duplicate behavior. Also we must fail ASAP with a proper message if the expanded path isn't a directory.
Just use expanded_local_path
, and fix it so it expands ~
. Thanks.
I.e. File.expand_path(local_path, home: true).tap do
dependency["path"].to_s | ||
path = dependency["path"].to_s |
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.
That shouldn't be changed.
|
||
if File.exists?(spec_path) | ||
File.read(spec_path) | ||
else | ||
raise Error.new("Missing #{SPEC_FILENAME.inspect} for #{dependency.name.inspect}") | ||
raise Error.new("Missing #{SPEC_FILENAME.inspect} for #{dependency.name.inspect}\n Expected it at #{spec_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.
No need for newlines.
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.
In fact changing the message isn't needed when using expanded_local_path
that will report that the directory doesn't exist.
Note that I have nothing against |
I.e. specifying the home directory by starting the
path with a tilde.
Additionally added extra info to the error message
when a shard.yml file isn't found.
This fixes Issue #308
All tests pass. No new tests added to cover this because there don't appear to be ANY tests for this class.