Giter Site home page Giter Site logo

filecache-ruby's Introduction

filecache

Gem Version

FileCache is a file-based caching library for Ruby.

Install

gem install filecache

or

gem 'filecache'

Usage

The following code will create a cache called my-cache rooted at /tmp/caches with an expiry time of 30 seconds, and a file hierarchy three directories deep.

require 'filecache'

cache = FileCache.new("my-cache", "/tmp/caches", 30, 3)
cache.set("key", "value")
puts(cache.get("key")) # "value"
sleep 30
puts(cache.get("key")) # nil
cache.get_or_set("key") { 1 } # 1
cache.get_or_set("key") { 2 } # 1 (cached value is returned, block is not executed)

Thanks

Thanks to Simon Whitaker who created this ruby gem.

filecache-ruby's People

Contributors

leighmcculloch avatar simonwhitaker avatar splaspood avatar ecoologic avatar

Stargazers

Adam Hallett avatar Dimitri Arrigoni avatar Mitch VanDuyn avatar Evgeniy Fateev avatar Christian Pelczarski avatar Mateusz Konieczny avatar nick avatar Christian Genco avatar Naoto Yokoyama avatar Tong Zhang avatar Danny Ben Shitrit avatar Jan Wedekind avatar Brian Egge avatar Denys Yahofarov avatar  avatar

Watchers

 avatar Victor Maslov avatar  avatar

filecache-ruby's Issues

New release

It would be helpful to have a new release, since several deprecated methods that were fixed in master no longer exist in ruby 3.2.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.