/[pupa]/ruby-cache/README.rd
ViewVC logotype

Diff of /ruby-cache/README.rd

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.1.1 by okuji, Fri Aug 23 05:27:42 2002 UTC revision 1.2 by okuji, Fri Nov 22 10:32:31 2002 UTC
# Line 1  Line 1 
1  =begin  =begin
2  = Ruby/Cache 0.1  = Ruby/Cache 0.2
3  == What is Ruby/Cache  == What is Ruby/Cache
4    
5  Ruby/Cache is a library for caching objects based on the LRU algorithm  Ruby/Cache is a library for caching objects based on the LRU algorithm
6  for Ruby. The official page is  for Ruby. The official page is
7  ((<URL:http://www.freesoftware.fsf.org/pupa/ruby-cache.html>)).  ((<URL:http://www.nongnu.org/pupa/ruby-cache.html>)).
8    
9  == How to install  == How to install
10    
# Line 16  for Ruby. The official page is Line 16  for Ruby. The official page is
16    
17  Here is a simple usage:  Here is a simple usage:
18    
19     require 'cache'
20    
21   cache = Cache.new   cache = Cache.new
22   cache['foo'] = 'bar'   cache['foo'] = 'bar'
23   p cache['foo']   p cache['foo']
# Line 36  This is a more complicated example: Line 38  This is a more complicated example:
38   while true   while true
39     puts 'Input an integer: '     puts 'Input an integer: '
40     i = gets.to_i     i = gets.to_i
41     unless cache.cached?(i)     puts cache.fetch(i) { generate_prime_greater_than(i) }
      cache[i] = generate_prime_greater_than(i)  
    end  
    puts cache[i]  
42   end   end
43    
 == Reference  
   
 Not written yet.  
   
44  == License  == License
45    
46  You may redistribute it and/or modify it under the same term as Ruby's.  You may redistribute it and/or modify it under the same term as Ruby's.

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26