This repository has been archived by the owner on Aug 29, 2019. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Added a fix for absolute paths being created into plugin_assets direc…
…tory. [#6 state:resolved], [#26 state:resolved] - apologies for the delay, and thanks to Azimux for the patch.
- Loading branch information
Showing
2 changed files
with
5 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
031d8c1
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.
I have to ask the question, what is the point of this code anyway? I couldn’t understand why it is there. The directory is created anyway, further down in that function. Are you able to fill me in on what this is about?
031d8c1
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.
I think the only situation when this code is necessary is when you have an “assets” dir with files but no subdirectories (source_dirs is empty). In this case, the first block will take care of creating the destination dir.
I suppose the block could be replaced by:
FileUtils.mkdir_p(destination)
Anyway, I haven’t tested it.
031d8c1
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.
Okay, I see – thanks for explaining that. I’ve never actually seen the case when there are files in the root directory, however it might exist.
031d8c1
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.
I also didn’t see the point of this code. Originally I fixed this by removing that code, and this worked with no problems at all in all of my projects. I was going to submit this as the patch at first, but when I wrote the test for it, it failed some other test. I put it back in and changed it to the patch I submitted and then all the tests passed. I didn’t feel like figuring out why that other test was failing at the time. I probably should have recorded which one it was. But you can probably figure it out by deleting the code and running the tests.
031d8c1
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.
Azimux – would you mind re-finding what broke?
The reason I added this was because the patch came with a test that indeed failed, and I saw the absolute path directory being created. So, I was happy to apply the fix, given it passed the tests.
In general, I’m not hugely happy with the implementation of this whole chunk of the plugin. I would welcome a cleaner, clearer rewrite of this that we can merge back in.