Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cachify

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cachify

  • 0.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Cachify

This is an extract from the Upton parser project. This serves as a drop-in replacement for all ye download-cache-reading needs.

Installation

Add this line to your application's Gemfile:

gem 'cachify'

And then execute:

$ bundle

Or install it yourself as:

$ gem install cachify

Usage

The primary interface is the Cachify::Downloader class. This takes three paramters: a URI, a cache enable/disable option, and a cache location.

options

  • URI: For now, only get requests work properly since the library internally uses open-uri for the fetching part. You can encode the URL as per your requirement.

  • Cache enable/disable: This takes a truthy or falsy value. True-ish if you want caching and false-ish if you don't want it.

  • Cache location: This is the cache location. By default, this is set to Dir.tmpdir/cachify.

    Checks if a cache is present. If not, the cache is created,

    the file is downloaded and is saved in the cache and is read.

    Cachify::Downloader.new("http://www.example.com").get

    Ignores the cache and downloads the url for every call to #get

    Cachify::Downloader.new("http://www.example.com", :cache => false).get

    Ignores the cache and downloads the url for every call and saves

    the cache to the "cache" folder in the same directory

    Cachify::Downloader.new("http://www.example.com", :cache => false, :cache_location => "./cache").get

Todo

  1. #get reads the whole file. Ideally, this should just save the file in the cache or memory. A #read method should read the file contents.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

FAQs

Package last updated on 07 Aug 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc