# Please move me to a proper location class String def property_name underscore.gsub('/','__').gsub('::','__') end end # Guard on a sentinel that only this file defines (SimplyBased::VERSION), not on # the bare SimplyBased constant. A plugin gem (e.g. simply_couch-couchbase) may # open `module SimplyBased` for its own version/namespace before this file loads; # guarding on the bare module would then skip the library's whole initialization. unless defined?(SimplyBased::VERSION) $:<<(File.expand_path(File.dirname(__FILE__) + "/lib")) require 'simply_based/instance_methods' require 'simply_based/class_methods_base' module SimplyBased VERSION = '0.1.0' class Error < RuntimeError; end class RecordNotFound < RuntimeError; end class NotImplementedError < RuntimeError; end class ModelNotInstantiatedError < RuntimeError; end class NotFound < RuntimeError; end # Raised when a declared view carries options the N1QL translation cannot # honour (e.g. :conditions / :emit_value / list functions). Failing loudly # beats silently returning unfiltered results. class UnsupportedView < Error; end # No-op retained for source compatibility with SimplyCouch. SimplyBased # never interpolates values into JavaScript views — queries are N1QL with # bound parameters — so there is nothing to sanitize. Returns its tokens. def self.assert_safe_view_token!(*tokens) tokens end end require 'simply_based/document_codec' require 'simply_based/database_config' require 'simply_based/model' require 'simply_based/store' require 'simply_based/redis' require 'core_ext/time' require 'core_ext/date' end class SimplyBased::Conflict < StandardError; end