-
Notifications
You must be signed in to change notification settings - Fork 109
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
added cache_dir and cache_workers options to cache results #115
Conversation
Hi Gregory, sorry for the wait and thank you for contribution! |
Hi, I rebased the branch onto the master branch. |
ImagePath::Optimized.new(result, original) | ||
return unless optimized | ||
|
||
@cache.write(optimized, original) |
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 would switch the order of the arguments as original works as a key
@options_by_format = Hash[workers_by_format.map do |k, v| | ||
[k, Marshal.dump(v.map(&:inspect))] | ||
end] | ||
@workers_by_format = Hash[workers_by_format.map do |k, v| |
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.
Name @workers_by_format
is confusing as inside are bins and not workers
Hi Gregory, I am sorry for such a long wait. Few things to discuss: |
I followed every single remark you made except using By now, files are stored in I made a separate commit. Once reviewed I suggest I squash the two commits before force pushing the branch one last time. |
Well CI has errors unrelated to my changes, can you have a look?
|
Hi Ivan, when do you think we can roll another round of review for this PR? |
Hi Gregory, thanks for poking me about this.
cached = @cache_dir / digest(original)
return unless cached.exist? instead of cached = File.join(@cache_dir, digest(original))
return unless File.exist?(cached) Also |
Hi Ivan, Here are my answers:
|
|
84ce463
to
5524362
Compare
I implemented the changes discussed so far. Note that the symlink only serves the purpose of avoiding going through workers again, but |
@@ -204,6 +204,19 @@ def wrap_regex(width) | |||
end | |||
|
|||
op.separator nil | |||
op.separator ' Caching:' |
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 move this section higher, after main options and before disabling workers
b9ad8f7
to
fcd86a7
Compare
Please ignore AppVeyor failing, I will try to test how far is |
Yep will do. I noticed it's not configured yet. |
Few last points about tests:
|
I'll look into it. I don't know RSpec well though so I'm not sure about what shared test groups are and how to use them |
Shared examples in short: shared_examples "does something" do
it … do
end
end
describe … do
let …
before …
it_behaves_like "does something"
end |
Yep I finally found my way through it this afternoon :) |
Hi Gregory, can you please rebase the branch on master, sqash-split to one or more atomic/logical commits and check if it works on appveyor? |
I'll extract capabilities checkers for easy reusing, so failing windows checks can be ignored |
Have a look at |
I updated |
What do you prefer between keeping the 10 commits from the For the record, tests and rubocop are all good in every of the 10 commits. I let you decide how you prefer history to look like |
Those are development commits, so better 1 commit unless you can and would like to split them into several logical separate ones. |
Is it important to link the PR? I linked #83. By the way, why are you using |
Already not, as important, as you've just linked them by mentioning ;) I already wanted to check it for some time and thank you for pushing me to do it :), but unfortunately it works only in comments/descriptions and some other stuff, but not in markdown files: |
Oh indeed you're right |
Thank you for finishing this long PR, I'll release a new version soon |
You're welcome. Thanks for the review and the suggestions. That was nice. |
💥
implemented #83