Class: Viiite::BDB
- Inherits:
-
Object
- Object
- Viiite::BDB
- Includes:
- Utils
- Defined in:
- lib/viiite/bdb.rb,
lib/viiite/bdb/utils.rb,
lib/viiite/bdb/cached.rb,
lib/viiite/bdb/immediate.rb
Defined Under Namespace
Modules: Utils Classes: Cached, Immediate
Constant Summary collapse
- DEFAULT_OPTIONS =
{ :folder => "benchmarks", :cache => true, :cache_mode => "w", :pattern => "**/*.rb", }
Class Method Summary collapse
Methods included from Utils
#bench_file, #replace_extension
Class Method Details
.new(options = {}) ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/viiite/bdb.rb', line 16 def self.new( = {}) = DEFAULT_OPTIONS.merge() folder = [:folder] bdb = BDB::Immediate.new(folder, [:pattern]) if cache = [:cache] cache = File.join(folder, '.cache') unless cache.is_a?(String) bdb = BDB::Cached.new(bdb, cache, [:cache_mode]) end bdb end |