diff --git a/lib/tarantool16.rb b/lib/tarantool16.rb index 0c93bc4..564dcaa 100644 --- a/lib/tarantool16.rb +++ b/lib/tarantool16.rb @@ -2,14 +2,14 @@ require "tarantool16/db" module Tarantool16 - autoload :BlockingDB, 'tarantool16/blocking_db' + autoload :DumbDB, 'tarantool16/dumb_db' def self.new(opts = {}) opts = opts.dup hosts = opts[:host] - type = opts[:type] && opts[:type].to_s || 'blocking' + type = opts[:type] && opts[:type].to_s || 'dumb' case type - when 'blocking' - BlockingDB.new hosts, opts + when 'dumb' + DumbDB.new hosts, opts else raise "Unknown DB type" end diff --git a/lib/tarantool16/connection/blocking.rb b/lib/tarantool16/connection/dumb.rb similarity index 98% rename from lib/tarantool16/connection/blocking.rb rename to lib/tarantool16/connection/dumb.rb index f27c91c..42161ea 100644 --- a/lib/tarantool16/connection/blocking.rb +++ b/lib/tarantool16/connection/dumb.rb @@ -2,7 +2,7 @@ require_relative 'common' module Tarantool16 module Connection - class Blocking + class Dumb include Common def initialize(host, opts = {}) diff --git a/lib/tarantool16/blocking_db.rb b/lib/tarantool16/dumb_db.rb similarity index 94% rename from lib/tarantool16/blocking_db.rb rename to lib/tarantool16/dumb_db.rb index ddeb575..bd4ad36 100644 --- a/lib/tarantool16/blocking_db.rb +++ b/lib/tarantool16/dumb_db.rb @@ -1,9 +1,9 @@ require_relative 'db' -require_relative 'connection/blocking' +require_relative 'connection/dumb' module Tarantool16 - class BlockingDB < DB - Connection = Tarantool16::Connection::Blocking + class DumbDB < DB + Connection = Tarantool16::Connection::Dumb RETURN_OR_RAISE = lambda{|r| raise r.error unless r.ok?