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

Implement a caching mechanism #21

Closed
wants to merge 3 commits into from
Closed

Conversation

gnustavo
Copy link

This commit adds two attributes to the wget::fetch class: cache_dir and
cache_file. With them we implement a caching mechanism using the
timestamping (-N) and directory prefix (-P) wget options.

This intermediary cache can be very useful in a Vagrant environment in
which we map a directory of the VM (e.g. /var/cache/wget) to a directory
in the host (probably using the vagrant-cachier plugin). This way, even
after a snapshot rollback we do not have to download things again.

This commit adds two attributes to the wget::fetch class: cache_dir and
cache_file. With them we implement a caching mechanism using the
timestamping (-N) and directory prefix (-P) wget options.

This intermediary cache can be very useful in a Vagrant environment in
which we map a directory of the VM (e.g. /var/cache/wget) to a directory
in the host (probably using the vagrant-cachier plugin). This way, even
after a snapshot rollback we do not have to download things again.
@carlossg
Copy link
Member

Thanks! could you add some specs to spec/defines/fetch_spec.rb?

@gnustavo
Copy link
Author

I've never written for rpec, so I'm not sure I did it right. I could manage to have the new specs go green, though. Can you check them out, please?

@carlossg
Copy link
Member

Merged, thanks!

@carlossg carlossg closed this Mar 31, 2014
@gnustavo gnustavo deleted the cache branch March 31, 2014 12:00
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