Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support arm64 #2

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Gemfile.lock
.yardoc
bin
Gemfile-custom

vendor
*.gem

*.dll
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,24 +72,24 @@ 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".
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
Expand Down
10 changes: 5 additions & 5 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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



Expand All @@ -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"
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion ext/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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__)
Expand Down
40 changes: 0 additions & 40 deletions lib/libcouchbase.rb

This file was deleted.

40 changes: 40 additions & 0 deletions lib/mt-libcouchbase.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# frozen_string_literal: true, encoding: ASCII-8BIT

require 'mt-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
Loading