Module: Kvom

Defined in:
lib/kvom.rb,
lib/kvom/model/base.rb,
lib/kvom/adapter/base.rb,
lib/kvom/storage/base.rb,
lib/kvom/lib/json_value.rb,
lib/kvom/model_identity.rb,
lib/kvom/adapter/document.rb,
lib/kvom/adapter/attributes.rb,
lib/kvom/storage/s3_storage.rb,
lib/kvom/adapter/dynamodb_adapter.rb,
lib/kvom/adapter/dynamodb_document.rb,
lib/kvom/storage/cache_with_prefix.rb,
lib/kvom/adapter/filesystem_adapter.rb,
lib/kvom/adapter/filesystem_document.rb,
lib/kvom/storage/file_system_storage.rb

Defined Under Namespace

Modules: Adapter, Lib, Model, ModelIdentity, Storage Classes: Conflict, NotFound, WriteConflict

Class Method Summary collapse

Class Method Details

.setup_autoload(mod, mod_source) ⇒ Object

:nodoc:



3
4
5
6
7
8
9
10
11
# File 'lib/kvom.rb', line 3

def self.setup_autoload(mod, mod_source)
  @base_dir ||= File.expand_path("..", __FILE__).to_s + "/"
  dir = File.expand_path(".", mod_source)[0..-4]
  pattern = "#{dir}/*.rb"
  Dir.glob(pattern).each do |file|
    const = file[dir.length..-4].gsub(%r{[_/](.)}) {$1.upcase}
    mod.autoload const.to_sym, file[@base_dir.length..-1]
  end
end