From 40f5510bbbac5c1fe0297082a33ed25af7947a82 Mon Sep 17 00:00:00 2001 From: ArnaudJab Date: Fri, 25 Mar 2022 15:33:16 +0000 Subject: [PATCH 1/8] rename files to mt-* --- .gitignore | 2 +- README.md | 6 +- Rakefile | 10 +- ext/Rakefile | 2 +- lib/libcouchbase.rb | 40 ------ lib/mt-libcouchbase.rb | 40 ++++++ .../bucket.rb | 74 +++++------ .../callbacks.rb | 2 +- .../connection.rb | 8 +- .../design_docs.rb | 2 +- .../error.rb | 12 +- .../ext/mt-libcouchbase.rb} | 122 +++++++++--------- .../ext/mt-libcouchbase}/cmdbase.rb | 2 +- .../ext/mt-libcouchbase}/cmdcounter.rb | 2 +- .../ext/mt-libcouchbase}/cmdendure.rb | 2 +- .../ext/mt-libcouchbase}/cmdfts.rb | 2 +- .../ext/mt-libcouchbase}/cmdget.rb | 2 +- .../ext/mt-libcouchbase}/cmdgetreplica.rb | 2 +- .../ext/mt-libcouchbase}/cmdhttp.rb | 2 +- .../ext/mt-libcouchbase}/cmdn1ql.rb | 2 +- .../ext/mt-libcouchbase}/cmdobseqno.rb | 2 +- .../ext/mt-libcouchbase}/cmdobserve.rb | 2 +- .../ext/mt-libcouchbase}/cmdstore.rb | 2 +- .../ext/mt-libcouchbase}/cmdstoredur.rb | 2 +- .../ext/mt-libcouchbase}/cmdsubdoc.rb | 2 +- .../ext/mt-libcouchbase}/cmdverbosity.rb | 2 +- .../ext/mt-libcouchbase}/cmdviewquery.rb | 2 +- .../ext/mt-libcouchbase}/contigbuf.rb | 2 +- .../ext/mt-libcouchbase}/create_st.rb | 2 +- .../ext/mt-libcouchbase}/create_st0.rb | 2 +- .../ext/mt-libcouchbase}/create_st1.rb | 2 +- .../ext/mt-libcouchbase}/create_st2.rb | 2 +- .../ext/mt-libcouchbase}/create_st3.rb | 2 +- .../ext/mt-libcouchbase}/crst_u.rb | 2 +- .../mt-libcouchbase}/durability_opts_st_v.rb | 2 +- .../ext/mt-libcouchbase}/durability_opts_t.rb | 2 +- .../ext/mt-libcouchbase}/durabilityopt_sv0.rb | 2 +- .../ext/mt-libcouchbase}/enums.rb | 4 +- .../ext/mt-libcouchbase}/fragbuf.rb | 2 +- .../ext/mt-libcouchbase}/ftshandle.rb | 2 +- .../ext/mt-libcouchbase}/histogram.rb | 10 +- .../ext/mt-libcouchbase}/http_request_t.rb | 2 +- .../ext/mt-libcouchbase}/keybuf.rb | 2 +- .../ext/mt-libcouchbase}/multicmd_ctx.rb | 2 +- .../ext/mt-libcouchbase}/mutation_token.rb | 2 +- .../ext/mt-libcouchbase}/n1qlhandle.rb | 2 +- .../ext/mt-libcouchbase}/n1qlparams.rb | 2 +- .../ext/mt-libcouchbase}/respbase.rb | 2 +- .../ext/mt-libcouchbase}/respcounter.rb | 2 +- .../ext/mt-libcouchbase}/respendure.rb | 2 +- .../ext/mt-libcouchbase}/respfts.rb | 2 +- .../ext/mt-libcouchbase}/respget.rb | 2 +- .../ext/mt-libcouchbase}/resphttp.rb | 2 +- .../ext/mt-libcouchbase}/respmcversion.rb | 2 +- .../ext/mt-libcouchbase}/respn1ql.rb | 2 +- .../ext/mt-libcouchbase}/respobseqno.rb | 2 +- .../ext/mt-libcouchbase}/respobserve.rb | 2 +- .../ext/mt-libcouchbase}/respserverbase.rb | 2 +- .../ext/mt-libcouchbase}/respstats.rb | 2 +- .../ext/mt-libcouchbase}/respstore.rb | 2 +- .../ext/mt-libcouchbase}/respstoredur.rb | 2 +- .../ext/mt-libcouchbase}/respsubdoc.rb | 2 +- .../ext/mt-libcouchbase}/respviewquery.rb | 2 +- .../ext/mt-libcouchbase}/sdentry.rb | 2 +- .../ext/mt-libcouchbase}/sdspec.rb | 2 +- .../ext/mt-libcouchbase}/t.rb | 2 +- .../ext/mt-libcouchbase}/valbuf.rb | 2 +- .../ext/mt-libcouchbase}/valbuf_u_buf.rb | 2 +- .../ext/mt-libcouchbase}/viewhandle.rb | 2 +- .../ext/mt-libcouchbase_libuv.rb} | 8 +- .../ext/tasks.rb | 4 +- lib/{libcouchbase => mt-libcouchbase}/n1ql.rb | 2 +- .../query_full_text.rb | 2 +- .../query_n1ql.rb | 2 +- .../query_view.rb | 2 +- .../results_fiber.rb | 2 +- .../results_native.rb | 2 +- .../subdoc_request.rb | 14 +- .../version.rb | 2 +- ...uchbase.gemspec => mt-libcouchbase.gemspec | 16 +-- spec/bucket_spec.rb | 16 +-- spec/connection_spec.rb | 36 +++--- spec/design_docs_spec.rb | 6 +- spec/error_spec.rb | 20 +-- spec/fts_spec.rb | 6 +- spec/n1ql_spec.rb | 12 +- spec/results_libuv_spec.rb | 10 +- spec/results_native_spec.rb | 12 +- spec/subdoc_spec.rb | 10 +- spec/view_spec.rb | 12 +- 90 files changed, 320 insertions(+), 320 deletions(-) delete mode 100644 lib/libcouchbase.rb create mode 100644 lib/mt-libcouchbase.rb rename lib/{libcouchbase => mt-libcouchbase}/bucket.rb (91%) rename lib/{libcouchbase => mt-libcouchbase}/callbacks.rb (99%) rename lib/{libcouchbase => mt-libcouchbase}/connection.rb (99%) rename lib/{libcouchbase => mt-libcouchbase}/design_docs.rb (99%) rename lib/{libcouchbase => mt-libcouchbase}/error.rb (87%) rename lib/{libcouchbase/ext/libcouchbase.rb => mt-libcouchbase/ext/mt-libcouchbase.rb} (87%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/cmdbase.rb (93%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/cmdcounter.rb (97%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/cmdendure.rb (94%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/cmdfts.rb (96%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/cmdget.rb (96%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/cmdgetreplica.rb (98%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/cmdhttp.rb (98%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/cmdn1ql.rb (98%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/cmdobseqno.rb (96%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/cmdobserve.rb (96%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/cmdstore.rb (97%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/cmdstoredur.rb (97%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/cmdsubdoc.rb (98%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/cmdverbosity.rb (95%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/cmdviewquery.rb (98%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/contigbuf.rb (89%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/create_st.rb (93%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/create_st0.rb (93%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/create_st1.rb (94%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/create_st2.rb (95%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/create_st3.rb (95%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/crst_u.rb (92%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/durability_opts_st_v.rb (86%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/durability_opts_t.rb (89%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/durabilityopt_sv0.rb (99%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/enums.rb (99%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/fragbuf.rb (94%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/ftshandle.rb (76%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/histogram.rb (67%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/http_request_t.rb (77%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/keybuf.rb (95%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/multicmd_ctx.rb (97%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/mutation_token.rb (92%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/n1qlhandle.rb (76%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/n1qlparams.rb (76%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/respbase.rb (94%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/respcounter.rb (95%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/respendure.rb (98%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/respfts.rb (97%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/respget.rb (97%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/resphttp.rb (98%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/respmcversion.rb (96%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/respn1ql.rb (97%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/respobseqno.rb (98%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/respobserve.rb (97%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/respserverbase.rb (95%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/respstats.rb (96%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/respstore.rb (95%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/respstoredur.rb (97%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/respsubdoc.rb (96%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/respviewquery.rb (98%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/sdentry.rb (95%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/sdspec.rb (97%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/t.rb (75%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/valbuf.rb (95%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/valbuf_u_buf.rb (89%) rename lib/{libcouchbase/ext/libcouchbase => mt-libcouchbase/ext/mt-libcouchbase}/viewhandle.rb (76%) rename lib/{libcouchbase/ext/libcouchbase_libuv.rb => mt-libcouchbase/ext/mt-libcouchbase_libuv.rb} (63%) rename lib/{libcouchbase => mt-libcouchbase}/ext/tasks.rb (89%) rename lib/{libcouchbase => mt-libcouchbase}/n1ql.rb (99%) rename lib/{libcouchbase => mt-libcouchbase}/query_full_text.rb (99%) rename lib/{libcouchbase => mt-libcouchbase}/query_n1ql.rb (99%) rename lib/{libcouchbase => mt-libcouchbase}/query_view.rb (99%) rename lib/{libcouchbase => mt-libcouchbase}/results_fiber.rb (99%) rename lib/{libcouchbase => mt-libcouchbase}/results_native.rb (99%) rename lib/{libcouchbase => mt-libcouchbase}/subdoc_request.rb (88%) rename lib/{libcouchbase => mt-libcouchbase}/version.rb (78%) rename libcouchbase.gemspec => mt-libcouchbase.gemspec (81%) diff --git a/.gitignore b/.gitignore index 12c6492..38a75f6 100644 --- a/.gitignore +++ b/.gitignore @@ -14,7 +14,7 @@ Gemfile.lock .yardoc bin Gemfile-custom - +vendor *.gem *.dll diff --git a/README.md b/README.md index e633c8a..fb83b6f 100644 --- a/README.md +++ b/README.md @@ -79,17 +79,17 @@ The client will automatically adjust configuration when the cluster rebalances i By default the client will connect to the default bucket on localhost. ```ruby -bucket = Libcouchbase::Bucket.new +bucket = MTLibcouchbase::Bucket.new ``` To connect to other buckets, other than the default ```ruby # Same as Libcouchbase::Bucket.new -bucket = Libcouchbase::Bucket.new(hosts: '127.0.0.1', bucket: 'default', password: nil) +bucket = MTLibcouchbase::Bucket.new(hosts: '127.0.0.1', bucket: 'default', password: nil) # To connect to other buckets, you can also specify multiple hosts: -bucket = Libcouchbase::Bucket.new(hosts: ['cb1.org', 'cb2.org'], bucket: 'app_data', password: 'goodluck') +bucket = MTLibcouchbase::Bucket.new(hosts: ['cb1.org', 'cb2.org'], bucket: 'app_data', password: 'goodluck') ``` Connections can be configured to use `:quiet` mode. This mean it won't raise diff --git a/Rakefile b/Rakefile index a117977..2e9881a 100644 --- a/Rakefile +++ b/Rakefile @@ -3,7 +3,7 @@ require 'rspec/core/rake_task' # testing framework require 'yard' # yard documentation require 'ffi' # loads the extension require 'rake/clean' # for the :clobber rake task -require File.expand_path('../lib/libcouchbase/ext/tasks', __FILE__) # platform specific rake tasks used by compile +require File.expand_path('../lib/mt-libcouchbase/ext/tasks', __FILE__) # platform specific rake tasks used by compile @@ -25,7 +25,7 @@ YARD::Rake::YardocTask.new do |t| end -desc 'Compile libcouchbase from submodule' +desc 'Compile mt-libcouchbase from submodule' if FFI::Platform.windows? task :compile do puts "See windows_build.md for build instructions" @@ -56,9 +56,9 @@ task :generate_bindings do # respn1ql.rb -> row FFI::Gen.generate( - module_name: "Libcouchbase::Ext", - ffi_lib: "libcouchbase", - require_path: "libcouchbase/ext/libcouchbase", + module_name: "MTLibcouchbase::Ext", + ffi_lib: "mt-libcouchbase", + require_path: "mt-libcouchbase/ext/mt-libcouchbase", headers: [ "./ext/libcouchbase/include/libcouchbase/couchbase.h", "./ext/libcouchbase/include/libcouchbase/error.h", diff --git a/ext/Rakefile b/ext/Rakefile index 46640fb..6ee87e2 100644 --- a/ext/Rakefile +++ b/ext/Rakefile @@ -2,7 +2,7 @@ require 'rubygems' require 'ffi' require 'rake/clean' -require File.expand_path('../../lib/libcouchbase/ext/tasks', __FILE__) +require File.expand_path('../../lib/mt-libcouchbase/ext/tasks', __FILE__) Dir.chdir File.expand_path("../../", __FILE__) diff --git a/lib/libcouchbase.rb b/lib/libcouchbase.rb deleted file mode 100644 index 07ba2a7..0000000 --- a/lib/libcouchbase.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true, encoding: ASCII-8BIT - -require 'libuv' - -module Libcouchbase - require 'libcouchbase/ext/libcouchbase' - require 'libcouchbase/error' - require 'libcouchbase/callbacks' - require 'libcouchbase/connection' - - DefaultOpts = Struct.new(:host, :bucket, :username, :password) - Defaults = DefaultOpts.new('127.0.0.1', 'default') - - class Results - include Enumerable - - # streams results as they are returned from the database - # - # unlike other operations, such as each, the results are not stored - # for later use and are discarded as soon as possible to save memory - # - # @yieldparam [Object] value the value of the current row - def stream; end - - attr_reader :complete_result_set, :query_in_progress - attr_reader :query_completed, :metadata - end - - autoload :N1QL, 'libcouchbase/n1ql' - autoload :Bucket, 'libcouchbase/bucket' - autoload :QueryView, 'libcouchbase/query_view' - autoload :QueryN1QL, 'libcouchbase/query_n1ql' - autoload :QueryFullText, 'libcouchbase/query_full_text' - autoload :DesignDoc, 'libcouchbase/design_docs' - autoload :DesignDocs, 'libcouchbase/design_docs' - autoload :ResultsEM, 'libcouchbase/results_fiber' - autoload :ResultsLibuv, 'libcouchbase/results_fiber' - autoload :ResultsNative, 'libcouchbase/results_native' - autoload :SubdocRequest, 'libcouchbase/subdoc_request' -end diff --git a/lib/mt-libcouchbase.rb b/lib/mt-libcouchbase.rb new file mode 100644 index 0000000..c90ea4d --- /dev/null +++ b/lib/mt-libcouchbase.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true, encoding: ASCII-8BIT + +require 'libuv' + +module MTLibcouchbase + require 'mt-libcouchbase/ext/mt-libcouchbase' + require 'mt-libcouchbase/error' + require 'mt-libcouchbase/callbacks' + require 'mt-libcouchbase/connection' + + DefaultOpts = Struct.new(:host, :bucket, :username, :password) + Defaults = DefaultOpts.new('127.0.0.1', 'default') + + class Results + include Enumerable + + # streams results as they are returned from the database + # + # unlike other operations, such as each, the results are not stored + # for later use and are discarded as soon as possible to save memory + # + # @yieldparam [Object] value the value of the current row + def stream; end + + attr_reader :complete_result_set, :query_in_progress + attr_reader :query_completed, :metadata + end + + autoload :N1QL, 'mt-libcouchbase/n1ql' + autoload :Bucket, 'mt-libcouchbase/bucket' + autoload :QueryView, 'mt-libcouchbase/query_view' + autoload :QueryN1QL, 'mt-libcouchbase/query_n1ql' + autoload :QueryFullText, 'mt-libcouchbase/query_full_text' + autoload :DesignDoc, 'mt-libcouchbase/design_docs' + autoload :DesignDocs, 'mt-libcouchbase/design_docs' + autoload :ResultsEM, 'mt-libcouchbase/results_fiber' + autoload :ResultsLibuv, 'mt-libcouchbase/results_fiber' + autoload :ResultsNative, 'mt-libcouchbase/results_native' + autoload :SubdocRequest, 'mt-libcouchbase/subdoc_request' +end diff --git a/lib/libcouchbase/bucket.rb b/lib/mt-libcouchbase/bucket.rb similarity index 91% rename from lib/libcouchbase/bucket.rb rename to lib/mt-libcouchbase/bucket.rb index 6177073..30f5d2b 100644 --- a/lib/libcouchbase/bucket.rb +++ b/lib/mt-libcouchbase/bucket.rb @@ -4,7 +4,7 @@ require 'thread' -module Libcouchbase +module MTLibcouchbase class Bucket extend Forwardable @@ -43,7 +43,7 @@ def initialize(**options) # @param options [Hash] Options for operation. # @option options [Integer] :lock time to lock this key for. Max time 30s # @option options [true, false] :extended (false) If set to +true+, the - # operation will return a +Libcouchbase::Result+, otherwise (by default) + # operation will return a +MTLibcouchbase::Result+, otherwise (by default) # it returns just the value. # @option options [true, false] :quiet (self.quiet) If set to +true+, the # operation won't raise error for missing key, it will return +nil+. @@ -51,13 +51,13 @@ def initialize(**options) # @option options [true, false] :assemble_hash (false) Assemble Hash for # results. # - # @return [Object, Array, Hash, Libcouchbase::Result] the value(s) + # @return [Object, Array, Hash, MTLibcouchbase::Result] the value(s) # - # @raise [Libcouchbase::Error::KeyExists] if the key already exists on the server + # @raise [MTLibcouchbase::Error::KeyExists] if the key already exists on the server # with a different CAS value to that provided # @raise [Libouchbase::Error::Timedout] if timeout interval for observe exceeds # @raise [Libouchbase::Error::NetworkError] if there was a communication issue - # @raise [Libcouchbase::Error::KeyNotFound] if the key doesn't exists + # @raise [MTLibcouchbase::Error::KeyNotFound] if the key doesn't exists # # @example Get single value in quiet mode (the default) # c.get("foo") #=> the associated value or nil @@ -66,7 +66,7 @@ def initialize(**options) # c["foo"] #=> the associated value or nil # # @example Get single value in verbose mode - # c.get("missing-foo", quiet: false) #=> raises Libcouchbase::Error::NotFound + # c.get("missing-foo", quiet: false) #=> raises MTLibcouchbase::Error::NotFound # # @example Get multiple keys # c.get("foo", "bar", "baz") #=> [val1, val2, val3] @@ -99,7 +99,7 @@ def get(key, *keys, extended: false, async: false, quiet: @quiet, assemble_hash: if quiet promise = promise.catch { |err| - if err.is_a? Libcouchbase::Error::KeyNotFound + if err.is_a? MTLibcouchbase::Error::KeyNotFound nil else ::Libuv::Q.reject(@reactor, err) @@ -128,7 +128,7 @@ def get(key, *keys, extended: false, async: false, quiet: @quiet, assemble_hash: if quiet promises.map! { |prom| prom.catch { |err| - if err.is_a? Libcouchbase::Error::KeyNotFound + if err.is_a? MTLibcouchbase::Error::KeyNotFound nil else ::Libuv::Q.reject(@reactor, err) @@ -190,9 +190,9 @@ def fetch(key, value = nil, async: false, **opts) # @option options [Integer] :replicate_to replicate to a number of nodes before # returning a result. Use -1 to replicate to the maximum number of nodes # - # @return [Libcouchbase::Result] this includes the CAS value of the object. + # @return [MTLibcouchbase::Result] this includes the CAS value of the object. # - # @raise [Libcouchbase::Error::KeyExists] if the key already exists on the server + # @raise [MTLibcouchbase::Error::KeyExists] if the key already exists on the server # @raise [Libouchbase::Error::Timedout] if timeout interval for observe exceeds # @raise [Libouchbase::Error::NetworkError] if there was a communication issue # @@ -231,9 +231,9 @@ def add(key, value, async: false, **opts) # @option options [Integer] :replicate_to replicate to a number of nodes before # returning a result. Use -1 to replicate to the maximum number of nodes # - # @return [Libcouchbase::Result] this includes the CAS value of the object. + # @return [MTLibcouchbase::Result] this includes the CAS value of the object. # - # @raise [Libcouchbase::Error::KeyExists] if the key already exists on the server + # @raise [MTLibcouchbase::Error::KeyExists] if the key already exists on the server # with a different CAS value to that provided # @raise [Libouchbase::Error::Timedout] if timeout interval for observe exceeds # @raise [Libouchbase::Error::NetworkError] if there was a communication issue @@ -280,13 +280,13 @@ def set(key, value, async: false, **opts) # @option options [Integer] :replicate_to replicate to a number of nodes before # returning a result. Use -1 to replicate to the maximum number of nodes # - # @return [Libcouchbase::Result] this includes the CAS value of the object. + # @return [MTLibcouchbase::Result] this includes the CAS value of the object. # - # @raise [Libcouchbase::Error::KeyExists] if the key already exists on the server + # @raise [MTLibcouchbase::Error::KeyExists] if the key already exists on the server # with a different CAS value to that provided # @raise [Libouchbase::Error::Timedout] if timeout interval for observe exceeds # @raise [Libouchbase::Error::NetworkError] if there was a communication issue - # @raise [Libcouchbase::Error::KeyNotFound] if the key doesn't exists + # @raise [MTLibcouchbase::Error::KeyNotFound] if the key doesn't exists # # @example Store the key which will be expired in 2 seconds using relative TTL. # c.replace("foo", "bar", expire_in: 2) @@ -326,15 +326,15 @@ def replace(key, value, async: false, **opts) # @option options [Integer, Time] :expire_at Unix epoc or time at which a key # should expire # @option options [true, false] :extended (false) If set to +true+, the - # operation will return a +Libcouchbase::Result+, otherwise (by default) + # operation will return a +MTLibcouchbase::Result+, otherwise (by default) # it returns just the value. # # @return [Integer] the actual value of the key. # # @raise [Libouchbase::Error::Timedout] if timeout interval for observe exceeds # @raise [Libouchbase::Error::NetworkError] if there was a communication issue - # @raise [Libcouchbase::Error::KeyNotFound] if the key doesn't exists - # @raise [Libcouchbase::Error::DeltaBadval] if the key contains non-numeric value + # @raise [MTLibcouchbase::Error::KeyNotFound] if the key doesn't exists + # @raise [MTLibcouchbase::Error::DeltaBadval] if the key contains non-numeric value # # @example Increment key by one # c.incr(:foo) @@ -384,11 +384,11 @@ def decr(key, by = 1, **opts) # # @return [true, false] the result of the operation. # - # @raise [Libcouchbase::Error::KeyExists] if the key already exists on the server + # @raise [MTLibcouchbase::Error::KeyExists] if the key already exists on the server # with a different CAS value to that provided # @raise [Libouchbase::Error::Timedout] if timeout interval for observe exceeds # @raise [Libouchbase::Error::NetworkError] if there was a communication issue - # @raise [Libcouchbase::Error::KeyNotFound] if the key doesn't exists + # @raise [MTLibcouchbase::Error::KeyNotFound] if the key doesn't exists # # @example Delete the key in quiet mode (default) # c.set("foo", "bar") @@ -399,17 +399,17 @@ def decr(key, by = 1, **opts) # c.set("foo", "bar") # c.delete("foo", quiet: false) #=> true # c.delete("foo", quiet: true) #=> nil (default behaviour) - # c.delete("foo", quiet: false) #=> will raise Libcouchbase::Error::KeyNotFound + # c.delete("foo", quiet: false) #=> will raise MTLibcouchbase::Error::KeyNotFound # # @example Delete the key with version check - # res = c.set("foo", "bar") #=> #0}> - # c.delete("foo", cas: 123456) #=> will raise Libcouchbase::Error::KeyExists + # res = c.set("foo", "bar") #=> #0}> + # c.delete("foo", cas: 123456) #=> will raise MTLibcouchbase::Error::KeyExists # c.delete("foo", cas: res.cas) #=> true def delete(key, async: false, quiet: true, **opts) promise = @connection.remove(key, **opts).then { true } if quiet promise = promise.catch { |error| - if error.is_a? Libcouchbase::Error::KeyNotFound + if error.is_a? MTLibcouchbase::Error::KeyNotFound false else ::Libuv::Q.reject(@reactor, error) @@ -423,10 +423,10 @@ def delete(key, async: false, quiet: true, **opts) # # @see http://docs.couchbase.com/admin/admin/REST/rest-bucket-flush.html # - # @raise [Libcouchbase::Error::HttpError] in case of an error is + # @raise [MTLibcouchbase::Error::HttpError] in case of an error is # encountered. # - # @return [Libcouchbase::Response] + # @return [MTLibcouchbase::Response] # # @example Simple flush the bucket # c.flush @@ -445,7 +445,7 @@ def touch(key, async: false, **opts) # # @param [String, Symbol] key # - # @yieldparam [Libcouchbase::SubdocRequest] the subdocument request object used to define the request + # @yieldparam [MTLibcouchbase::SubdocRequest] the subdocument request object used to define the request # # @example Perform a subdocument operation using a block # c.subdoc(:foo) { |subdoc| @@ -483,7 +483,7 @@ def subdoc_execute!(sd, extended: false, async: false, **opts) # Fetch design docs stored in current bucket # - # @return [Libcouchbase::DesignDocs] + # @return [MTLibcouchbase::DesignDocs] def design_docs(**opts) DesignDocs.new(self, @connection, proc { |promise, async| result(promise, async) }, **opts) end @@ -492,7 +492,7 @@ def design_docs(**opts) # # Results are lazily loaded when an operation is performed on the enum # - # @return [Libcouchbase::Results] + # @return [MTLibcouchbase::Results] def view(design, view, include_docs: true, is_spatial: false, **opts, &row_modifier) view = @connection.query_view(design, view, **ViewDefaults.merge(opts)) view.include_docs = include_docs @@ -517,7 +517,7 @@ def view(design, view, include_docs: true, is_spatial: false, **opts, &row_modif # # Results are lazily loaded when an operation is performed on the enum # - # @return [Libcouchbase::Results] + # @return [MTLibcouchbase::Results] def full_text_search(index, query, **opts, &row_modifier) if query.is_a? Hash opts[:query] = query @@ -544,7 +544,7 @@ def full_text_search(index, query, **opts, &row_modifier) # Returns an n1ql query builder. # - # @return [Libcouchbase::N1QL] + # @return [MTLibcouchbase::N1QL] def n1ql(**options) N1QL.new(self, **options) end @@ -601,10 +601,10 @@ def delete_design_doc(id, rev = nil, async: false) # Reads a key's value from the server and yields it to a block. Replaces # the key's value with the result of the block as long as the key hasn't # been updated in the meantime, otherwise raises - # {Libcouchbase::Error::KeyExists}. + # {MTLibcouchbase::Error::KeyExists}. # # Setting the +:retry+ option to a positive number will cause this method - # to rescue the {Libcouchbase::Error::KeyExists} error that happens when + # to rescue the {MTLibcouchbase::Error::KeyExists} error that happens when # an update collision is detected, and automatically get a fresh copy # of the value and retry the block. This will repeat as long as there # continues to be conflicts, up to the maximum number of retries specified. @@ -630,7 +630,7 @@ def delete_design_doc(id, rev = nil, async: false) # end # c.get(:foo) #=> {bar: 1, baz: 2} # - # @return [Libcouchbase::Response] the transaction details including the new CAS + # @return [MTLibcouchbase::Response] the transaction details including the new CAS def compare_and_swap(key, **opts) retries = opts.delete(:retry) || 0 begin @@ -639,7 +639,7 @@ def compare_and_swap(key, **opts) opts[:cas] = current.cas set(key, new_value, **opts) - rescue Libcouchbase::Error::KeyExists + rescue MTLibcouchbase::Error::KeyExists retries -= 1 retry if retries >= 0 raise @@ -750,7 +750,7 @@ def start_reactor_and_connect attempt = 0 begin @connection.connect.value - rescue Libcouchbase::Error::ConnectError => e + rescue MTLibcouchbase::Error::ConnectError => e attempt += 1 if attempt < 3 reactor.sleep 200 @@ -787,7 +787,7 @@ def start_reactor_and_em_connect attempt = 0 begin @connection.connect.value - rescue Libcouchbase::Error::ConnectError => e + rescue MTLibcouchbase::Error::ConnectError => e attempt += 1 if attempt < 3 reactor.sleep 200 diff --git a/lib/libcouchbase/callbacks.rb b/lib/mt-libcouchbase/callbacks.rb similarity index 99% rename from lib/libcouchbase/callbacks.rb rename to lib/mt-libcouchbase/callbacks.rb index 9e3866f..d432d34 100644 --- a/lib/libcouchbase/callbacks.rb +++ b/lib/mt-libcouchbase/callbacks.rb @@ -3,7 +3,7 @@ require 'concurrent' require 'ffi' -module Libcouchbase +module MTLibcouchbase module Callbacks diff --git a/lib/libcouchbase/connection.rb b/lib/mt-libcouchbase/connection.rb similarity index 99% rename from lib/libcouchbase/connection.rb rename to lib/mt-libcouchbase/connection.rb index 7dc965a..deb277f 100644 --- a/lib/libcouchbase/connection.rb +++ b/lib/mt-libcouchbase/connection.rb @@ -8,7 +8,7 @@ at_exit do GC.start connections = [] - ObjectSpace.each_object(::Libcouchbase::Connection).each do |connection| + ObjectSpace.each_object(::MTLibcouchbase::Connection).each do |connection| next unless connection.reactor.running? connections << connection begin @@ -22,7 +22,7 @@ end -module Libcouchbase +module MTLibcouchbase Response = Struct.new(:callback, :key, :cas, :value, :metadata) HttpResponse = Struct.new(:callback, :status, :headers, :body, :request) @@ -143,9 +143,9 @@ def connect(defer: nil, flush_enabled: false) # Configure safe retries # LCB_RETRYOPT_CREATE = Proc.new { |mode, policy| ((mode << 16) | policy) } # val = LCB_RETRYOPT_CREATE(LCB_RETRY_ON_SOCKERR, LCB_RETRY_CMDS_SAFE); - # ::Libcouchbase::Ext.cntl_setu32(handle, LCB_CNTL_RETRYMODE, val) + # ::MTLibcouchbase::Ext.cntl_setu32(handle, LCB_CNTL_RETRYMODE, val) retry_config = (1 << 16) | 3 - ::Libcouchbase::Ext.cntl_setu32(@handle, 0x24, (1 << 16) | 3) + ::MTLibcouchbase::Ext.cntl_setu32(@handle, 0x24, (1 << 16) | 3) # Connect to the database err = Ext.connect(@handle) diff --git a/lib/libcouchbase/design_docs.rb b/lib/mt-libcouchbase/design_docs.rb similarity index 99% rename from lib/libcouchbase/design_docs.rb rename to lib/mt-libcouchbase/design_docs.rb index eb47d71..8eda00d 100644 --- a/lib/libcouchbase/design_docs.rb +++ b/lib/mt-libcouchbase/design_docs.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true, encoding: ASCII-8BIT -module Libcouchbase +module MTLibcouchbase class DesignDocs def initialize(bucket, connection, result_meth, **opts) @connection = connection diff --git a/lib/libcouchbase/error.rb b/lib/mt-libcouchbase/error.rb similarity index 87% rename from lib/libcouchbase/error.rb rename to lib/mt-libcouchbase/error.rb index e405e87..495a679 100644 --- a/lib/libcouchbase/error.rb +++ b/lib/mt-libcouchbase/error.rb @@ -1,11 +1,11 @@ # frozen_string_literal: true, encoding: ASCII-8BIT -module Libcouchbase +module MTLibcouchbase class Error < ::StandardError; end class Error < ::StandardError - class UnknownError < ::Libcouchbase::Error; end - class HttpResponseError < ::Libcouchbase::Error + class UnknownError < ::MTLibcouchbase::Error; end + class HttpResponseError < ::MTLibcouchbase::Error attr_accessor :code, :headers, :body end Lookup = {} @@ -46,11 +46,11 @@ def self.camelize(term, uppercase_first_letter = true) }.each do |enum, name| Lookup[enum] = begin # Ensure the constant doesn't exist - ::Libcouchbase::Error.const_get(name) + ::MTLibcouchbase::Error.const_get(name) rescue NameError => e # Build the constants - klass = Class.new(::Libcouchbase::Error) - ::Libcouchbase::Error.const_set(name, klass) + klass = Class.new(::MTLibcouchbase::Error) + ::MTLibcouchbase::Error.const_set(name, klass) klass end end diff --git a/lib/libcouchbase/ext/libcouchbase.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase.rb similarity index 87% rename from lib/libcouchbase/ext/libcouchbase.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase.rb index fd6a8bd..c037c57 100644 --- a/lib/libcouchbase/ext/libcouchbase.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase.rb @@ -1,72 +1,72 @@ require 'ffi' -require 'libcouchbase/ext/libcouchbase/enums' +require 'mt-libcouchbase/ext/mt-libcouchbase/enums' -module Libcouchbase::Ext +module MTLibcouchbase::Ext extend FFI::Library if FFI::Platform.windows? ffi_lib ::File.expand_path("../../../../ext/libcouchbase.dll", __FILE__) else - ffi_lib ::File.expand_path("../../../../ext/libcouchbase/build/lib/libcouchbase.#{FFI::Platform::LIBSUFFIX}", __FILE__) + ffi_lib ::File.expand_path("../../../../ext/mt-libcouchbase/build/lib/libcouchbase.#{FFI::Platform::LIBSUFFIX}", __FILE__) end - require 'libcouchbase/ext/libcouchbase_libuv' - - autoload :T, 'libcouchbase/ext/libcouchbase/t' - autoload :HttpRequestT, 'libcouchbase/ext/libcouchbase/http_request_t' - autoload :CONTIGBUF, 'libcouchbase/ext/libcouchbase/contigbuf' - autoload :KEYBUF, 'libcouchbase/ext/libcouchbase/keybuf' - autoload :FRAGBUF, 'libcouchbase/ext/libcouchbase/fragbuf' - autoload :VALBUFUBuf, 'libcouchbase/ext/libcouchbase/valbuf_u_buf' - autoload :VALBUF, 'libcouchbase/ext/libcouchbase/valbuf' - autoload :CreateSt0, 'libcouchbase/ext/libcouchbase/create_st0' - autoload :CreateSt1, 'libcouchbase/ext/libcouchbase/create_st1' - autoload :CreateSt2, 'libcouchbase/ext/libcouchbase/create_st2' - autoload :CreateSt3, 'libcouchbase/ext/libcouchbase/create_st3' - autoload :CRSTU, 'libcouchbase/ext/libcouchbase/crst_u' - autoload :CreateSt, 'libcouchbase/ext/libcouchbase/create_st' - autoload :CMDBASE, 'libcouchbase/ext/libcouchbase/cmdbase' - autoload :RESPBASE, 'libcouchbase/ext/libcouchbase/respbase' - autoload :RESPSERVERBASE, 'libcouchbase/ext/libcouchbase/respserverbase' - autoload :MUTATIONTOKEN, 'libcouchbase/ext/libcouchbase/mutation_token' - autoload :CMDGET, 'libcouchbase/ext/libcouchbase/cmdget' - autoload :RESPGET, 'libcouchbase/ext/libcouchbase/respget' - autoload :CMDGETREPLICA, 'libcouchbase/ext/libcouchbase/cmdgetreplica' - autoload :CMDSTORE, 'libcouchbase/ext/libcouchbase/cmdstore' - autoload :RESPSTORE, 'libcouchbase/ext/libcouchbase/respstore' - autoload :MULTICMDCTX, 'libcouchbase/ext/libcouchbase/multicmd_ctx' - autoload :DURABILITYOPTSv0, 'libcouchbase/ext/libcouchbase/durabilityopt_sv0' - autoload :DurabilityOptsStV, 'libcouchbase/ext/libcouchbase/durability_opts_st_v' - autoload :DurabilityOptsT, 'libcouchbase/ext/libcouchbase/durability_opts_t' - autoload :CMDENDURE, 'libcouchbase/ext/libcouchbase/cmdendure' - autoload :RESPENDURE, 'libcouchbase/ext/libcouchbase/respendure' - autoload :CMDSTOREDUR, 'libcouchbase/ext/libcouchbase/cmdstoredur' - autoload :RESPSTOREDUR, 'libcouchbase/ext/libcouchbase/respstoredur' - autoload :CMDOBSERVE, 'libcouchbase/ext/libcouchbase/cmdobserve' - autoload :RESPOBSERVE, 'libcouchbase/ext/libcouchbase/respobserve' - autoload :CMDOBSEQNO, 'libcouchbase/ext/libcouchbase/cmdobseqno' - autoload :RESPOBSEQNO, 'libcouchbase/ext/libcouchbase/respobseqno' - autoload :CMDCOUNTER, 'libcouchbase/ext/libcouchbase/cmdcounter' - autoload :RESPCOUNTER, 'libcouchbase/ext/libcouchbase/respcounter' - autoload :RESPSTATS, 'libcouchbase/ext/libcouchbase/respstats' - autoload :RESPMCVERSION, 'libcouchbase/ext/libcouchbase/respmcversion' - autoload :CMDVERBOSITY, 'libcouchbase/ext/libcouchbase/cmdverbosity' - autoload :CMDHTTP, 'libcouchbase/ext/libcouchbase/cmdhttp' - autoload :RESPHTTP, 'libcouchbase/ext/libcouchbase/resphttp' - autoload :HISTOGRAM, 'libcouchbase/ext/libcouchbase/histogram' - autoload :SDSPEC, 'libcouchbase/ext/libcouchbase/sdspec' - autoload :CMDSUBDOC, 'libcouchbase/ext/libcouchbase/cmdsubdoc' - autoload :RESPSUBDOC, 'libcouchbase/ext/libcouchbase/respsubdoc' - autoload :SDENTRY, 'libcouchbase/ext/libcouchbase/sdentry' - autoload :VIEWHANDLE, 'libcouchbase/ext/libcouchbase/viewhandle' - autoload :CMDVIEWQUERY, 'libcouchbase/ext/libcouchbase/cmdviewquery' - autoload :RESPVIEWQUERY, 'libcouchbase/ext/libcouchbase/respviewquery' - autoload :N1QLHANDLE, 'libcouchbase/ext/libcouchbase/n1qlhandle' - autoload :N1QLPARAMS, 'libcouchbase/ext/libcouchbase/n1qlparams' - autoload :CMDN1QL, 'libcouchbase/ext/libcouchbase/cmdn1ql' - autoload :RESPN1QL, 'libcouchbase/ext/libcouchbase/respn1ql' - autoload :RESPFTS, 'libcouchbase/ext/libcouchbase/respfts' - autoload :FTSHANDLE, 'libcouchbase/ext/libcouchbase/ftshandle' - autoload :CMDFTS, 'libcouchbase/ext/libcouchbase/cmdfts' + require 'mt-libcouchbase/ext/libcouchbase_libuv' + + autoload :T, 'mt-libcouchbase/ext/mt-libcouchbase/t' + autoload :HttpRequestT, 'mt-libcouchbase/ext/mt-libcouchbase/http_request_t' + autoload :CONTIGBUF, 'mt-libcouchbase/ext/mt-libcouchbase/contigbuf' + autoload :KEYBUF, 'mt-libcouchbase/ext/mt-libcouchbase/keybuf' + autoload :FRAGBUF, 'mt-libcouchbase/ext/mt-libcouchbase/fragbuf' + autoload :VALBUFUBuf, 'mt-libcouchbase/ext/mt-libcouchbase/valbuf_u_buf' + autoload :VALBUF, 'mt-libcouchbase/ext/mt-libcouchbase/valbuf' + autoload :CreateSt0, 'mt-libcouchbase/ext/mt-libcouchbase/create_st0' + autoload :CreateSt1, 'mt-libcouchbase/ext/mt-libcouchbase/create_st1' + autoload :CreateSt2, 'mt-libcouchbase/ext/mt-libcouchbase/create_st2' + autoload :CreateSt3, 'mt-libcouchbase/ext/mt-libcouchbase/create_st3' + autoload :CRSTU, 'mt-libcouchbase/ext/mt-libcouchbase/crst_u' + autoload :CreateSt, 'mt-libcouchbase/ext/mt-libcouchbase/create_st' + autoload :CMDBASE, 'mt-libcouchbase/ext/mt-libcouchbase/cmdbase' + autoload :RESPBASE, 'mt-libcouchbase/ext/mt-libcouchbase/respbase' + autoload :RESPSERVERBASE, 'mt-libcouchbase/ext/mt-libcouchbase/respserverbase' + autoload :MUTATIONTOKEN, 'mt-libcouchbase/ext/mt-libcouchbase/mutation_token' + autoload :CMDGET, 'mt-libcouchbase/ext/mt-libcouchbase/cmdget' + autoload :RESPGET, 'mt-libcouchbase/ext/mt-libcouchbase/respget' + autoload :CMDGETREPLICA, 'mt-libcouchbase/ext/mt-libcouchbase/cmdgetreplica' + autoload :CMDSTORE, 'mt-libcouchbase/ext/mt-libcouchbase/cmdstore' + autoload :RESPSTORE, 'mt-libcouchbase/ext/mt-libcouchbase/respstore' + autoload :MULTICMDCTX, 'mt-libcouchbase/ext/mt-libcouchbase/multicmd_ctx' + autoload :DURABILITYOPTSv0, 'mt-libcouchbase/ext/mt-libcouchbase/durabilityopt_sv0' + autoload :DurabilityOptsStV, 'mt-libcouchbase/ext/mt-libcouchbase/durability_opts_st_v' + autoload :DurabilityOptsT, 'mt-libcouchbase/ext/mt-libcouchbase/durability_opts_t' + autoload :CMDENDURE, 'mt-libcouchbase/ext/mt-libcouchbase/cmdendure' + autoload :RESPENDURE, 'mt-libcouchbase/ext/mt-libcouchbase/respendure' + autoload :CMDSTOREDUR, 'mt-libcouchbase/ext/mt-libcouchbase/cmdstoredur' + autoload :RESPSTOREDUR, 'mt-libcouchbase/ext/mt-libcouchbase/respstoredur' + autoload :CMDOBSERVE, 'mt-libcouchbase/ext/mt-libcouchbase/cmdobserve' + autoload :RESPOBSERVE, 'mt-libcouchbase/ext/mt-libcouchbase/respobserve' + autoload :CMDOBSEQNO, 'mt-libcouchbase/ext/mt-libcouchbase/cmdobseqno' + autoload :RESPOBSEQNO, 'mt-libcouchbase/ext/mt-libcouchbase/respobseqno' + autoload :CMDCOUNTER, 'mt-libcouchbase/ext/mt-libcouchbase/cmdcounter' + autoload :RESPCOUNTER, 'mt-libcouchbase/ext/mt-libcouchbase/respcounter' + autoload :RESPSTATS, 'mt-libcouchbase/ext/mt-libcouchbase/respstats' + autoload :RESPMCVERSION, 'mt-libcouchbase/ext/mt-libcouchbase/respmcversion' + autoload :CMDVERBOSITY, 'mt-libcouchbase/ext/mt-libcouchbase/cmdverbosity' + autoload :CMDHTTP, 'mt-libcouchbase/ext/mt-libcouchbase/cmdhttp' + autoload :RESPHTTP, 'mt-libcouchbase/ext/mt-libcouchbase/resphttp' + autoload :HISTOGRAM, 'mt-libcouchbase/ext/mt-libcouchbase/histogram' + autoload :SDSPEC, 'mt-libcouchbase/ext/mt-libcouchbase/sdspec' + autoload :CMDSUBDOC, 'mt-libcouchbase/ext/mt-libcouchbase/cmdsubdoc' + autoload :RESPSUBDOC, 'mt-libcouchbase/ext/mt-libcouchbase/respsubdoc' + autoload :SDENTRY, 'mt-libcouchbase/ext/mt-libcouchbase/sdentry' + autoload :VIEWHANDLE, 'mt-libcouchbase/ext/mt-libcouchbase/viewhandle' + autoload :CMDVIEWQUERY, 'mt-libcouchbase/ext/mt-libcouchbase/cmdviewquery' + autoload :RESPVIEWQUERY, 'mt-libcouchbase/ext/mt-libcouchbase/respviewquery' + autoload :N1QLHANDLE, 'mt-libcouchbase/ext/mt-libcouchbase/n1qlhandle' + autoload :N1QLPARAMS, 'mt-libcouchbase/ext/mt-libcouchbase/n1qlparams' + autoload :CMDN1QL, 'mt-libcouchbase/ext/mt-libcouchbase/cmdn1ql' + autoload :RESPN1QL, 'mt-libcouchbase/ext/mt-libcouchbase/respn1ql' + autoload :RESPFTS, 'mt-libcouchbase/ext/mt-libcouchbase/respfts' + autoload :FTSHANDLE, 'mt-libcouchbase/ext/mt-libcouchbase/ftshandle' + autoload :CMDFTS, 'mt-libcouchbase/ext/mt-libcouchbase/cmdfts' attach_function :create_io_ops, :lcb_create_io_ops, [:pointer, :pointer], ErrorT diff --git a/lib/libcouchbase/ext/libcouchbase/cmdbase.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/cmdbase.rb similarity index 93% rename from lib/libcouchbase/ext/libcouchbase/cmdbase.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/cmdbase.rb index 2cc053a..b25a5b6 100644 --- a/lib/libcouchbase/ext/libcouchbase/cmdbase.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/cmdbase.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/cmdcounter.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/cmdcounter.rb similarity index 97% rename from lib/libcouchbase/ext/libcouchbase/cmdcounter.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/cmdcounter.rb index 3c37863..f1b9992 100644 --- a/lib/libcouchbase/ext/libcouchbase/cmdcounter.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/cmdcounter.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/cmdendure.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/cmdendure.rb similarity index 94% rename from lib/libcouchbase/ext/libcouchbase/cmdendure.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/cmdendure.rb index 6bfa02b..7e554e9 100644 --- a/lib/libcouchbase/ext/libcouchbase/cmdendure.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/cmdendure.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/cmdfts.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/cmdfts.rb similarity index 96% rename from lib/libcouchbase/ext/libcouchbase/cmdfts.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/cmdfts.rb index 2c8184f..0a920e8 100644 --- a/lib/libcouchbase/ext/libcouchbase/cmdfts.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/cmdfts.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # @brief Search Command # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/cmdget.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/cmdget.rb similarity index 96% rename from lib/libcouchbase/ext/libcouchbase/cmdget.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/cmdget.rb index 1b6f6c8..c098228 100644 --- a/lib/libcouchbase/ext/libcouchbase/cmdget.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/cmdget.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/cmdgetreplica.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/cmdgetreplica.rb similarity index 98% rename from lib/libcouchbase/ext/libcouchbase/cmdgetreplica.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/cmdgetreplica.rb index e0ab5b7..b0313f1 100644 --- a/lib/libcouchbase/ext/libcouchbase/cmdgetreplica.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/cmdgetreplica.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/cmdhttp.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/cmdhttp.rb similarity index 98% rename from lib/libcouchbase/ext/libcouchbase/cmdhttp.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/cmdhttp.rb index 4be4caf..d5f4eb8 100644 --- a/lib/libcouchbase/ext/libcouchbase/cmdhttp.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/cmdhttp.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/cmdn1ql.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/cmdn1ql.rb similarity index 98% rename from lib/libcouchbase/ext/libcouchbase/cmdn1ql.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/cmdn1ql.rb index 30aa0ab..a187545 100644 --- a/lib/libcouchbase/ext/libcouchbase/cmdn1ql.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/cmdn1ql.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/cmdobseqno.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/cmdobseqno.rb similarity index 96% rename from lib/libcouchbase/ext/libcouchbase/cmdobseqno.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/cmdobseqno.rb index 788e851..de0f931 100644 --- a/lib/libcouchbase/ext/libcouchbase/cmdobseqno.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/cmdobseqno.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/cmdobserve.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/cmdobserve.rb similarity index 96% rename from lib/libcouchbase/ext/libcouchbase/cmdobserve.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/cmdobserve.rb index e30d734..829f1f0 100644 --- a/lib/libcouchbase/ext/libcouchbase/cmdobserve.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/cmdobserve.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/cmdstore.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/cmdstore.rb similarity index 97% rename from lib/libcouchbase/ext/libcouchbase/cmdstore.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/cmdstore.rb index 0d057d3..2b197f4 100644 --- a/lib/libcouchbase/ext/libcouchbase/cmdstore.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/cmdstore.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/cmdstoredur.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/cmdstoredur.rb similarity index 97% rename from lib/libcouchbase/ext/libcouchbase/cmdstoredur.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/cmdstoredur.rb index 17e812e..e08de7e 100644 --- a/lib/libcouchbase/ext/libcouchbase/cmdstoredur.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/cmdstoredur.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/cmdsubdoc.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/cmdsubdoc.rb similarity index 98% rename from lib/libcouchbase/ext/libcouchbase/cmdsubdoc.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/cmdsubdoc.rb index c948c2a..5eed48a 100644 --- a/lib/libcouchbase/ext/libcouchbase/cmdsubdoc.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/cmdsubdoc.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/cmdverbosity.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/cmdverbosity.rb similarity index 95% rename from lib/libcouchbase/ext/libcouchbase/cmdverbosity.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/cmdverbosity.rb index 0ec2b64..7885722 100644 --- a/lib/libcouchbase/ext/libcouchbase/cmdverbosity.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/cmdverbosity.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/cmdviewquery.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/cmdviewquery.rb similarity index 98% rename from lib/libcouchbase/ext/libcouchbase/cmdviewquery.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/cmdviewquery.rb index ec82b34..4c6f84d 100644 --- a/lib/libcouchbase/ext/libcouchbase/cmdviewquery.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/cmdviewquery.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/contigbuf.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/contigbuf.rb similarity index 89% rename from lib/libcouchbase/ext/libcouchbase/contigbuf.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/contigbuf.rb index 1942092..44bda70 100644 --- a/lib/libcouchbase/ext/libcouchbase/contigbuf.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/contigbuf.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/create_st.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/create_st.rb similarity index 93% rename from lib/libcouchbase/ext/libcouchbase/create_st.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/create_st.rb index 4544527..352aecc 100644 --- a/lib/libcouchbase/ext/libcouchbase/create_st.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/create_st.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/create_st0.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/create_st0.rb similarity index 93% rename from lib/libcouchbase/ext/libcouchbase/create_st0.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/create_st0.rb index 7304087..76b6acc 100644 --- a/lib/libcouchbase/ext/libcouchbase/create_st0.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/create_st0.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/create_st1.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/create_st1.rb similarity index 94% rename from lib/libcouchbase/ext/libcouchbase/create_st1.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/create_st1.rb index 754eeae..29990e2 100644 --- a/lib/libcouchbase/ext/libcouchbase/create_st1.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/create_st1.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/create_st2.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/create_st2.rb similarity index 95% rename from lib/libcouchbase/ext/libcouchbase/create_st2.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/create_st2.rb index e428a24..1b9ea2e 100644 --- a/lib/libcouchbase/ext/libcouchbase/create_st2.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/create_st2.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/create_st3.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/create_st3.rb similarity index 95% rename from lib/libcouchbase/ext/libcouchbase/create_st3.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/create_st3.rb index 0c077a8..6c78438 100644 --- a/lib/libcouchbase/ext/libcouchbase/create_st3.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/create_st3.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/crst_u.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/crst_u.rb similarity index 92% rename from lib/libcouchbase/ext/libcouchbase/crst_u.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/crst_u.rb index 14f31bc..4cff0b4 100644 --- a/lib/libcouchbase/ext/libcouchbase/crst_u.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/crst_u.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/durability_opts_st_v.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/durability_opts_st_v.rb similarity index 86% rename from lib/libcouchbase/ext/libcouchbase/durability_opts_st_v.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/durability_opts_st_v.rb index 38bda84..d909815 100644 --- a/lib/libcouchbase/ext/libcouchbase/durability_opts_st_v.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/durability_opts_st_v.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/durability_opts_t.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/durability_opts_t.rb similarity index 89% rename from lib/libcouchbase/ext/libcouchbase/durability_opts_t.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/durability_opts_t.rb index ddb25d3..98fccd9 100644 --- a/lib/libcouchbase/ext/libcouchbase/durability_opts_t.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/durability_opts_t.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/durabilityopt_sv0.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/durabilityopt_sv0.rb similarity index 99% rename from lib/libcouchbase/ext/libcouchbase/durabilityopt_sv0.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/durabilityopt_sv0.rb index 0dd06b1..abc8153 100644 --- a/lib/libcouchbase/ext/libcouchbase/durabilityopt_sv0.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/durabilityopt_sv0.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/enums.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/enums.rb similarity index 99% rename from lib/libcouchbase/ext/libcouchbase/enums.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/enums.rb index 7b3f64f..ea50217 100644 --- a/lib/libcouchbase/ext/libcouchbase/enums.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/enums.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext extend FFI::Library # (Not documented) # @@ -744,7 +744,7 @@ module Libcouchbase::Ext # :query_error :: # # :max_error :: - # The errors below this value reserver for libcouchbase usage. + # The errors below this value reserver for MTLibcouchbase usage. # # @method `enum_error_t` # @return [Symbol] diff --git a/lib/libcouchbase/ext/libcouchbase/fragbuf.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/fragbuf.rb similarity index 94% rename from lib/libcouchbase/ext/libcouchbase/fragbuf.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/fragbuf.rb index 8d8c027..243491f 100644 --- a/lib/libcouchbase/ext/libcouchbase/fragbuf.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/fragbuf.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/ftshandle.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/ftshandle.rb similarity index 76% rename from lib/libcouchbase/ext/libcouchbase/ftshandle.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/ftshandle.rb index 953aea3..8c3557c 100644 --- a/lib/libcouchbase/ext/libcouchbase/ftshandle.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/ftshandle.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) class FTSHANDLE < FFI::Struct layout :dummy, :char diff --git a/lib/libcouchbase/ext/libcouchbase/histogram.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/histogram.rb similarity index 67% rename from lib/libcouchbase/ext/libcouchbase/histogram.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/histogram.rb index 831906a..7e6e4cb 100644 --- a/lib/libcouchbase/ext/libcouchbase/histogram.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/histogram.rb @@ -1,28 +1,28 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) module HISTOGRAMWrappers # @return [nil] def destroy() - Libcouchbase::Ext.histogram_destroy(self) + MTLibcouchbase::Ext.histogram_destroy(self) end # @param [Integer] duration # @return [nil] def record(duration) - Libcouchbase::Ext.histogram_record(self, duration) + MTLibcouchbase::Ext.histogram_record(self, duration) end # @param [FFI::Pointer(*Void)] cookie # @param [Proc(callback_histogram_callback)] cb # @return [nil] def read(cookie, cb) - Libcouchbase::Ext.histogram_read(self, cookie, cb) + MTLibcouchbase::Ext.histogram_read(self, cookie, cb) end # @param [FFI::Pointer(*FILE)] stream # @return [nil] def print(stream) - Libcouchbase::Ext.histogram_print(self, stream) + MTLibcouchbase::Ext.histogram_print(self, stream) end end diff --git a/lib/libcouchbase/ext/libcouchbase/http_request_t.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/http_request_t.rb similarity index 77% rename from lib/libcouchbase/ext/libcouchbase/http_request_t.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/http_request_t.rb index f63fc3c..9d437ee 100644 --- a/lib/libcouchbase/ext/libcouchbase/http_request_t.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/http_request_t.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) class HttpRequestT < FFI::Struct layout :dummy, :char diff --git a/lib/libcouchbase/ext/libcouchbase/keybuf.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/keybuf.rb similarity index 95% rename from lib/libcouchbase/ext/libcouchbase/keybuf.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/keybuf.rb index c9ac448..30deb6a 100644 --- a/lib/libcouchbase/ext/libcouchbase/keybuf.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/keybuf.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/multicmd_ctx.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/multicmd_ctx.rb similarity index 97% rename from lib/libcouchbase/ext/libcouchbase/multicmd_ctx.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/multicmd_ctx.rb index b49deac..76050fd 100644 --- a/lib/libcouchbase/ext/libcouchbase/multicmd_ctx.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/multicmd_ctx.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/mutation_token.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/mutation_token.rb similarity index 92% rename from lib/libcouchbase/ext/libcouchbase/mutation_token.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/mutation_token.rb index 0ff2560..909374e 100644 --- a/lib/libcouchbase/ext/libcouchbase/mutation_token.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/mutation_token.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/n1qlhandle.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/n1qlhandle.rb similarity index 76% rename from lib/libcouchbase/ext/libcouchbase/n1qlhandle.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/n1qlhandle.rb index bdfa2ee..f5036f5 100644 --- a/lib/libcouchbase/ext/libcouchbase/n1qlhandle.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/n1qlhandle.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) class N1QLHANDLE < FFI::Struct layout :dummy, :char diff --git a/lib/libcouchbase/ext/libcouchbase/n1qlparams.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/n1qlparams.rb similarity index 76% rename from lib/libcouchbase/ext/libcouchbase/n1qlparams.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/n1qlparams.rb index 12d5565..9fdce2b 100644 --- a/lib/libcouchbase/ext/libcouchbase/n1qlparams.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/n1qlparams.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) class N1QLPARAMS < FFI::Struct layout :dummy, :char diff --git a/lib/libcouchbase/ext/libcouchbase/respbase.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/respbase.rb similarity index 94% rename from lib/libcouchbase/ext/libcouchbase/respbase.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/respbase.rb index 50f532c..ff7980a 100644 --- a/lib/libcouchbase/ext/libcouchbase/respbase.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/respbase.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/respcounter.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/respcounter.rb similarity index 95% rename from lib/libcouchbase/ext/libcouchbase/respcounter.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/respcounter.rb index 608358a..e118d62 100644 --- a/lib/libcouchbase/ext/libcouchbase/respcounter.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/respcounter.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/respendure.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/respendure.rb similarity index 98% rename from lib/libcouchbase/ext/libcouchbase/respendure.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/respendure.rb index 54b93dd..29a7455 100644 --- a/lib/libcouchbase/ext/libcouchbase/respendure.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/respendure.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/respfts.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/respfts.rb similarity index 97% rename from lib/libcouchbase/ext/libcouchbase/respfts.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/respfts.rb index 9abbbaa..4f51839 100644 --- a/lib/libcouchbase/ext/libcouchbase/respfts.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/respfts.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/respget.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/respget.rb similarity index 97% rename from lib/libcouchbase/ext/libcouchbase/respget.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/respget.rb index 7a93275..39fab31 100644 --- a/lib/libcouchbase/ext/libcouchbase/respget.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/respget.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/resphttp.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/resphttp.rb similarity index 98% rename from lib/libcouchbase/ext/libcouchbase/resphttp.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/resphttp.rb index 0e256be..b4f63ed 100644 --- a/lib/libcouchbase/ext/libcouchbase/resphttp.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/resphttp.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/respmcversion.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/respmcversion.rb similarity index 96% rename from lib/libcouchbase/ext/libcouchbase/respmcversion.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/respmcversion.rb index 673c598..c33332a 100644 --- a/lib/libcouchbase/ext/libcouchbase/respmcversion.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/respmcversion.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/respn1ql.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/respn1ql.rb similarity index 97% rename from lib/libcouchbase/ext/libcouchbase/respn1ql.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/respn1ql.rb index f141fe6..1848c06 100644 --- a/lib/libcouchbase/ext/libcouchbase/respn1ql.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/respn1ql.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/respobseqno.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/respobseqno.rb similarity index 98% rename from lib/libcouchbase/ext/libcouchbase/respobseqno.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/respobseqno.rb index f4f86c5..2aaa2f0 100644 --- a/lib/libcouchbase/ext/libcouchbase/respobseqno.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/respobseqno.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/respobserve.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/respobserve.rb similarity index 97% rename from lib/libcouchbase/ext/libcouchbase/respobserve.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/respobserve.rb index 59b3ecd..041a503 100644 --- a/lib/libcouchbase/ext/libcouchbase/respobserve.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/respobserve.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/respserverbase.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/respserverbase.rb similarity index 95% rename from lib/libcouchbase/ext/libcouchbase/respserverbase.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/respserverbase.rb index 594c489..03a3495 100644 --- a/lib/libcouchbase/ext/libcouchbase/respserverbase.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/respserverbase.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/respstats.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/respstats.rb similarity index 96% rename from lib/libcouchbase/ext/libcouchbase/respstats.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/respstats.rb index 17b4124..a22716b 100644 --- a/lib/libcouchbase/ext/libcouchbase/respstats.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/respstats.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/respstore.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/respstore.rb similarity index 95% rename from lib/libcouchbase/ext/libcouchbase/respstore.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/respstore.rb index 0bfe387..dd5dbca 100644 --- a/lib/libcouchbase/ext/libcouchbase/respstore.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/respstore.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/respstoredur.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/respstoredur.rb similarity index 97% rename from lib/libcouchbase/ext/libcouchbase/respstoredur.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/respstoredur.rb index de98b5c..df4bfbd 100644 --- a/lib/libcouchbase/ext/libcouchbase/respstoredur.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/respstoredur.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/respsubdoc.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/respsubdoc.rb similarity index 96% rename from lib/libcouchbase/ext/libcouchbase/respsubdoc.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/respsubdoc.rb index 0967667..f53ba3b 100644 --- a/lib/libcouchbase/ext/libcouchbase/respsubdoc.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/respsubdoc.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/respviewquery.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/respviewquery.rb similarity index 98% rename from lib/libcouchbase/ext/libcouchbase/respviewquery.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/respviewquery.rb index ed699e1..12184ce 100644 --- a/lib/libcouchbase/ext/libcouchbase/respviewquery.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/respviewquery.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/sdentry.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/sdentry.rb similarity index 95% rename from lib/libcouchbase/ext/libcouchbase/sdentry.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/sdentry.rb index 2c116ff..1785e91 100644 --- a/lib/libcouchbase/ext/libcouchbase/sdentry.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/sdentry.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/sdspec.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/sdspec.rb similarity index 97% rename from lib/libcouchbase/ext/libcouchbase/sdspec.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/sdspec.rb index 0c5795c..4b96c3a 100644 --- a/lib/libcouchbase/ext/libcouchbase/sdspec.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/sdspec.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/t.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/t.rb similarity index 75% rename from lib/libcouchbase/ext/libcouchbase/t.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/t.rb index 284d97b..eea5645 100644 --- a/lib/libcouchbase/ext/libcouchbase/t.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/t.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) class T < FFI::Struct layout :dummy, :char diff --git a/lib/libcouchbase/ext/libcouchbase/valbuf.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/valbuf.rb similarity index 95% rename from lib/libcouchbase/ext/libcouchbase/valbuf.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/valbuf.rb index 2db4f1e..f897184 100644 --- a/lib/libcouchbase/ext/libcouchbase/valbuf.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/valbuf.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/valbuf_u_buf.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/valbuf_u_buf.rb similarity index 89% rename from lib/libcouchbase/ext/libcouchbase/valbuf_u_buf.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/valbuf_u_buf.rb index 174242e..5e2e8a1 100644 --- a/lib/libcouchbase/ext/libcouchbase/valbuf_u_buf.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/valbuf_u_buf.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) # # ## Fields: diff --git a/lib/libcouchbase/ext/libcouchbase/viewhandle.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase/viewhandle.rb similarity index 76% rename from lib/libcouchbase/ext/libcouchbase/viewhandle.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase/viewhandle.rb index 7c63632..f87e243 100644 --- a/lib/libcouchbase/ext/libcouchbase/viewhandle.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase/viewhandle.rb @@ -1,4 +1,4 @@ -module Libcouchbase::Ext +module MTLibcouchbase::Ext # (Not documented) class VIEWHANDLE < FFI::Struct layout :dummy, :char diff --git a/lib/libcouchbase/ext/libcouchbase_libuv.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase_libuv.rb similarity index 63% rename from lib/libcouchbase/ext/libcouchbase_libuv.rb rename to lib/mt-libcouchbase/ext/mt-libcouchbase_libuv.rb index 6f37a69..32a1559 100644 --- a/lib/libcouchbase/ext/libcouchbase_libuv.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase_libuv.rb @@ -1,13 +1,13 @@ -# This file contains all the structures required to configure libcouchbase to use +# This file contains all the structures required to configure mtlibcouchbase to use # Libuv as the primary event loop -module Libcouchbase::Ext::Libuv +module MTLibcouchbase::Ext::Libuv extend FFI::Library if FFI::Platform.windows? ffi_lib ::File.expand_path("../../../../ext/libcouchbase_libuv.dll", __FILE__) else - ffi_lib ::File.expand_path("../../../../ext/libcouchbase/build/lib/libcouchbase_libuv.#{FFI::Platform::LIBSUFFIX}", __FILE__) + ffi_lib ::File.expand_path("../../../../ext/mt-libcouchbase/build/lib/libcouchbase_libuv.#{FFI::Platform::LIBSUFFIX}", __FILE__) end # ref: http://docs.couchbase.com/sdk-api/couchbase-c-client-2.4.8/group__lcb-libuv.html @@ -18,5 +18,5 @@ class UVOptions < FFI::Struct end # pointer param returns IO opts structure - attach_function :create_libuv_io_opts, :lcb_create_libuv_io_opts, [:int, :pointer, UVOptions.by_ref], ::Libcouchbase::Ext::ErrorT + attach_function :create_libuv_io_opts, :lcb_create_libuv_io_opts, [:int, :pointer, UVOptions.by_ref], ::MTLibcouchbase::Ext::ErrorT end diff --git a/lib/libcouchbase/ext/tasks.rb b/lib/mt-libcouchbase/ext/tasks.rb similarity index 89% rename from lib/libcouchbase/ext/tasks.rb rename to lib/mt-libcouchbase/ext/tasks.rb index 3c832f3..2050210 100644 --- a/lib/libcouchbase/ext/tasks.rb +++ b/lib/mt-libcouchbase/ext/tasks.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true, encoding: ASCII-8BIT require 'fileutils' -require 'libuv' +require 'mt-libuv' module FFI::Platform def self.ia32? @@ -25,7 +25,7 @@ def self.x64? file 'ext/libcouchbase/build/makefile' => 'ext/libcouchbase/build' do result = nil Dir.chdir("ext/libcouchbase") do |path| - result = system './cmake/configure', '-disable-couchbasemock', '-with-libuv', ::File.expand_path('../../', ::Libuv::Ext.path_to_internal_libuv) + result = system './cmake/configure', '-disable-couchbasemock', '-with-libuv', ::File.expand_path('../../', ::MTLibuv::Ext.path_to_internal_libuv) end raise 'could not find cmake on path' unless result end diff --git a/lib/libcouchbase/n1ql.rb b/lib/mt-libcouchbase/n1ql.rb similarity index 99% rename from lib/libcouchbase/n1ql.rb rename to lib/mt-libcouchbase/n1ql.rb index b10e4bc..9b45355 100644 --- a/lib/libcouchbase/n1ql.rb +++ b/lib/mt-libcouchbase/n1ql.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true, encoding: ASCII-8BIT -module Libcouchbase +module MTLibcouchbase class N1QL Ordering = [ :build_index, :create_index, :drop_index, :create_primary_index, diff --git a/lib/libcouchbase/query_full_text.rb b/lib/mt-libcouchbase/query_full_text.rb similarity index 99% rename from lib/libcouchbase/query_full_text.rb rename to lib/mt-libcouchbase/query_full_text.rb index 6ce0bd7..b2bf1f7 100644 --- a/lib/libcouchbase/query_full_text.rb +++ b/lib/mt-libcouchbase/query_full_text.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true, encoding: ASCII-8BIT -module Libcouchbase +module MTLibcouchbase class QueryFullText def initialize(connection, reactor, include_docs: true, **opts) @connection = connection diff --git a/lib/libcouchbase/query_n1ql.rb b/lib/mt-libcouchbase/query_n1ql.rb similarity index 99% rename from lib/libcouchbase/query_n1ql.rb rename to lib/mt-libcouchbase/query_n1ql.rb index 1bb3b91..627309c 100644 --- a/lib/libcouchbase/query_n1ql.rb +++ b/lib/mt-libcouchbase/query_n1ql.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true, encoding: ASCII-8BIT -module Libcouchbase +module MTLibcouchbase class QueryN1QL N1P_QUERY_STATEMENT = 1 N1P_CONSISTENCY_REQUEST = 2 diff --git a/lib/libcouchbase/query_view.rb b/lib/mt-libcouchbase/query_view.rb similarity index 99% rename from lib/libcouchbase/query_view.rb rename to lib/mt-libcouchbase/query_view.rb index 176a042..62894bd 100644 --- a/lib/libcouchbase/query_view.rb +++ b/lib/mt-libcouchbase/query_view.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true, encoding: ASCII-8BIT -module Libcouchbase +module MTLibcouchbase class QueryView # Set this flag to execute an actual get with each response F_INCLUDE_DOCS = 1 << 16 diff --git a/lib/libcouchbase/results_fiber.rb b/lib/mt-libcouchbase/results_fiber.rb similarity index 99% rename from lib/libcouchbase/results_fiber.rb rename to lib/mt-libcouchbase/results_fiber.rb index 6c3a940..cc3e9f5 100644 --- a/lib/libcouchbase/results_fiber.rb +++ b/lib/mt-libcouchbase/results_fiber.rb @@ -2,7 +2,7 @@ require 'set' -module Libcouchbase +module MTLibcouchbase class ResultsFiber < Results def initialize(query, &row_modifier) @query_in_progress = false diff --git a/lib/libcouchbase/results_native.rb b/lib/mt-libcouchbase/results_native.rb similarity index 99% rename from lib/libcouchbase/results_native.rb rename to lib/mt-libcouchbase/results_native.rb index 3b1642c..e8b27c4 100644 --- a/lib/libcouchbase/results_native.rb +++ b/lib/mt-libcouchbase/results_native.rb @@ -2,7 +2,7 @@ require 'set' -module Libcouchbase +module MTLibcouchbase class ResultsNative < Results def initialize(query, &row_modifier) @query_in_progress = false diff --git a/lib/libcouchbase/subdoc_request.rb b/lib/mt-libcouchbase/subdoc_request.rb similarity index 88% rename from lib/libcouchbase/subdoc_request.rb rename to lib/mt-libcouchbase/subdoc_request.rb index 87704f2..5ac6154 100644 --- a/lib/libcouchbase/subdoc_request.rb +++ b/lib/mt-libcouchbase/subdoc_request.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true, encoding: ASCII-8BIT -module Libcouchbase; end; -class Libcouchbase::SubdocRequest +module MTLibcouchbase; end; +class MTLibcouchbase::SubdocRequest def initialize(key, quiet, bucket: nil, exec_opts: nil) @key = key.to_s @@ -22,9 +22,9 @@ def initialize(key, quiet, bucket: nil, exec_opts: nil) def to_specs_array return @mem if @mem # effectively freezes this object number = @specs.length - @mem = FFI::MemoryPointer.new(::Libcouchbase::Ext::SDSPEC, number, false) + @mem = FFI::MemoryPointer.new(::MTLibcouchbase::Ext::SDSPEC, number, false) @specs.each_with_index do |spec, index| - struct_bytes = spec.to_ptr.get_bytes(0, ::Libcouchbase::Ext::SDSPEC.size) # (offset, length) + struct_bytes = spec.to_ptr.get_bytes(0, ::MTLibcouchbase::Ext::SDSPEC.size) # (offset, length) @mem[index].put_bytes(0, struct_bytes) # (offset, byte_string) end @specs = nil @@ -103,9 +103,9 @@ def new_spec(quiet, path, cmd, mode, create_intermediates = false) @mode ||= mode raise "unable to perform #{cmd} as mode is currently #{@mode}" if @mode != mode - spec = ::Libcouchbase::Ext::SDSPEC.new - spec[:sdcmd] = ::Libcouchbase::Ext::SUBDOCOP[cmd] - spec[:options] = ::Libcouchbase::Ext::SDSPEC::MKINTERMEDIATES if create_intermediates + spec = ::MTLibcouchbase::Ext::SDSPEC.new + spec[:sdcmd] = ::MTLibcouchbase::Ext::SUBDOCOP[cmd] + spec[:options] = ::MTLibcouchbase::Ext::SDSPEC::MKINTERMEDIATES if create_intermediates loc = path.to_s str = ref(loc) diff --git a/lib/libcouchbase/version.rb b/lib/mt-libcouchbase/version.rb similarity index 78% rename from lib/libcouchbase/version.rb rename to lib/mt-libcouchbase/version.rb index 7231494..050dddd 100644 --- a/lib/libcouchbase/version.rb +++ b/lib/mt-libcouchbase/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true, encoding: ASCII-8BIT -module Libcouchbase +module MTLibcouchbase VERSION = '1.4.0' end diff --git a/libcouchbase.gemspec b/mt-libcouchbase.gemspec similarity index 81% rename from libcouchbase.gemspec rename to mt-libcouchbase.gemspec index 284bb17..d81fb21 100644 --- a/libcouchbase.gemspec +++ b/mt-libcouchbase.gemspec @@ -1,14 +1,14 @@ -require File.expand_path("../lib/libcouchbase/version", __FILE__) +require File.expand_path("../lib/mt-libcouchbase/version", __FILE__) Gem::Specification.new do |gem| - gem.name = "libcouchbase" - gem.version = Libcouchbase::VERSION + gem.name = "mt-libcouchbase" + gem.version = MTLibcouchbase::VERSION gem.license = 'MIT' gem.authors = ["Stephen von Takach"] gem.email = ["steve@cotag.me"] gem.homepage = "https://github.com/cotag/libcouchbase" - gem.summary = "libcouchbase bindings for Ruby" - gem.description = "A wrapper around libcouchbase for Ruby" + gem.summary = "mt-libcouchbase bindings for Ruby" + gem.description = "A wrapper around mt-libcouchbase for Ruby" gem.extensions << "ext/Rakefile" @@ -17,12 +17,12 @@ Gem::Specification.new do |gem| gem.add_runtime_dependency 'ffi', '~> 1.9' gem.add_runtime_dependency 'concurrent-ruby', '~> 1.0' - gem.add_runtime_dependency 'libuv', '>= 3.2.2', '< 5' + gem.add_runtime_dependency 'mt-libuv', '~> 4.1', '>= 4.1.02' gem.add_development_dependency 'rake', '~> 11.2' gem.add_development_dependency 'rspec', '~> 3.5' gem.add_development_dependency 'yard', '~> 0.9' - gem.add_development_dependency 'uv-rays', '~> 2.0' # for libuv results spec + gem.add_development_dependency 'mt-uv-rays', '~> 2.4', '>= 2.4.7' # for libuv spec gem.add_development_dependency 'em-synchrony', '~> 1.0' # for eventmachine spec # https://github.com/stakach/ffi-gen @@ -51,7 +51,7 @@ Gem::Specification.new do |gem| submodule_path = submodule_path.gsub(/#{relative_path}/i, '') # issue git ls-files in submodule's directory - submodule_files = `git ls-files`.split($\) + submodule_files = `git ls-files`.split(/\n+|\r+/) # prepend the submodule path to create relative file paths submodule_files_paths = submodule_files.map do |filename| diff --git a/spec/bucket_spec.rb b/spec/bucket_spec.rb index d5ced5e..c74b888 100644 --- a/spec/bucket_spec.rb +++ b/spec/bucket_spec.rb @@ -1,13 +1,13 @@ # frozen_string_literal: true, encoding: ASCII-8BIT -require 'libcouchbase' -Libcouchbase::Defaults.username = 'tester' -Libcouchbase::Defaults.password = 'password123' +require 'mt-libcouchbase' +MTLibcouchbase::Defaults.username = 'tester' +MTLibcouchbase::Defaults.password = 'password123' -describe Libcouchbase::Bucket do +describe MTLibcouchbase::Bucket do before :each do # This will load the couchbase connection on a different thread - @bucket = Libcouchbase::Bucket.new + @bucket = MTLibcouchbase::Bucket.new @reactor = ::Libuv::Reactor.default @log = [] end @@ -105,7 +105,7 @@ "current #{current}" end @log << result.value - rescue Libcouchbase::Error::KeyExists + rescue MTLibcouchbase::Error::KeyExists @log << :error end } @@ -189,7 +189,7 @@ "current #{current}" end @log << result.value - rescue Libcouchbase::Error::KeyExists + rescue MTLibcouchbase::Error::KeyExists @log << :error end @@ -279,7 +279,7 @@ "current #{current}" end @log << result.value - rescue Libcouchbase::Error::KeyExists + rescue MTLibcouchbase::Error::KeyExists @log << :error end EM.stop diff --git a/spec/connection_spec.rb b/spec/connection_spec.rb index 6ccd12f..0d78b35 100644 --- a/spec/connection_spec.rb +++ b/spec/connection_spec.rb @@ -1,9 +1,9 @@ # frozen_string_literal: true, encoding: ASCII-8BIT -require 'libcouchbase' +require 'mt-libcouchbase' -describe Libcouchbase::Connection do +describe MTLibcouchbase::Connection do before :each do @log = [] expect(@log).to eq([]) @@ -17,7 +17,7 @@ it "should connect and disconnect from the default bucket" do @reactor.run { |reactor| - connection = Libcouchbase::Connection.new + connection = MTLibcouchbase::Connection.new connection.connect.then { @log << true }.finally { connection.destroy } @@ -28,7 +28,7 @@ it "should store a key on the default bucket" do @reactor.run { |reactor| - connection = Libcouchbase::Connection.new + connection = MTLibcouchbase::Connection.new connection.connect.then do connection.store('sometestkey', {"json" => "data"}).then(proc {|resp| @log << resp.callback @@ -43,7 +43,7 @@ it "should durably store a key on the default bucket" do @reactor.run { |reactor| - connection = Libcouchbase::Connection.new + connection = MTLibcouchbase::Connection.new connection.connect.then do connection.store('sometestkey', {"json" => "data2"}, persist_to: -1, replicate_to: -1).then(proc {|resp| @log << resp.callback @@ -58,7 +58,7 @@ it "should fetch a key from the default bucket" do @reactor.run { |reactor| - connection = Libcouchbase::Connection.new + connection = MTLibcouchbase::Connection.new connection.connect.then do connection.get('sometestkey').then(proc {|resp| @log << resp.value @@ -74,7 +74,7 @@ it "should unlock a key on the default bucket" do @reactor.run { |reactor| - connection = Libcouchbase::Connection.new + connection = MTLibcouchbase::Connection.new connection.connect.then do connection.get('sometestkey', lock: 2).then(proc {|resp| @log << resp.callback @@ -94,7 +94,7 @@ it "should remove a key on the default bucket" do @reactor.run { |reactor| - connection = Libcouchbase::Connection.new + connection = MTLibcouchbase::Connection.new connection.connect.then do connection.remove('sometestkey').then(proc {|resp| @log << :success @@ -109,10 +109,10 @@ it "should allow settings to be configured" do @reactor.run { |reactor| - connection = Libcouchbase::Connection.new + connection = MTLibcouchbase::Connection.new connection.connect.then do expect(connection.configure(:operation_timeout, 1500000).value).to be(connection) - expect { connection.configure(:bob, 1500000).value }.to raise_error(Libcouchbase::Error) + expect { connection.configure(:bob, 1500000).value }.to raise_error(MTLibcouchbase::Error) @log << :success connection.destroy end @@ -124,7 +124,7 @@ it "should return the server list" do @reactor.run { |reactor| begin - connection = Libcouchbase::Connection.new + connection = MTLibcouchbase::Connection.new connection.connect.value @log = connection.get_server_list.value ensure @@ -137,7 +137,7 @@ it "should support counter operations" do @reactor.run { |reactor| - connection = Libcouchbase::Connection.new + connection = MTLibcouchbase::Connection.new connection.connect.then do connection.counter('testcount', initial: 10, expire_in: 2) .then(proc { |resp| @@ -156,7 +156,7 @@ it "should support touch operations" do @reactor.run { |reactor| - connection = Libcouchbase::Connection.new + connection = MTLibcouchbase::Connection.new connection.connect.then do connection.store('testtouch', 34).then(proc {|resp| @log << resp.value @@ -164,7 +164,7 @@ @log << 'set' sleep 2 connection.get('testtouch').catch do |err| - @log << err.is_a?(Libcouchbase::Error::KeyNotFound) + @log << err.is_a?(MTLibcouchbase::Error::KeyNotFound) end }) }, proc { |error| @@ -178,7 +178,7 @@ it "should fail to flush unless the connection specifies it is enabled" do @reactor.run { |reactor| - connection = Libcouchbase::Connection.new + connection = MTLibcouchbase::Connection.new connection.connect.then do begin connection.flush.then(proc { @@ -198,7 +198,7 @@ it "should flush when enabled explicitly", flush: true do @reactor.run { |reactor| - connection = Libcouchbase::Connection.new(bucket: :test, username: 'tester', password: 'password123') + connection = MTLibcouchbase::Connection.new(bucket: :test, username: 'tester', password: 'password123') connection.connect(flush_enabled: true).then do begin connection.flush.then(proc { |resp| @@ -218,7 +218,7 @@ it "should perform a HTTP request" do @reactor.run { |reactor| - connection = Libcouchbase::Connection.new + connection = MTLibcouchbase::Connection.new connection.connect.then do connection.http("/pools/default/buckets/#{connection.bucket}/ddocs", type: :management).then( proc { |resp| @@ -237,7 +237,7 @@ it "should fail a HTTP request" do @reactor.run { |reactor| - connection = Libcouchbase::Connection.new + connection = MTLibcouchbase::Connection.new connection.connect.then do connection.http("/pools/default/buckets/#{connection.bucket}/ddocs").then( proc { |resp| diff --git a/spec/design_docs_spec.rb b/spec/design_docs_spec.rb index a0821c2..aa597cd 100644 --- a/spec/design_docs_spec.rb +++ b/spec/design_docs_spec.rb @@ -1,11 +1,11 @@ # frozen_string_literal: true, encoding: ASCII-8BIT -require 'libcouchbase' +require 'mt-libcouchbase' -describe Libcouchbase::DesignDocs, design_docs: true do +describe MTLibcouchbase::DesignDocs, design_docs: true do before :each do - @ddoc = Libcouchbase::Bucket.new.design_docs + @ddoc = MTLibcouchbase::Bucket.new.design_docs end it "should list the available designs" do diff --git a/spec/error_spec.rb b/spec/error_spec.rb index 5ae8fe6..811c820 100644 --- a/spec/error_spec.rb +++ b/spec/error_spec.rb @@ -1,25 +1,25 @@ # frozen_string_literal: true, encoding: ASCII-8BIT -require 'libcouchbase' +require 'mt-libcouchbase' -describe Libcouchbase::Error do +describe MTLibcouchbase::Error do it "define the error classes" do - expect(Libcouchbase::Error::MapChanged.new.is_a? StandardError).to be(true) + expect(MTLibcouchbase::Error::MapChanged.new.is_a? StandardError).to be(true) end it "should be able to look up errors" do - expect(Libcouchbase::Error::Lookup[:empty_key]).to be(Libcouchbase::Error::EmptyKey) - expect(Libcouchbase::Error.lookup(:empty_key)).to be(Libcouchbase::Error::EmptyKey) - expect(Libcouchbase::Error.lookup(:whatwhat_key)).to be(Libcouchbase::Error::UnknownError) - expect(Libcouchbase::Error.lookup(2)).to be(Libcouchbase::Error::AuthError) - expect(Libcouchbase::Error.lookup(-2)).to be(Libcouchbase::Error::UnknownError) + expect(MTLibcouchbase::Error::Lookup[:empty_key]).to be(MTLibcouchbase::Error::EmptyKey) + expect(MTLibcouchbase::Error.lookup(:empty_key)).to be(MTLibcouchbase::Error::EmptyKey) + expect(MTLibcouchbase::Error.lookup(:whatwhat_key)).to be(MTLibcouchbase::Error::UnknownError) + expect(MTLibcouchbase::Error.lookup(2)).to be(MTLibcouchbase::Error::AuthError) + expect(MTLibcouchbase::Error.lookup(-2)).to be(MTLibcouchbase::Error::UnknownError) end it "should be able to catch generic errors" do begin - raise ::Libcouchbase::Error::NoMemory, 'what what' - rescue ::Libcouchbase::Error => e + raise ::MTLibcouchbase::Error::NoMemory, 'what what' + rescue ::MTLibcouchbase::Error => e expect(e.message).to eq('what what') end end diff --git a/spec/fts_spec.rb b/spec/fts_spec.rb index e8bd9ac..efc0ce2 100644 --- a/spec/fts_spec.rb +++ b/spec/fts_spec.rb @@ -1,12 +1,12 @@ # frozen_string_literal: true, encoding: ASCII-8BIT -require 'libcouchbase' +require 'mt-libcouchbase' -describe Libcouchbase::QueryFullText, full_text_search: true do +describe MTLibcouchbase::QueryFullText, full_text_search: true do before :each do # This will load the couchbase connection on a different thread - @bucket = Libcouchbase::Bucket.new + @bucket = MTLibcouchbase::Bucket.new @reactor = ::Libuv::Reactor.default @log = [] end diff --git a/spec/n1ql_spec.rb b/spec/n1ql_spec.rb index 62faceb..821d128 100644 --- a/spec/n1ql_spec.rb +++ b/spec/n1ql_spec.rb @@ -1,10 +1,10 @@ # frozen_string_literal: true, encoding: ASCII-8BIT -require 'libcouchbase' +require 'mt-libcouchbase' -describe Libcouchbase::N1QL, n1ql_query: true do +describe MTLibcouchbase::N1QL, n1ql_query: true do before :each do - @bucket = Libcouchbase::Bucket.new + @bucket = MTLibcouchbase::Bucket.new @n1ql = @bucket.n1ql @log = [] end @@ -86,7 +86,7 @@ it "should cancel iteration" do results = @n1ql.results expect { results.to_a }.to(raise_error do |error| - expect(error).to be_a(Libcouchbase::Error::HttpError) + expect(error).to be_a(MTLibcouchbase::Error::HttpError) expect(error.message).not_to be_empty end) end @@ -165,7 +165,7 @@ it "should cancel iteration" do results = @n1ql.results expect { results.to_a }.to(raise_error do |error| - expect(error).to be_a(Libcouchbase::Error::HttpError) + expect(error).to be_a(MTLibcouchbase::Error::HttpError) expect(error.message).not_to be_empty end) end @@ -251,7 +251,7 @@ it "should cancel iteration" do results = @n1ql.results expect { results.to_a }.to(raise_error do |error| - expect(error).to be_a(Libcouchbase::Error::HttpError) + expect(error).to be_a(MTLibcouchbase::Error::HttpError) expect(error.message).not_to be_empty end) end diff --git a/spec/results_libuv_spec.rb b/spec/results_libuv_spec.rb index a7ca39b..a149b95 100644 --- a/spec/results_libuv_spec.rb +++ b/spec/results_libuv_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true, encoding: ASCII-8BIT -require 'libcouchbase' +require 'mt-libcouchbase' require 'uv-rays' @@ -60,7 +60,7 @@ def cancel end -describe Libcouchbase::ResultsLibuv do +describe MTLibcouchbase::ResultsLibuv do before :each do @log = [] @reactor = ::Libuv::Reactor.default @@ -169,7 +169,7 @@ def cancel it "should handle row modifier exceptions" do count = 0 - @view = Libcouchbase::ResultsLibuv.new(@query) { |view| + @view = MTLibcouchbase::ResultsLibuv.new(@query) { |view| if count == 1 raise 'what what' end @@ -191,7 +191,7 @@ def cancel it "should handle row modifier exceptions on a short query" do count = 0 - @view = Libcouchbase::ResultsLibuv.new(@query) { |view| + @view = MTLibcouchbase::ResultsLibuv.new(@query) { |view| raise 'what what' } @@ -209,7 +209,7 @@ def cancel it "should handle multiple exceptions" do count = 0 - @view = Libcouchbase::ResultsLibuv.new(@query) { |view| + @view = MTLibcouchbase::ResultsLibuv.new(@query) { |view| if count == 1 raise 'second' end diff --git a/spec/results_native_spec.rb b/spec/results_native_spec.rb index 1e5d739..72974fb 100644 --- a/spec/results_native_spec.rb +++ b/spec/results_native_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true, encoding: ASCII-8BIT -require 'libcouchbase' +require 'mt-libcouchbase' require 'uv-rays' @@ -68,13 +68,13 @@ def cancel end -describe Libcouchbase::ResultsNative do +describe MTLibcouchbase::ResultsNative do before :each do reactor = ::Libuv::Reactor.default @qlog = [] @query = NativeMockQuery.new(@qlog, reactor) @log = [] - @view = Libcouchbase::ResultsNative.new(@query) + @view = MTLibcouchbase::ResultsNative.new(@query) expect(@log).to eq([]) end @@ -180,7 +180,7 @@ def cancel it "should handle row modifier exceptions" do count = 0 - @view = Libcouchbase::ResultsNative.new(@query) { |view| + @view = MTLibcouchbase::ResultsNative.new(@query) { |view| if count == 1 raise 'what what' end @@ -203,7 +203,7 @@ def cancel it "should handle row modifier exceptions on a short query" do count = 0 - @view = Libcouchbase::ResultsNative.new(@query) { |view| + @view = MTLibcouchbase::ResultsNative.new(@query) { |view| raise 'what what' } @@ -222,7 +222,7 @@ def cancel it "should handle multiple exceptions" do count = 0 - @view = Libcouchbase::ResultsNative.new(@query) { |view| + @view = MTLibcouchbase::ResultsNative.new(@query) { |view| if count == 1 raise 'second' end diff --git a/spec/subdoc_spec.rb b/spec/subdoc_spec.rb index f2cde35..9a13e59 100644 --- a/spec/subdoc_spec.rb +++ b/spec/subdoc_spec.rb @@ -1,12 +1,12 @@ # frozen_string_literal: true, encoding: ASCII-8BIT -require 'libcouchbase' +require 'mt-libcouchbase' -describe Libcouchbase::SubdocRequest do +describe MTLibcouchbase::SubdocRequest do before :each do # This will load the couchbase connection on a different thread - @bucket = Libcouchbase::Bucket.new + @bucket = MTLibcouchbase::Bucket.new @bucket.set('subkeytest', { bob: 1234, hello: 'this value', @@ -55,7 +55,7 @@ @log << e.class end } - expect(@log).to eq([::Libcouchbase::Error::SubdocPathNotFound]) + expect(@log).to eq([::MTLibcouchbase::Error::SubdocPathNotFound]) end it "should return nil when quiet is true" do @@ -132,7 +132,7 @@ rescue => e @log << e.class end - expect(@log).to eq([::Libcouchbase::Error::SubdocPathNotFound]) + expect(@log).to eq([::MTLibcouchbase::Error::SubdocPathNotFound]) end it "should return nil when quiet is true" do diff --git a/spec/view_spec.rb b/spec/view_spec.rb index 8e4e5fe..afe26d9 100644 --- a/spec/view_spec.rb +++ b/spec/view_spec.rb @@ -1,12 +1,12 @@ # frozen_string_literal: true, encoding: ASCII-8BIT -require 'libcouchbase' +require 'mt-libcouchbase' -describe Libcouchbase::QueryView do +describe MTLibcouchbase::QueryView do before :each do # This will load the couchbase connection on a different thread - @bucket = Libcouchbase::Bucket.new + @bucket = MTLibcouchbase::Bucket.new @reactor = ::Libuv::Reactor.default @log = [] end @@ -39,7 +39,7 @@ it "should fail if a view doesn't exist" do view = @bucket.view('zone', 'alling') - expect { view.first }.to raise_error(Libcouchbase::Error::HttpError) + expect { view.first }.to raise_error(MTLibcouchbase::Error::HttpError) end it "should cancel the request on error" do @@ -110,7 +110,7 @@ it "should fail if a view doesn't exist" do @reactor.run { |reactor| view = @bucket.view('zone', 'alling') - expect { view.first }.to raise_error(Libcouchbase::Error::HttpError) + expect { view.first }.to raise_error(MTLibcouchbase::Error::HttpError) } end @@ -171,7 +171,7 @@ EM.synchrony { begin view = @bucket.view('zone', 'alling') - expect { view.first }.to raise_error(Libcouchbase::Error::HttpError) + expect { view.first }.to raise_error(MTLibcouchbase::Error::HttpError) @log << :made_it_here ensure EM.stop From e47015aca10b25f44cd19adfe3e80c73d54e565f Mon Sep 17 00:00:00 2001 From: giallon Date: Fri, 25 Mar 2022 16:14:22 +0000 Subject: [PATCH 2/8] set gemspec --- mt-libcouchbase.gemspec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mt-libcouchbase.gemspec b/mt-libcouchbase.gemspec index d81fb21..140a45b 100644 --- a/mt-libcouchbase.gemspec +++ b/mt-libcouchbase.gemspec @@ -4,9 +4,9 @@ Gem::Specification.new do |gem| gem.name = "mt-libcouchbase" gem.version = MTLibcouchbase::VERSION gem.license = 'MIT' - gem.authors = ["Stephen von Takach"] - gem.email = ["steve@cotag.me"] - gem.homepage = "https://github.com/cotag/libcouchbase" + gem.authors = ["Giallombardo Nathan"] + gem.email = ["nathan.giallombardo@mapotempo.com"] + gem.homepage = "https://github.com/Mapotempo/mt-libcouchbase" gem.summary = "mt-libcouchbase bindings for Ruby" gem.description = "A wrapper around mt-libcouchbase for Ruby" From a2afc576bf5890ffbdc73f20427b1695122c6821 Mon Sep 17 00:00:00 2001 From: giallon Date: Fri, 25 Mar 2022 16:34:18 +0000 Subject: [PATCH 3/8] fix libuv --- README.md | 2 +- lib/mt-libcouchbase.rb | 2 +- lib/mt-libcouchbase/bucket.rb | 18 +++++++++--------- lib/mt-libcouchbase/connection.rb | 8 ++++---- lib/mt-libcouchbase/ext/mt-libcouchbase.rb | 4 ++-- .../ext/mt-libcouchbase_libuv.rb | 4 ++-- lib/mt-libcouchbase/n1ql.rb | 2 +- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index fb83b6f..185c472 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ Tested on the following Operating Systems: First, you need to load the library: ```ruby -require 'libcouchbase' +require 'mt-libcouchbase' ``` The client will automatically adjust configuration when the cluster rebalances its nodes when nodes are added or deleted therefore this client is "smart". diff --git a/lib/mt-libcouchbase.rb b/lib/mt-libcouchbase.rb index c90ea4d..ea8819f 100644 --- a/lib/mt-libcouchbase.rb +++ b/lib/mt-libcouchbase.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true, encoding: ASCII-8BIT -require 'libuv' +require 'mt-libuv' module MTLibcouchbase require 'mt-libcouchbase/ext/mt-libcouchbase' diff --git a/lib/mt-libcouchbase/bucket.rb b/lib/mt-libcouchbase/bucket.rb index 30f5d2b..de48a76 100644 --- a/lib/mt-libcouchbase/bucket.rb +++ b/lib/mt-libcouchbase/bucket.rb @@ -102,7 +102,7 @@ def get(key, *keys, extended: false, async: false, quiet: @quiet, assemble_hash: if err.is_a? MTLibcouchbase::Error::KeyNotFound nil else - ::Libuv::Q.reject(@reactor, err) + ::MTLibuv::Q.reject(@reactor, err) end } end @@ -131,7 +131,7 @@ def get(key, *keys, extended: false, async: false, quiet: @quiet, assemble_hash: if err.is_a? MTLibcouchbase::Error::KeyNotFound nil else - ::Libuv::Q.reject(@reactor, err) + ::MTLibuv::Q.reject(@reactor, err) end } } @@ -412,7 +412,7 @@ def delete(key, async: false, quiet: true, **opts) if error.is_a? MTLibcouchbase::Error::KeyNotFound false else - ::Libuv::Q.reject(@reactor, error) + ::MTLibuv::Q.reject(@reactor, error) end } end @@ -498,10 +498,10 @@ def view(design, view, include_docs: true, is_spatial: false, **opts, &row_modif view.include_docs = include_docs view.is_spatial = is_spatial - current = ::Libuv::Reactor.current + current = ::MTLibuv::Reactor.current if current && current.running? - ResultsLibuv.new(view, current, &row_modifier) + ResultsMTLibuv.new(view, current, &row_modifier) elsif Object.const_defined?(:EventMachine) && EM.reactor_thread? ResultsEM.new(view, &row_modifier) else @@ -526,9 +526,9 @@ def full_text_search(index, query, **opts, &row_modifier) end fts = @connection.full_text_search(index, **FtsDefaults.merge(opts)) - current = ::Libuv::Reactor.current + current = ::MTLibuv::Reactor.current if current && current.running? - ResultsLibuv.new(fts, current, &row_modifier) + ResultsMTLibuv.new(fts, current, &row_modifier) elsif Object.const_defined?(:EventMachine) && EM.reactor_thread? ResultsEM.new(fts, &row_modifier) else @@ -663,7 +663,7 @@ def get_num_nodes # # @return [Array] def wait_results(*results) - result ::Libuv::Q.all(@reactor, *results.flatten) + result ::MTLibuv::Q.all(@reactor, *results.flatten) end @@ -673,7 +673,7 @@ def wait_results(*results) def result(promise, async = false) return promise if async - current = ::Libuv::Reactor.current + current = ::MTLibuv::Reactor.current if current && current.running? promise.value elsif Object.const_defined?(:EventMachine) && EM.reactor_thread? diff --git a/lib/mt-libcouchbase/connection.rb b/lib/mt-libcouchbase/connection.rb index deb277f..17bb4d1 100644 --- a/lib/mt-libcouchbase/connection.rb +++ b/lib/mt-libcouchbase/connection.rb @@ -70,17 +70,17 @@ def initialize(hosts: Defaults.host, bucket: Defaults.bucket, username: Defaults @bucket = bucket # Configure the event loop settings - @reactor = thread || ::Libuv::Reactor.current || ::Libuv::Reactor.new + @reactor = thread || ::MTLibuv::Reactor.current || ::MTLibuv::Reactor.new @reactor.on_program_interrupt { destroy } @io_ptr = FFI::MemoryPointer.new :pointer, 1 - # Configure Libuv plugin - @io_opts = Ext::Libuv::UVOptions.new + # Configure MTLibuv plugin + @io_opts = Ext::MTLibuv::UVOptions.new @io_opts[:version] = 0 @io_opts[:loop] = @reactor.handle @io_opts[:start_stop_noop] = 1 # We want to control the start and stopping of the loop - err = Ext::Libuv.create_libuv_io_opts(0, @io_ptr, @io_opts) + err = Ext::MTLibuv.create_libuv_io_opts(0, @io_ptr, @io_opts) if err != :success raise Error.lookup(err), 'failed to allocate IO plugin' end diff --git a/lib/mt-libcouchbase/ext/mt-libcouchbase.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase.rb index c037c57..bbe8007 100644 --- a/lib/mt-libcouchbase/ext/mt-libcouchbase.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase.rb @@ -6,10 +6,10 @@ module MTLibcouchbase::Ext if FFI::Platform.windows? ffi_lib ::File.expand_path("../../../../ext/libcouchbase.dll", __FILE__) else - ffi_lib ::File.expand_path("../../../../ext/mt-libcouchbase/build/lib/libcouchbase.#{FFI::Platform::LIBSUFFIX}", __FILE__) + ffi_lib ::File.expand_path("../../../../ext/libcouchbase/build/lib/libcouchbase.#{FFI::Platform::LIBSUFFIX}", __FILE__) end - require 'mt-libcouchbase/ext/libcouchbase_libuv' + require 'mt-libcouchbase/ext/mt-libcouchbase_libuv' autoload :T, 'mt-libcouchbase/ext/mt-libcouchbase/t' autoload :HttpRequestT, 'mt-libcouchbase/ext/mt-libcouchbase/http_request_t' diff --git a/lib/mt-libcouchbase/ext/mt-libcouchbase_libuv.rb b/lib/mt-libcouchbase/ext/mt-libcouchbase_libuv.rb index 32a1559..ef55d59 100644 --- a/lib/mt-libcouchbase/ext/mt-libcouchbase_libuv.rb +++ b/lib/mt-libcouchbase/ext/mt-libcouchbase_libuv.rb @@ -2,12 +2,12 @@ # This file contains all the structures required to configure mtlibcouchbase to use # Libuv as the primary event loop -module MTLibcouchbase::Ext::Libuv +module MTLibcouchbase::Ext::MTLibuv extend FFI::Library if FFI::Platform.windows? ffi_lib ::File.expand_path("../../../../ext/libcouchbase_libuv.dll", __FILE__) else - ffi_lib ::File.expand_path("../../../../ext/mt-libcouchbase/build/lib/libcouchbase_libuv.#{FFI::Platform::LIBSUFFIX}", __FILE__) + ffi_lib ::File.expand_path("../../../../ext/libcouchbase/build/lib/libcouchbase_libuv.#{FFI::Platform::LIBSUFFIX}", __FILE__) end # ref: http://docs.couchbase.com/sdk-api/couchbase-c-client-2.4.8/group__lcb-libuv.html diff --git a/lib/mt-libcouchbase/n1ql.rb b/lib/mt-libcouchbase/n1ql.rb index 9b45355..a9be695 100644 --- a/lib/mt-libcouchbase/n1ql.rb +++ b/lib/mt-libcouchbase/n1ql.rb @@ -67,7 +67,7 @@ def to_s def results(&row_modifier) n1ql_view = @connection.n1ql_query(self) - current = ::Libuv::Reactor.current + current = ::MTLibuv::Reactor.current if current && current.running? ResultsLibuv.new(n1ql_view, current, &row_modifier) elsif Object.const_defined?(:EventMachine) && EM.reactor_thread? From 585345f7fddbc8ef4e578c83dd4360a173e5e063 Mon Sep 17 00:00:00 2001 From: giallon Date: Fri, 25 Mar 2022 17:07:18 +0000 Subject: [PATCH 4/8] udpate libuv and uv-rays --- mt-libcouchbase.gemspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mt-libcouchbase.gemspec b/mt-libcouchbase.gemspec index 140a45b..2f73b95 100644 --- a/mt-libcouchbase.gemspec +++ b/mt-libcouchbase.gemspec @@ -17,12 +17,12 @@ Gem::Specification.new do |gem| gem.add_runtime_dependency 'ffi', '~> 1.9' gem.add_runtime_dependency 'concurrent-ruby', '~> 1.0' - gem.add_runtime_dependency 'mt-libuv', '~> 4.1', '>= 4.1.02' + gem.add_runtime_dependency 'mt-libuv', '~> 4.1', '>= 4.1.03' gem.add_development_dependency 'rake', '~> 11.2' gem.add_development_dependency 'rspec', '~> 3.5' gem.add_development_dependency 'yard', '~> 0.9' - gem.add_development_dependency 'mt-uv-rays', '~> 2.4', '>= 2.4.7' # for libuv spec + gem.add_development_dependency 'mt-uv-rays', '~> 2.4', '>= 2.4.71' # for libuv spec gem.add_development_dependency 'em-synchrony', '~> 1.0' # for eventmachine spec # https://github.com/stakach/ffi-gen From ff087245939813f964683a077d0869c54f90be05 Mon Sep 17 00:00:00 2001 From: giallon Date: Fri, 25 Mar 2022 17:38:17 +0000 Subject: [PATCH 5/8] fix spec with libuv --- spec/bucket_spec.rb | 2 +- spec/connection_spec.rb | 2 +- spec/fts_spec.rb | 2 +- spec/n1ql_spec.rb | 4 ++-- spec/results_libuv_spec.rb | 2 +- spec/results_native_spec.rb | 2 +- spec/subdoc_spec.rb | 2 +- spec/view_spec.rb | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/spec/bucket_spec.rb b/spec/bucket_spec.rb index c74b888..b7ec59d 100644 --- a/spec/bucket_spec.rb +++ b/spec/bucket_spec.rb @@ -8,7 +8,7 @@ before :each do # This will load the couchbase connection on a different thread @bucket = MTLibcouchbase::Bucket.new - @reactor = ::Libuv::Reactor.default + @reactor = ::MTLibuv::Reactor.default @log = [] end diff --git a/spec/connection_spec.rb b/spec/connection_spec.rb index 0d78b35..eb0049f 100644 --- a/spec/connection_spec.rb +++ b/spec/connection_spec.rb @@ -7,7 +7,7 @@ before :each do @log = [] expect(@log).to eq([]) - @reactor = ::Libuv::Reactor.default + @reactor = ::MTLibuv::Reactor.default end after :each do diff --git a/spec/fts_spec.rb b/spec/fts_spec.rb index efc0ce2..5e24679 100644 --- a/spec/fts_spec.rb +++ b/spec/fts_spec.rb @@ -7,7 +7,7 @@ before :each do # This will load the couchbase connection on a different thread @bucket = MTLibcouchbase::Bucket.new - @reactor = ::Libuv::Reactor.default + @reactor = ::MTLibuv::Reactor.default @log = [] end diff --git a/spec/n1ql_spec.rb b/spec/n1ql_spec.rb index 821d128..943b51b 100644 --- a/spec/n1ql_spec.rb +++ b/spec/n1ql_spec.rb @@ -97,7 +97,7 @@ context "without error syntax query" do before :each do @n1ql.select('*').from(:default).where('type == "mod"') - @reactor = ::Libuv::Reactor.default + @reactor = ::MTLibuv::Reactor.default end it "should iterate results" do @@ -160,7 +160,7 @@ context "with error syntax query" do before :each do @n1ql.select('*azdzadazdzadza').from(:default).where('type == "mod"') - @reactor = ::Libuv::Reactor.default + @reactor = ::MTLibuv::Reactor.default end it "should cancel iteration" do results = @n1ql.results diff --git a/spec/results_libuv_spec.rb b/spec/results_libuv_spec.rb index a149b95..ed7c5fb 100644 --- a/spec/results_libuv_spec.rb +++ b/spec/results_libuv_spec.rb @@ -63,7 +63,7 @@ def cancel describe MTLibcouchbase::ResultsLibuv do before :each do @log = [] - @reactor = ::Libuv::Reactor.default + @reactor = ::MTLibuv::Reactor.default @reactor.notifier do |err| @reactor.stop @log << err diff --git a/spec/results_native_spec.rb b/spec/results_native_spec.rb index 72974fb..0dcaaa1 100644 --- a/spec/results_native_spec.rb +++ b/spec/results_native_spec.rb @@ -70,7 +70,7 @@ def cancel describe MTLibcouchbase::ResultsNative do before :each do - reactor = ::Libuv::Reactor.default + reactor = ::MTLibuv::Reactor.default @qlog = [] @query = NativeMockQuery.new(@qlog, reactor) @log = [] diff --git a/spec/subdoc_spec.rb b/spec/subdoc_spec.rb index 9a13e59..ab99b5e 100644 --- a/spec/subdoc_spec.rb +++ b/spec/subdoc_spec.rb @@ -16,7 +16,7 @@ }, another: false }) - @reactor = ::Libuv::Reactor.default + @reactor = ::MTLibuv::Reactor.default @log = [] end diff --git a/spec/view_spec.rb b/spec/view_spec.rb index afe26d9..268ec87 100644 --- a/spec/view_spec.rb +++ b/spec/view_spec.rb @@ -7,7 +7,7 @@ before :each do # This will load the couchbase connection on a different thread @bucket = MTLibcouchbase::Bucket.new - @reactor = ::Libuv::Reactor.default + @reactor = ::MTLibuv::Reactor.default @log = [] end From 7225616cb25a8727e9da71e85b89f12c326e27d1 Mon Sep 17 00:00:00 2001 From: giallon Date: Fri, 25 Mar 2022 17:39:34 +0000 Subject: [PATCH 6/8] update version --- lib/mt-libcouchbase/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mt-libcouchbase/version.rb b/lib/mt-libcouchbase/version.rb index 050dddd..9addabc 100644 --- a/lib/mt-libcouchbase/version.rb +++ b/lib/mt-libcouchbase/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true, encoding: ASCII-8BIT module MTLibcouchbase - VERSION = '1.4.0' + VERSION = '1.4.01' end From 5174828cefd3cdfb72e93eadfb034dcc729372d0 Mon Sep 17 00:00:00 2001 From: giallon Date: Fri, 28 Jul 2023 14:29:07 +0200 Subject: [PATCH 7/8] add extra options --- lib/mt-libcouchbase/connection.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/mt-libcouchbase/connection.rb b/lib/mt-libcouchbase/connection.rb index 17bb4d1..bfb8fd4 100644 --- a/lib/mt-libcouchbase/connection.rb +++ b/lib/mt-libcouchbase/connection.rb @@ -63,7 +63,11 @@ def ref(string) def initialize(hosts: Defaults.host, bucket: Defaults.bucket, username: Defaults.username, password: Defaults.password, thread: nil, **opts) # build host string http://docs.couchbase.com/sdk-api/couchbase-c-client-2.5.6/group__lcb-init.html hosts = Array(hosts).flatten.join(',') - connstr = "couchbase://#{hosts}/#{bucket}" + if hosts.start_with? 'couchbase' + connstr = "#{hosts}/#{bucket}" + else + connstr = "couchbase://#{hosts}/#{bucket}" + end connstr = "#{connstr}?#{opts.map { |k, v| "#{k}=#{v}" }.join('&') }" unless opts.empty? # It's good to know From ed4c2023a70f68dd3a42b85f5b7dbf6560655449 Mon Sep 17 00:00:00 2001 From: giallon Date: Fri, 28 Jul 2023 14:29:33 +0200 Subject: [PATCH 8/8] update version --- lib/mt-libcouchbase/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mt-libcouchbase/version.rb b/lib/mt-libcouchbase/version.rb index 9addabc..4cc44fa 100644 --- a/lib/mt-libcouchbase/version.rb +++ b/lib/mt-libcouchbase/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true, encoding: ASCII-8BIT module MTLibcouchbase - VERSION = '1.4.01' + VERSION = '1.4.02' end