libcouchbase-mapo 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +20 -0
- data/.gitmodules +3 -0
- data/.rspec +1 -0
- data/.travis.yml +38 -0
- data/Gemfile +4 -0
- data/LICENSE +24 -0
- data/README.md +445 -0
- data/Rakefile +76 -0
- data/ext/README.md +6 -0
- data/ext/Rakefile +19 -0
- data/lib/libcouchbase.rb +40 -0
- data/lib/libcouchbase/bucket.rb +825 -0
- data/lib/libcouchbase/callbacks.rb +69 -0
- data/lib/libcouchbase/connection.rb +886 -0
- data/lib/libcouchbase/design_docs.rb +92 -0
- data/lib/libcouchbase/error.rb +68 -0
- data/lib/libcouchbase/ext/libcouchbase.rb +1175 -0
- data/lib/libcouchbase/ext/libcouchbase/cmdbase.rb +23 -0
- data/lib/libcouchbase/ext/libcouchbase/cmdcounter.rb +36 -0
- data/lib/libcouchbase/ext/libcouchbase/cmdendure.rb +26 -0
- data/lib/libcouchbase/ext/libcouchbase/cmdfts.rb +24 -0
- data/lib/libcouchbase/ext/libcouchbase/cmdget.rb +30 -0
- data/lib/libcouchbase/ext/libcouchbase/cmdgetreplica.rb +49 -0
- data/lib/libcouchbase/ext/libcouchbase/cmdhttp.rb +58 -0
- data/lib/libcouchbase/ext/libcouchbase/cmdn1ql.rb +40 -0
- data/lib/libcouchbase/ext/libcouchbase/cmdobseqno.rb +33 -0
- data/lib/libcouchbase/ext/libcouchbase/cmdobserve.rb +30 -0
- data/lib/libcouchbase/ext/libcouchbase/cmdstore.rb +40 -0
- data/lib/libcouchbase/ext/libcouchbase/cmdstoredur.rb +45 -0
- data/lib/libcouchbase/ext/libcouchbase/cmdsubdoc.rb +61 -0
- data/lib/libcouchbase/ext/libcouchbase/cmdverbosity.rb +29 -0
- data/lib/libcouchbase/ext/libcouchbase/cmdviewquery.rb +61 -0
- data/lib/libcouchbase/ext/libcouchbase/contigbuf.rb +14 -0
- data/lib/libcouchbase/ext/libcouchbase/create_st.rb +15 -0
- data/lib/libcouchbase/ext/libcouchbase/create_st0.rb +23 -0
- data/lib/libcouchbase/ext/libcouchbase/create_st1.rb +26 -0
- data/lib/libcouchbase/ext/libcouchbase/create_st2.rb +32 -0
- data/lib/libcouchbase/ext/libcouchbase/create_st3.rb +26 -0
- data/lib/libcouchbase/ext/libcouchbase/crst_u.rb +20 -0
- data/lib/libcouchbase/ext/libcouchbase/durability_opts_st_v.rb +11 -0
- data/lib/libcouchbase/ext/libcouchbase/durability_opts_t.rb +14 -0
- data/lib/libcouchbase/ext/libcouchbase/durabilityopt_sv0.rb +63 -0
- data/lib/libcouchbase/ext/libcouchbase/enums.rb +1007 -0
- data/lib/libcouchbase/ext/libcouchbase/fragbuf.rb +18 -0
- data/lib/libcouchbase/ext/libcouchbase/ftshandle.rb +7 -0
- data/lib/libcouchbase/ext/libcouchbase/histogram.rb +34 -0
- data/lib/libcouchbase/ext/libcouchbase/http_request_t.rb +7 -0
- data/lib/libcouchbase/ext/libcouchbase/keybuf.rb +20 -0
- data/lib/libcouchbase/ext/libcouchbase/multicmd_ctx.rb +30 -0
- data/lib/libcouchbase/ext/libcouchbase/mutation_token.rb +17 -0
- data/lib/libcouchbase/ext/libcouchbase/n1qlhandle.rb +7 -0
- data/lib/libcouchbase/ext/libcouchbase/n1qlparams.rb +7 -0
- data/lib/libcouchbase/ext/libcouchbase/respbase.rb +29 -0
- data/lib/libcouchbase/ext/libcouchbase/respcounter.rb +32 -0
- data/lib/libcouchbase/ext/libcouchbase/respendure.rb +49 -0
- data/lib/libcouchbase/ext/libcouchbase/respfts.rb +40 -0
- data/lib/libcouchbase/ext/libcouchbase/respget.rb +44 -0
- data/lib/libcouchbase/ext/libcouchbase/resphttp.rb +48 -0
- data/lib/libcouchbase/ext/libcouchbase/respmcversion.rb +38 -0
- data/lib/libcouchbase/ext/libcouchbase/respn1ql.rb +41 -0
- data/lib/libcouchbase/ext/libcouchbase/respobseqno.rb +52 -0
- data/lib/libcouchbase/ext/libcouchbase/respobserve.rb +41 -0
- data/lib/libcouchbase/ext/libcouchbase/respserverbase.rb +32 -0
- data/lib/libcouchbase/ext/libcouchbase/respstats.rb +38 -0
- data/lib/libcouchbase/ext/libcouchbase/respstore.rb +32 -0
- data/lib/libcouchbase/ext/libcouchbase/respstoredur.rb +38 -0
- data/lib/libcouchbase/ext/libcouchbase/respsubdoc.rb +35 -0
- data/lib/libcouchbase/ext/libcouchbase/respviewquery.rb +67 -0
- data/lib/libcouchbase/ext/libcouchbase/sdentry.rb +22 -0
- data/lib/libcouchbase/ext/libcouchbase/sdspec.rb +31 -0
- data/lib/libcouchbase/ext/libcouchbase/t.rb +7 -0
- data/lib/libcouchbase/ext/libcouchbase/valbuf.rb +22 -0
- data/lib/libcouchbase/ext/libcouchbase/valbuf_u_buf.rb +14 -0
- data/lib/libcouchbase/ext/libcouchbase/viewhandle.rb +7 -0
- data/lib/libcouchbase/ext/libcouchbase_libuv.rb +22 -0
- data/lib/libcouchbase/ext/tasks.rb +39 -0
- data/lib/libcouchbase/n1ql.rb +78 -0
- data/lib/libcouchbase/query_full_text.rb +147 -0
- data/lib/libcouchbase/query_n1ql.rb +123 -0
- data/lib/libcouchbase/query_view.rb +135 -0
- data/lib/libcouchbase/results_fiber.rb +281 -0
- data/lib/libcouchbase/results_native.rb +220 -0
- data/lib/libcouchbase/subdoc_request.rb +139 -0
- data/lib/libcouchbase/version.rb +5 -0
- data/libcouchbase.gemspec +68 -0
- data/spec/bucket_spec.rb +290 -0
- data/spec/connection_spec.rb +257 -0
- data/spec/design_docs_spec.rb +31 -0
- data/spec/error_spec.rb +26 -0
- data/spec/fts_spec.rb +135 -0
- data/spec/n1ql_spec.rb +206 -0
- data/spec/results_libuv_spec.rb +244 -0
- data/spec/results_native_spec.rb +259 -0
- data/spec/seed/2016-10-25T043505Z/2016-10-25T043505Z-full/bucket-default/design.json +1 -0
- data/spec/seed/2016-10-25T043505Z/2016-10-25T043505Z-full/bucket-default/node-127.0.0.1%3A8091/data-0000.cbb +0 -0
- data/spec/seed/2016-10-25T043505Z/2016-10-25T043505Z-full/bucket-default/node-127.0.0.1%3A8091/failover.json +1 -0
- data/spec/seed/2016-10-25T043505Z/2016-10-25T043505Z-full/bucket-default/node-127.0.0.1%3A8091/meta.json +1 -0
- data/spec/seed/2016-10-25T043505Z/2016-10-25T043505Z-full/bucket-default/node-127.0.0.1%3A8091/seqno.json +1 -0
- data/spec/seed/2016-10-25T043505Z/2016-10-25T043505Z-full/bucket-default/node-127.0.0.1%3A8091/snapshot_markers.json +1 -0
- data/spec/subdoc_spec.rb +192 -0
- data/spec/view_spec.rb +201 -0
- data/windows_build.md +36 -0
- metadata +265 -0
@@ -0,0 +1 @@
|
|
1
|
+
[{"controllers": {"compact": "/pools/default/buckets/default/ddocs/_design%2Fapj/controller/compactView", "setUpdateMinChanges": "/pools/default/buckets/default/ddocs/_design%2Fapj/controller/setUpdateMinChanges"}, "doc": {"json": {"timestamp": 1449534183, "signature": "4069482466f97adcf9a83f4b26d0f027", "language": "javascript", "views": {"by_article_id": {"map": "function(doc) {\n if(doc.type === \"apj\") {\n emit(doc.article_id, null);\n }\n}"}, "by_playlist_revision_id": {"map": "function(doc) {\n if(doc.type === \"apj\") {\n emit(doc.playlist_revision_id, null);\n }\n}"}}}, "meta": {"rev": "1-2def23cb", "id": "_design/apj"}}}, {"controllers": {"compact": "/pools/default/buckets/default/ddocs/_design%2Fart/controller/compactView", "setUpdateMinChanges": "/pools/default/buckets/default/ddocs/_design%2Fart/controller/setUpdateMinChanges"}, "doc": {"json": {"timestamp": 1449534183, "signature": "534867a162ac70c4ccfccd708e20b972", "language": "javascript", "views": {"by_user_id": {"map": "function(doc) {\n if(doc.type === \"art\") {\n emit(doc.user_id, null);\n }\n}"}, "by_group_id": {"map": "function(doc) {\n if(doc.type === \"art\") {\n emit(doc.group_id, null);\n }\n}"}, "by_location_id": {"map": "function(doc) {\n if(doc.type === \"art\") {\n emit(doc.location_id, null);\n }\n}"}}}, "meta": {"rev": "1-008892c4", "id": "_design/art"}}}, {"controllers": {"compact": "/pools/default/buckets/default/ddocs/_design%2Fcgj/controller/compactView", "setUpdateMinChanges": "/pools/default/buckets/default/ddocs/_design%2Fcgj/controller/setUpdateMinChanges"}, "doc": {"json": {"timestamp": 1449534183, "signature": "6079e92d50dba8f2103c79c7f82e17d7", "language": "javascript", "views": {"by_channel_id": {"map": "function(doc) {\n if(doc.type === \"cgj\") {\n emit(doc.channel_id, null);\n }\n}"}, "by_group_id": {"map": "function(doc) {\n if(doc.type === \"cgj\") {\n emit(doc.group_id, null);\n }\n}"}}}, "meta": {"rev": "1-0d66f57f", "id": "_design/cgj"}}}, {"controllers": {"compact": "/pools/default/buckets/default/ddocs/_design%2Fcha/controller/compactView", "setUpdateMinChanges": "/pools/default/buckets/default/ddocs/_design%2Fcha/controller/setUpdateMinChanges"}, "doc": {"json": {"timestamp": 1449534189, "signature": "70af4456ab7aadf24664ee7923900ede", "language": "javascript", "views": {"by_authority_id": {"map": "function(doc, meta) {\n if(doc.type === \"cha\") {\n emit(doc.authority_id, null);\n }\n}"}, "by_group_id": {"map": "function(doc, meta) {\n if(doc.type === \"cha\") {\n emit(doc.group_id, null);\n }\n}"}}}, "meta": {"rev": "1-0ff341a5", "id": "_design/cha"}}}, {"controllers": {"compact": "/pools/default/buckets/default/ddocs/_design%2Fcom/controller/compactView", "setUpdateMinChanges": "/pools/default/buckets/default/ddocs/_design%2Fcom/controller/setUpdateMinChanges"}, "doc": {"json": {"timestamp": 1449534183, "signature": "d95ecdee424507f07b2931da53734038", "language": "javascript", "views": {"by_article_id": {"map": "function(doc) {\n if(doc.type === \"com\") {\n emit(doc.article_id, null);\n }\n}"}, "by_parent_id": {"map": "function(doc) {\n if(doc.type === \"com\" && doc.in_reply_to_id) {\n emit(doc.in_reply_to_id, null);\n }\n}"}, "by_user_id": {"map": "function(doc) {\n if(doc.type === \"com\") {\n emit(doc.user_id, null);\n }\n}"}}}, "meta": {"rev": "1-6dd715e7", "id": "_design/com"}}}, {"controllers": {"compact": "/pools/default/buckets/default/ddocs/_design%2Fdev_co_upld/controller/compactView", "setUpdateMinChanges": "/pools/default/buckets/default/ddocs/_design%2Fdev_co_upld/controller/setUpdateMinChanges"}, "doc": {"json": {"timestamp": 1456725608, "signature": "2c2251df30d0e571f26ca01aafe5e8e4", "language": "javascript", "views": {"by_user_id": {"map": "function(doc) {\n if(doc.type === 'co_upld') {\n emit(doc.user_id, null);\n }\n}"}}}, "meta": {"rev": "1-43966799", "id": "_design/dev_co_upld"}}}, {"controllers": {"compact": "/pools/default/buckets/default/ddocs/_design%2Fdk_ag/controller/compactView", "setUpdateMinChanges": "/pools/default/buckets/default/ddocs/_design%2Fdk_ag/controller/setUpdateMinChanges"}, "doc": {"json": {"timestamp": 1440135846, "signature": "38b93a75feba55556ad0e33944d2ad4e", "language": "javascript", "views": {"by_application_id": {"map": "function(doc) {\n if(doc.type === 'dk_ag' && doc.application_id) {\n emit([doc.application_id], null);\n }\n}"}}}, "meta": {"rev": "1-595617a4", "id": "_design/dk_ag"}}}, {"controllers": {"compact": "/pools/default/buckets/default/ddocs/_design%2Fdk_app/controller/compactView", "setUpdateMinChanges": "/pools/default/buckets/default/ddocs/_design%2Fdk_app/controller/setUpdateMinChanges"}, "doc": {"json": {"timestamp": 1440135846, "signature": "7d9784d62037da92df6d0952a8fdc7ef", "language": "javascript", "views": {"show_all": {"map": "function (doc, meta)\n{\n if(doc.type === 'dk_app') {\n emit(null, [doc.name, doc.secret, doc.redirect_uri]);\n }\n}"}, "by_user_id": {"map": "function(doc) {\n if(doc.type === 'dk_app') {\n emit([doc.user_id], null);\n }\n}"}}}, "meta": {"rev": "1-4c3cfb4e", "id": "_design/dk_app"}}}, {"controllers": {"compact": "/pools/default/buckets/default/ddocs/_design%2Fdk_at/controller/compactView", "setUpdateMinChanges": "/pools/default/buckets/default/ddocs/_design%2Fdk_at/controller/setUpdateMinChanges"}, "doc": {"json": {"timestamp": 1440135846, "signature": "2aed88e1bcdded7f43fa7336c212ec27", "language": "javascript", "views": {"by_application_id_and_resource_owner_id": {"map": "function(doc) {\n if(doc.type === 'dk_at' && doc.application_id && doc.resource_owner_id && !doc.revoked_at) {\n emit([doc.application_id, doc.resource_owner_id], null);\n }\n}"}, "by_application_id": {"map": "function(doc) {\n if(doc.type === 'dk_at' && doc.application_id) {\n emit([doc.application_id], null);\n }\n}"}, "by_resource_owner_id": {"map": "function(doc) {\n if(doc.type === 'dk_at' && doc.resource_owner_id && !doc.revoked_at) {\n emit([doc.resource_owner_id], null);\n }\n}"}}}, "meta": {"rev": "1-6a22e611", "id": "_design/dk_at"}}}, {"controllers": {"compact": "/pools/default/buckets/default/ddocs/_design%2Fedge/controller/compactView", "setUpdateMinChanges": "/pools/default/buckets/default/ddocs/_design%2Fedge/controller/setUpdateMinChanges"}, "doc": {"json": {"timestamp": 1459901603, "signature": "32ad67723b2ce9e2122f72b2a9c2778c", "language": "javascript", "views": {"by_master_id": {"map": "function(doc, meta) {\n if(doc.type === \"edge\") {\n emit(meta.master_id, null);\n }\n}"}}}, "meta": {"rev": "1-27779ca1", "id": "_design/edge"}}}, {"controllers": {"compact": "/pools/default/buckets/default/ddocs/_design%2Fgrp/controller/compactView", "setUpdateMinChanges": "/pools/default/buckets/default/ddocs/_design%2Fgrp/controller/setUpdateMinChanges"}, "doc": {"json": {"timestamp": 1449534189, "signature": "cfff7fffecbfc0d542128b85e0503999", "language": "javascript", "views": {"by_default_playlist_id": {"map": "function(doc) {\n if(doc.type === \"grp\") {\n emit(doc.default_playlist_id, null);\n }\n}"}, "by_authority_id": {"map": "function(doc, meta) {\n if(doc.type === \"grp\") {\n emit(doc.authority_id, null);\n }\n}"}}}, "meta": {"rev": "1-4ba8ce66", "id": "_design/grp"}}}, {"controllers": {"compact": "/pools/default/buckets/default/ddocs/_design%2Finv/controller/compactView", "setUpdateMinChanges": "/pools/default/buckets/default/ddocs/_design%2Finv/controller/setUpdateMinChanges"}, "doc": {"json": {"timestamp": 1420417617, "signature": "76e7bcb8575a9c02d72be10ddeb88232", "language": "javascript", "views": {"by_group_id": {"map": "function(doc) {\n if(doc.type === \"inv\") {\n emit(doc.group_id, null);\n }\n}"}, "by_user_id": {"map": "function(doc) {\n if(doc.type === \"inv\") {\n emit(doc.user_id, null);\n }\n}"}}}, "meta": {"rev": "1-6af78cb6", "id": "_design/inv"}}}, {"controllers": {"compact": "/pools/default/buckets/default/ddocs/_design%2Fmod/controller/compactView", "setUpdateMinChanges": "/pools/default/buckets/default/ddocs/_design%2Fmod/controller/setUpdateMinChanges"}, "doc": {"json": {"timestamp": 1473819281, "signature": "d7d3bfe1bfffe7075952f24843110274", "language": "javascript", "views": {"by_node": {"map": "function(doc) {\n if(doc.type === \"mod\") {\n emit(doc.edge_id, null);\n }\n}"}, "by_module_type": {"map": "function(doc) {\n if(doc.type === \"mod\") {\n emit(doc.role, null);\n }\n}"}, "by_dependency": {"map": "function(doc) {\n if(doc.type === \"mod\" && doc.dependency_id) {\n emit(doc.dependency_id, null);\n }\n}"}}}, "meta": {"rev": "11-57b63d8d", "id": "_design/mod"}}}, {"controllers": {"compact": "/pools/default/buckets/default/ddocs/_design%2Foauth/controller/compactView", "setUpdateMinChanges": "/pools/default/buckets/default/ddocs/_design%2Foauth/controller/setUpdateMinChanges"}, "doc": {"json": {"timestamp": 1474531273, "signature": "d1e55f525baae771487bad50e893e004", "language": "javascript", "views": {"by_user_id": {"map": "function(doc) {\n if(doc.type === \"oauth\") {\n emit(doc.user_id, null);\n }\n}"}}}, "meta": {"rev": "3-c4b78aa6", "id": "_design/oauth"}}}, {"controllers": {"compact": "/pools/default/buckets/default/ddocs/_design%2Fone/controller/compactView", "setUpdateMinChanges": "/pools/default/buckets/default/ddocs/_design%2Fone/controller/setUpdateMinChanges"}, "doc": {"json": {"timestamp": 1449534183, "signature": "44158ceb763160a8e8af92256c5f5027", "language": "javascript", "views": {"by_owner_id": {"map": "function(doc) {\n if(doc.type === \"one\") {\n emit(doc.owner_id, null);\n }\n}"}}}, "meta": {"rev": "1-0b5aae9a", "id": "_design/one"}}}, {"controllers": {"compact": "/pools/default/buckets/default/ddocs/_design%2Fpgj/controller/compactView", "setUpdateMinChanges": "/pools/default/buckets/default/ddocs/_design%2Fpgj/controller/setUpdateMinChanges"}, "doc": {"json": {"timestamp": 1449534183, "signature": "199e3a411f684a5c69e3a25c6a5e67d9", "language": "javascript", "views": {"by_group_id": {"map": "function(doc) {\n if(doc.type === \"pgj\") {\n emit(doc.group_id, null);\n }\n}"}, "by_playlist_id": {"map": "function(doc) {\n if(doc.type === \"pgj\") {\n emit(doc.playlist_id, null);\n }\n}"}}}, "meta": {"rev": "1-45aef866", "id": "_design/pgj"}}}, {"controllers": {"compact": "/pools/default/buckets/default/ddocs/_design%2Fply/controller/compactView", "setUpdateMinChanges": "/pools/default/buckets/default/ddocs/_design%2Fply/controller/setUpdateMinChanges"}, "doc": {"json": {"timestamp": 1449534183, "signature": "d0984aed4108bd5018e6096070d83e19", "language": "javascript", "views": {"by_group_id": {"map": "function(doc) {\n if(doc.type === \"ply\") {\n emit(doc.group_id, null);\n }\n}"}}}, "meta": {"rev": "1-071182a4", "id": "_design/ply"}}}, {"controllers": {"compact": "/pools/default/buckets/default/ddocs/_design%2Fstrat/controller/compactView", "setUpdateMinChanges": "/pools/default/buckets/default/ddocs/_design%2Fstrat/controller/setUpdateMinChanges"}, "doc": {"json": {"timestamp": 1444389773, "signature": "a5980fa50d4f89bb693ce321e2d063f9", "language": "javascript", "views": {"by_name": {"map": "function(doc) {\n if(doc.type === \"strat\") {\n emit(doc.name, null);\n }\n}"}}}, "meta": {"rev": "1-430d0c83", "id": "_design/strat"}}}, {"controllers": {"compact": "/pools/default/buckets/default/ddocs/_design%2Fsys/controller/compactView", "setUpdateMinChanges": "/pools/default/buckets/default/ddocs/_design%2Fsys/controller/setUpdateMinChanges"}, "doc": {"json": {"timestamp": 1473819281, "signature": "9c88821ef9f7a6dcbafc753bb3d0471e", "language": "javascript", "views": {"by_node": {"map": "function(doc) {\n if(doc.type === \"sys\") {\n emit(doc.edge_id, null);\n }\n}"}, "by_modules": {"map": "function(doc) {\n if(doc.type === \"sys\") {\n var i;\n for (i = 0; i < doc.modules.length; i += 1) {\n emit(doc.modules[i], null);\n }\n }\n}"}, "by_zones": {"map": "function(doc) {\n if(doc.type === \"sys\") {\n var i;\n for (i = 0; i < doc.zones.length; i++) {\n emit(doc.zones[i], null);\n }\n }\n}"}}}, "meta": {"rev": "11-2df10318", "id": "_design/sys"}}}, {"controllers": {"compact": "/pools/default/buckets/default/ddocs/_design%2Ftrig/controller/compactView", "setUpdateMinChanges": "/pools/default/buckets/default/ddocs/_design%2Ftrig/controller/setUpdateMinChanges"}, "doc": {"json": {"timestamp": 1450308991, "signature": "5cbe2f53ec35e6cb6464ca27e729f15e", "language": "javascript", "views": {"by_system_id": {"map": "function(doc) {\n if(doc.type === \"trig\") {\n emit(doc.control_system_id, null);\n }\n}"}, "by_trigger_id": {"map": "function(doc) {\n if(doc.type === \"trig\") {\n emit(doc.trigger_id, null);\n }\n}"}}}, "meta": {"rev": "1-a5d9b8c0", "id": "_design/trig"}}}, {"controllers": {"compact": "/pools/default/buckets/default/ddocs/_design%2Fugj/controller/compactView", "setUpdateMinChanges": "/pools/default/buckets/default/ddocs/_design%2Fugj/controller/setUpdateMinChanges"}, "doc": {"json": {"timestamp": 1449534183, "signature": "5570cdeb962793ed2a32da516e499bf5", "language": "javascript", "views": {"by_group_id": {"map": "function(doc) {\n if(doc.type === \"ugj\") {\n emit(doc.group_id, null);\n }\n}"}, "by_user_id": {"map": "function(doc) {\n if(doc.type === \"ugj\") {\n emit(doc.user_id, null);\n }\n}"}}}, "meta": {"rev": "1-6d59aa6b", "id": "_design/ugj"}}}, {"controllers": {"compact": "/pools/default/buckets/default/ddocs/_design%2Fuser/controller/compactView", "setUpdateMinChanges": "/pools/default/buckets/default/ddocs/_design%2Fuser/controller/setUpdateMinChanges"}, "doc": {"json": {"timestamp": 1450308991, "signature": "6f1b618dca27de1d6e66147678f1c8bc", "language": "javascript", "views": {"is_sys_admin": {"map": "function(doc) {\n if(doc.type === \"user\") {\n emit(doc.sys_admin, null);\n }\n}"}}}, "meta": {"rev": "54-5d7f91d5", "id": "_design/user"}}}, {"controllers": {"compact": "/pools/default/buckets/default/ddocs/_design%2Fzone/controller/compactView", "setUpdateMinChanges": "/pools/default/buckets/default/ddocs/_design%2Fzone/controller/setUpdateMinChanges"}, "doc": {"json": {"timestamp": 1473819281, "signature": "f9b03c494d9867051e935ec6f24f3fac", "language": "javascript", "views": {"all": {"map": "function(doc, meta) {\n if(doc.type === \"zone\") {\n emit(meta.id, null);\n }\n}"}}}, "meta": {"rev": "11-8bebbd9c", "id": "_design/zone"}}}]
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
{"56": [[42449419426105, 57], [253088081217913, 0]], "54": [[162201745281900, 69], [195179543573105, 0]], "42": [[114858039659261, 38], [108257448043855, 0]], "48": [[1804497062527, 31], [21948309493873, 0]], "43": [[221402225886203, 70], [160963155286436, 0]], "60": [[268942750003774, 125], [247989376995555, 0]], "61": [[223640469719678, 59], [219457887134182, 0]], "62": [[139791041923058, 45], [84703924882030, 0]], "63": [[254849306208375, 25], [135067130969623, 0]], "49": [[179189724841062, 103], [230275367254723, 0]], "52": [[104963082399531, 24], [266235778469523, 0]], "53": [[44376446670743, 130], [3915336486596, 0]], "24": [[22740492541543, 50], [216402437546745, 0]], "25": [[81173336144657, 43], [217560333449550, 0]], "26": [[102677538467385, 64], [119816168670315, 0]], "27": [[205923291766978, 367], [203716637023979, 0]], "20": [[99035733432583, 66], [260683107156201, 0]], "21": [[127813596753381, 46], [213757540460416, 0]], "22": [[92879747213450, 66], [57579329978784, 0]], "23": [[213729760774170, 47], [7036202856455, 0]], "46": [[181201894620710, 36], [256306839259559, 0]], "47": [[270397595997813, 70], [46006603018088, 0]], "44": [[131891739479476, 196], [116956814505223, 0]], "45": [[263630506892207, 53], [243709602938783, 0]], "28": [[232247998660695, 51], [258584920542151, 0]], "29": [[90351597494001, 38], [89207708894630, 0]], "40": [[27994518248241, 60], [5974709834551, 0]], "41": [[187452997419276, 77], [108620773223935, 0]], "1": [[203965907439099, 82], [185943553555221, 0]], "0": [[22761749970989, 52], [183402860277167, 0]], "3": [[261634211184183, 43], [53751070124458, 0]], "2": [[122415381790204, 57], [50424095935982, 0]], "5": [[109910742961044, 57], [33494617450058, 0]], "4": [[42133860166790, 53], [122682660641243, 0]], "7": [[45307592693900, 51], [74868115989434, 0]], "6": [[198247629538367, 51], [56292430541970, 0]], "9": [[8626652371396, 418], [194873299335900, 0]], "8": [[237322956791274, 98], [189259812994842, 0]], "51": [[240478534025888, 25], [97057916786073, 0]], "39": [[178444930418573, 59], [259582663188927, 0]], "38": [[224580299070612, 50], [235170934487601, 0]], "59": [[166526025012530, 35], [187653510646750, 0]], "58": [[199231837558187, 50], [155022911874273, 0]], "11": [[46642237056764, 25], [106731066681389, 0]], "10": [[193506125738549, 25], [271376598838983, 0]], "13": [[200585130045249, 57], [161145614243961, 0]], "12": [[21764434456679, 32], [76233998458112, 0]], "15": [[110836611606735, 87], [231766306625151, 0]], "14": [[155905930931841, 523], [195570648869090, 0]], "17": [[182780105393980, 42], [212843328403709, 0]], "16": [[256620850789431, 213], [91963329745567, 0]], "19": [[155705547742576, 39], [241845666844441, 0]], "18": [[13935337450779, 346], [115268731524988, 0]], "31": [[84205401485134, 61], [56683335467391, 0]], "30": [[96382718082182, 165], [189231437091045, 0]], "37": [[173533360500213, 45], [77549636710959, 0]], "36": [[257479147039839, 55], [261595129139126, 0]], "35": [[38473900898526, 183], [110704553858424, 0]], "34": [[197583061668583, 92], [80092352509699, 0]], "33": [[140025289883450, 346], [14535271323203, 0]], "55": [[104030549841653, 83], [218737416399533, 0]], "32": [[53914380920527, 36], [159770310740105, 0]], "57": [[203256941096694, 46], [3184462002917, 0]], "50": [[70919300537036, 138], [202287430248329, 0]]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"pred": []}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"56": 292, "54": 545, "42": 1390, "48": 125, "43": 217, "60": 179, "61": 249, "62": 158, "63": 228, "49": 583, "52": 149, "53": 237, "24": 138, "25": 213, "26": 210, "27": 973, "20": 455, "21": 420, "22": 154, "23": 130, "46": 121, "47": 186, "44": 2102, "45": 165, "28": 139, "29": 850, "40": 616, "41": 771, "1": 368, "0": 213, "3": 376, "2": 183, "5": 2853, "4": 316, "7": 176, "6": 179, "9": 16049, "8": 222, "51": 117, "39": 168, "38": 645, "59": 142, "58": 967, "11": 214, "10": 142, "13": 200, "12": 157, "15": 183, "14": 596, "17": 131, "16": 312, "19": 423, "18": 801, "31": 161, "30": 324, "37": 117, "36": 211, "35": 366, "34": 285, "33": 954, "55": 243, "32": 188, "57": 259, "50": 216}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"56": [0, 292], "54": [0, 545], "42": [0, 1390], "48": [0, 125], "43": [0, 217], "60": [0, 179], "61": [0, 249], "62": [0, 158], "63": [0, 228], "49": [0, 583], "52": [0, 149], "53": [0, 237], "24": [0, 138], "25": [0, 213], "26": [0, 210], "27": [0, 973], "20": [0, 455], "21": [0, 420], "22": [0, 154], "23": [0, 130], "46": [0, 121], "47": [0, 186], "44": [0, 2102], "45": [0, 165], "28": [0, 139], "29": [0, 850], "40": [0, 616], "41": [0, 771], "1": [0, 368], "0": [0, 213], "3": [0, 376], "2": [0, 183], "5": [0, 2853], "4": [0, 316], "7": [0, 176], "6": [0, 179], "9": [0, 16049], "8": [0, 222], "51": [0, 117], "39": [0, 168], "38": [0, 645], "59": [0, 142], "58": [0, 967], "11": [0, 214], "10": [0, 142], "13": [0, 200], "12": [0, 157], "15": [0, 183], "14": [0, 596], "17": [0, 131], "16": [0, 312], "19": [0, 423], "18": [0, 801], "31": [0, 161], "30": [0, 324], "37": [0, 117], "36": [0, 211], "35": [0, 366], "34": [0, 285], "33": [0, 954], "55": [0, 243], "32": [0, 188], "57": [0, 259], "50": [0, 216]}
|
data/spec/subdoc_spec.rb
ADDED
@@ -0,0 +1,192 @@
|
|
1
|
+
# frozen_string_literal: true, encoding: ASCII-8BIT
|
2
|
+
|
3
|
+
require 'libcouchbase'
|
4
|
+
|
5
|
+
|
6
|
+
describe Libcouchbase::SubdocRequest do
|
7
|
+
before :each do
|
8
|
+
# This will load the couchbase connection on a different thread
|
9
|
+
@bucket = Libcouchbase::Bucket.new
|
10
|
+
@bucket.set('subkeytest', {
|
11
|
+
bob: 1234,
|
12
|
+
hello: 'this value',
|
13
|
+
complex: {
|
14
|
+
more: "information",
|
15
|
+
age: 12
|
16
|
+
},
|
17
|
+
another: false
|
18
|
+
})
|
19
|
+
@reactor = ::Libuv::Reactor.default
|
20
|
+
@log = []
|
21
|
+
end
|
22
|
+
|
23
|
+
after :each do
|
24
|
+
@bucket = nil
|
25
|
+
@reactor = nil
|
26
|
+
@log = nil
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'reactor loop' do
|
30
|
+
it "should lookup a subkey" do
|
31
|
+
@reactor.run { |reactor|
|
32
|
+
@log = @bucket.subdoc(:subkeytest) do |subdoc|
|
33
|
+
subdoc.get(:hello)
|
34
|
+
end
|
35
|
+
}
|
36
|
+
|
37
|
+
expect(@log).to eq('this value')
|
38
|
+
end
|
39
|
+
|
40
|
+
it "should perform multiple lookup operations" do
|
41
|
+
@reactor.run { |reactor|
|
42
|
+
@log = @bucket.subdoc(:subkeytest) do |subdoc|
|
43
|
+
subdoc.get(:hello).exists?('bob')
|
44
|
+
end
|
45
|
+
}
|
46
|
+
|
47
|
+
expect(@log).to eq(['this value', true])
|
48
|
+
end
|
49
|
+
|
50
|
+
it "should raise an error on failure" do
|
51
|
+
@reactor.run { |reactor|
|
52
|
+
begin
|
53
|
+
@log = @bucket.subdoc(:subkeytest).exists?('boby').execute!
|
54
|
+
rescue => e
|
55
|
+
@log << e.class
|
56
|
+
end
|
57
|
+
}
|
58
|
+
expect(@log).to eq([::Libcouchbase::Error::SubdocPathNotFound])
|
59
|
+
end
|
60
|
+
|
61
|
+
it "should return nil when quiet is true" do
|
62
|
+
@reactor.run { |reactor|
|
63
|
+
begin
|
64
|
+
@log << @bucket.subdoc(:subkeytest).exists?('boby', quiet: true).execute!
|
65
|
+
@log << @bucket.subdoc(:subkeytest, quiet: true).exists?('boby').execute!
|
66
|
+
rescue => e
|
67
|
+
@log << e.class
|
68
|
+
end
|
69
|
+
}
|
70
|
+
expect(@log).to eq([nil, nil])
|
71
|
+
end
|
72
|
+
|
73
|
+
it "should perform mutate operations" do
|
74
|
+
@reactor.run { |reactor|
|
75
|
+
@log << @bucket.subdoc(:subkeytest).dict_upsert(:bob, 4567).execute!
|
76
|
+
@log << @bucket.subdoc(:subkeytest).get(:bob).execute!
|
77
|
+
}
|
78
|
+
expect(@log).to eq([true, 4567])
|
79
|
+
end
|
80
|
+
|
81
|
+
it "should perform multiple mutate operations" do
|
82
|
+
@reactor.run { |reactor|
|
83
|
+
@log << @bucket.subdoc(:subkeytest) { |subdoc|
|
84
|
+
subdoc.dict_upsert(:bob, 4568)
|
85
|
+
subdoc.dict_upsert(:another, {hello: true})
|
86
|
+
}
|
87
|
+
@log << @bucket.subdoc(:subkeytest).get(:bob).get(:another).execute!
|
88
|
+
}
|
89
|
+
expect(@log).to eq([true, [4568, {hello: true}]])
|
90
|
+
end
|
91
|
+
|
92
|
+
it "should perform a counter mutate operation" do
|
93
|
+
@reactor.run { |reactor|
|
94
|
+
@log << @bucket.subdoc(:subkeytest).counter(:bob, 1).execute!
|
95
|
+
@log << @bucket.subdoc(:subkeytest).get(:bob).execute!
|
96
|
+
}
|
97
|
+
expect(@log).to eq([1235, 1235])
|
98
|
+
end
|
99
|
+
|
100
|
+
it "should perform multiple counter mutate operations" do
|
101
|
+
@reactor.run { |reactor|
|
102
|
+
@log << @bucket.subdoc(:subkeytest) { |subdoc|
|
103
|
+
subdoc.dict_upsert(:another, {hello: true})
|
104
|
+
subdoc.counter(:bob, 1).counter('complex.age', 1)
|
105
|
+
}
|
106
|
+
@log << @bucket.subdoc(:subkeytest).get(:bob).get(:another).get('complex.age').execute!
|
107
|
+
}
|
108
|
+
expect(@log).to eq([[1235, 13], [1235, {hello: true}, 13]])
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
describe 'native ruby' do
|
113
|
+
it "should lookup a subkey" do
|
114
|
+
@log = @bucket.subdoc(:subkeytest) do |subdoc|
|
115
|
+
subdoc.get(:hello)
|
116
|
+
end
|
117
|
+
|
118
|
+
expect(@log).to eq('this value')
|
119
|
+
end
|
120
|
+
|
121
|
+
it "should perform multiple lookup operations" do
|
122
|
+
@log = @bucket.subdoc(:subkeytest) do |subdoc|
|
123
|
+
subdoc.get(:hello).exists?('bob')
|
124
|
+
end
|
125
|
+
|
126
|
+
expect(@log).to eq(['this value', true])
|
127
|
+
end
|
128
|
+
|
129
|
+
it "should raise an error on failure" do
|
130
|
+
begin
|
131
|
+
@log = @bucket.subdoc(:subkeytest).exists?('boby').execute!
|
132
|
+
rescue => e
|
133
|
+
@log << e.class
|
134
|
+
end
|
135
|
+
expect(@log).to eq([::Libcouchbase::Error::SubdocPathNotFound])
|
136
|
+
end
|
137
|
+
|
138
|
+
it "should return nil when quiet is true" do
|
139
|
+
begin
|
140
|
+
@log << @bucket.subdoc(:subkeytest).exists?('boby', quiet: true).execute!
|
141
|
+
@log << @bucket.subdoc(:subkeytest, quiet: true).exists?('boby').execute!
|
142
|
+
rescue => e
|
143
|
+
@log << e.class
|
144
|
+
end
|
145
|
+
expect(@log).to eq([nil, nil])
|
146
|
+
end
|
147
|
+
|
148
|
+
it "should perform mutate operations" do
|
149
|
+
@log << @bucket.subdoc(:subkeytest).dict_upsert(:bob, 4567).execute!
|
150
|
+
@log << @bucket.subdoc(:subkeytest).get(:bob).execute!
|
151
|
+
expect(@log).to eq([true, 4567])
|
152
|
+
end
|
153
|
+
|
154
|
+
it "should perform multiple mutate operations" do
|
155
|
+
@log << @bucket.subdoc(:subkeytest) { |subdoc|
|
156
|
+
subdoc.dict_upsert(:bob, 4568)
|
157
|
+
subdoc.dict_upsert(:another, {hello: true})
|
158
|
+
}
|
159
|
+
@log << @bucket.subdoc(:subkeytest).get(:bob).get(:another).execute!
|
160
|
+
expect(@log).to eq([true, [4568, {hello: true}]])
|
161
|
+
end
|
162
|
+
|
163
|
+
it "should perform a counter mutate operation" do
|
164
|
+
@log << @bucket.subdoc(:subkeytest).counter(:bob, 1).execute!
|
165
|
+
@log << @bucket.subdoc(:subkeytest).get(:bob).execute!
|
166
|
+
expect(@log).to eq([1235, 1235])
|
167
|
+
end
|
168
|
+
|
169
|
+
it "should perform multiple counter mutate operations" do
|
170
|
+
@log << @bucket.subdoc(:subkeytest) { |subdoc|
|
171
|
+
subdoc.dict_upsert(:another, {hello: true})
|
172
|
+
subdoc.counter(:bob, 1).counter('complex.age', 1)
|
173
|
+
}
|
174
|
+
@log << @bucket.subdoc(:subkeytest).get(:bob).get(:another).get('complex.age').execute!
|
175
|
+
expect(@log).to eq([[1235, 13], [1235, {hello: true}, 13]])
|
176
|
+
end
|
177
|
+
end
|
178
|
+
|
179
|
+
describe 'eventmachine loop' do
|
180
|
+
require 'em-synchrony'
|
181
|
+
|
182
|
+
it "should get a subkey" do
|
183
|
+
EM.synchrony {
|
184
|
+
@log = @bucket.subdoc(:subkeytest) do |subdoc|
|
185
|
+
subdoc.get(:hello).exists?('bob')
|
186
|
+
end
|
187
|
+
EM.stop
|
188
|
+
}
|
189
|
+
expect(@log).to eq(['this value', true])
|
190
|
+
end
|
191
|
+
end
|
192
|
+
end
|
data/spec/view_spec.rb
ADDED
@@ -0,0 +1,201 @@
|
|
1
|
+
# frozen_string_literal: true, encoding: ASCII-8BIT
|
2
|
+
|
3
|
+
require 'libcouchbase'
|
4
|
+
|
5
|
+
|
6
|
+
describe Libcouchbase::QueryView do
|
7
|
+
before :each do
|
8
|
+
# This will load the couchbase connection on a different thread
|
9
|
+
@bucket = Libcouchbase::Bucket.new
|
10
|
+
@reactor = ::Libuv::Reactor.default
|
11
|
+
@log = []
|
12
|
+
end
|
13
|
+
|
14
|
+
after :each do
|
15
|
+
@bucket = nil
|
16
|
+
@reactor = nil
|
17
|
+
@log = nil
|
18
|
+
end
|
19
|
+
|
20
|
+
describe 'perform native queries' do
|
21
|
+
it "should iterate a view" do
|
22
|
+
view = @bucket.view('zone', 'all')
|
23
|
+
expect(view.first.value[:type]).to eq('zone')
|
24
|
+
@log << view.metadata[:total_rows]
|
25
|
+
@log << view.count
|
26
|
+
|
27
|
+
expect(@log).to eq([2, 2])
|
28
|
+
end
|
29
|
+
|
30
|
+
it "should iterate a view without getting documents" do
|
31
|
+
view = @bucket.view('zone', 'all', include_docs: false)
|
32
|
+
expect(view.first.key).to eq('zone_1-10')
|
33
|
+
expect(view.first.value).to be(nil)
|
34
|
+
@log << view.metadata[:total_rows]
|
35
|
+
@log << view.count
|
36
|
+
|
37
|
+
expect(@log).to eq([2, 2])
|
38
|
+
end
|
39
|
+
|
40
|
+
it "should fail if a view doesn't exist" do
|
41
|
+
view = @bucket.view('zone', 'alling')
|
42
|
+
expect { view.first }.to raise_error(Libcouchbase::Error::HttpError)
|
43
|
+
end
|
44
|
+
|
45
|
+
it "should cancel the request on error" do
|
46
|
+
view = @bucket.view('zone', 'all')
|
47
|
+
begin
|
48
|
+
view.each do |item|
|
49
|
+
@log << :callback
|
50
|
+
raise 'runtime error'
|
51
|
+
end
|
52
|
+
@log << :wtf
|
53
|
+
rescue => e
|
54
|
+
@log << view.metadata[:total_rows]
|
55
|
+
end
|
56
|
+
|
57
|
+
expect(@log).to eq([:callback, 2])
|
58
|
+
end
|
59
|
+
|
60
|
+
it "should create a design document" do
|
61
|
+
doc = {
|
62
|
+
_id: "_design/blog",
|
63
|
+
language: "javascript",
|
64
|
+
views: {
|
65
|
+
recent_posts: {
|
66
|
+
map: "function(doc){if(doc.date && doc.title){emit(doc.date, doc.title);}}"
|
67
|
+
}
|
68
|
+
}
|
69
|
+
}
|
70
|
+
@log << @bucket.save_design_doc(doc).status
|
71
|
+
expect(@log).to eq([201])
|
72
|
+
end
|
73
|
+
|
74
|
+
it "should delete a design document" do
|
75
|
+
@log << @bucket.delete_design_doc('_design/blog').status
|
76
|
+
expect(@log).to eq([200])
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
describe 'perform queries in libuv reactor' do
|
81
|
+
it "should iterate a view" do
|
82
|
+
@reactor.run { |reactor|
|
83
|
+
begin
|
84
|
+
view = @bucket.view('zone', 'all')
|
85
|
+
expect(view.first.value[:type]).to eq('zone')
|
86
|
+
@log << view.metadata[:total_rows]
|
87
|
+
@log << view.count
|
88
|
+
ensure
|
89
|
+
@bucket = nil
|
90
|
+
end
|
91
|
+
}
|
92
|
+
expect(@log).to eq([2, 2])
|
93
|
+
end
|
94
|
+
|
95
|
+
it "should iterate a view without getting documents" do
|
96
|
+
@reactor.run { |reactor|
|
97
|
+
begin
|
98
|
+
view = @bucket.view('zone', 'all', include_docs: false)
|
99
|
+
expect(view.first.key).to eq('zone_1-10')
|
100
|
+
expect(view.first.value).to be(nil)
|
101
|
+
@log << view.metadata[:total_rows]
|
102
|
+
@log << view.count
|
103
|
+
ensure
|
104
|
+
@bucket = nil
|
105
|
+
end
|
106
|
+
}
|
107
|
+
expect(@log).to eq([2, 2])
|
108
|
+
end
|
109
|
+
|
110
|
+
it "should fail if a view doesn't exist" do
|
111
|
+
@reactor.run { |reactor|
|
112
|
+
view = @bucket.view('zone', 'alling')
|
113
|
+
expect { view.first }.to raise_error(Libcouchbase::Error::HttpError)
|
114
|
+
}
|
115
|
+
end
|
116
|
+
|
117
|
+
it "should cancel the request on error" do
|
118
|
+
@reactor.run { |reactor|
|
119
|
+
view = @bucket.view('zone', 'all')
|
120
|
+
begin
|
121
|
+
view.each do |item|
|
122
|
+
@log << :callback
|
123
|
+
raise 'runtime error'
|
124
|
+
end
|
125
|
+
rescue => e
|
126
|
+
@log << view.metadata[:total_rows]
|
127
|
+
end
|
128
|
+
}
|
129
|
+
|
130
|
+
expect(@log).to eq([:callback, 2])
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
describe 'perform queries in event machine' do
|
135
|
+
require 'em-synchrony'
|
136
|
+
|
137
|
+
it "should iterate a view" do
|
138
|
+
EM.synchrony {
|
139
|
+
begin
|
140
|
+
view = @bucket.view('zone', 'all')
|
141
|
+
expect(view.first.value[:type]).to eq('zone')
|
142
|
+
@log << view.metadata[:total_rows]
|
143
|
+
@log << view.count
|
144
|
+
ensure
|
145
|
+
@bucket = nil
|
146
|
+
end
|
147
|
+
|
148
|
+
EM.stop
|
149
|
+
}
|
150
|
+
expect(@log).to eq([2, 2])
|
151
|
+
end
|
152
|
+
|
153
|
+
it "should iterate a view without getting documents" do
|
154
|
+
EM.synchrony {
|
155
|
+
begin
|
156
|
+
view = @bucket.view('zone', 'all', include_docs: false)
|
157
|
+
expect(view.first.key).to eq('zone_1-10')
|
158
|
+
expect(view.first.value).to be(nil)
|
159
|
+
@log << view.metadata[:total_rows]
|
160
|
+
@log << view.count
|
161
|
+
ensure
|
162
|
+
@bucket = nil
|
163
|
+
end
|
164
|
+
|
165
|
+
EM.stop
|
166
|
+
}
|
167
|
+
expect(@log).to eq([2, 2])
|
168
|
+
end
|
169
|
+
|
170
|
+
it "should fail if a view doesn't exist" do
|
171
|
+
EM.synchrony {
|
172
|
+
begin
|
173
|
+
view = @bucket.view('zone', 'alling')
|
174
|
+
expect { view.first }.to raise_error(Libcouchbase::Error::HttpError)
|
175
|
+
@log << :made_it_here
|
176
|
+
ensure
|
177
|
+
EM.stop
|
178
|
+
end
|
179
|
+
}
|
180
|
+
expect(@log).to eq([:made_it_here])
|
181
|
+
end
|
182
|
+
|
183
|
+
it "should cancel the request on error" do
|
184
|
+
EM.synchrony {
|
185
|
+
view = @bucket.view('zone', 'all')
|
186
|
+
begin
|
187
|
+
view.each do |item|
|
188
|
+
@log << :callback
|
189
|
+
raise 'runtime error'
|
190
|
+
end
|
191
|
+
rescue => e
|
192
|
+
@log << view.metadata[:total_rows]
|
193
|
+
end
|
194
|
+
|
195
|
+
EM.stop
|
196
|
+
}
|
197
|
+
|
198
|
+
expect(@log).to eq([:callback, 2])
|
199
|
+
end
|
200
|
+
end
|
201
|
+
end
|
data/windows_build.md
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
# Building libcouchbase on Windows
|
2
|
+
|
3
|
+
NOTE:: we are currently not supporting 32bit Windows installations
|
4
|
+
|
5
|
+
1. Install [Python 2.7 x64](https://www.python.org/downloads/)
|
6
|
+
1. Install [cmake](https://cmake.org/download/)
|
7
|
+
1. Install [OpenSSL x64 Dev](https://slproweb.com/products/Win32OpenSSL.html)
|
8
|
+
1. Install [git](https://git-scm.com/downloads)
|
9
|
+
1. `git clone https://github.com/libuv/libuv.git`
|
10
|
+
1. Add libuv, openssl, cmake and python to Path ENV VAR
|
11
|
+
1. Install [Build Tools for Visual Studio 2017](https://www.visualstudio.com/downloads/)
|
12
|
+
* Windows 10 SDK
|
13
|
+
* Visual C++ tools for cmake
|
14
|
+
* C++/CLI support
|
15
|
+
1. Build libuv (or use `gem install libuv` to automate)
|
16
|
+
* `git clone https://chromium.googlesource.com/external/gyp build/gyp`
|
17
|
+
* `vcbuild.bat vs2017 shared debug x64` -- libcouchbase looks for a debug build
|
18
|
+
* `vcbuild.bat vs2017 shared release x64`
|
19
|
+
1. `git clone https://github.com/couchbase/libcouchbase.git`
|
20
|
+
* `mkdir lcb-build`
|
21
|
+
* `cd lcb-build`
|
22
|
+
* `cmake -G "Visual Studio 15 Win64" ..\libcouchbase` (should include libuv + openssl)
|
23
|
+
* `cmake --build .`
|
24
|
+
|
25
|
+
Seems to also support: https://github.com/google/snappy
|
26
|
+
|
27
|
+
* `mkdir snappybuild && cd snappybuild && cmake -G "Visual Studio 15 Win64" ..\snappy`
|
28
|
+
* I couldn't work out how to have libcouchbase include this in the build.
|
29
|
+
|
30
|
+
I also had to modify `plugin-libuv.c` before this would compile on Windows
|
31
|
+
|
32
|
+
* Installed the Visual Studio GUI using VS Installer
|
33
|
+
* `#include "libcouchbase\plugins\io\bsdio-inl.c"`
|
34
|
+
* The linker has some dependencies that need to be removed such as: `OPTIMIZED.lib`
|
35
|
+
|
36
|
+
A pre-compiled version of libcouchbase.dll is shipped with the GEM
|
metadata
ADDED
@@ -0,0 +1,265 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: libcouchbase-mapo
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.4.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Stephen von Takach
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-12-28 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: ffi
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.9'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.9'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: concurrent-ruby
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: libuv
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 3.2.2
|
48
|
+
- - "<"
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: '5'
|
51
|
+
type: :runtime
|
52
|
+
prerelease: false
|
53
|
+
version_requirements: !ruby/object:Gem::Requirement
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: 3.2.2
|
58
|
+
- - "<"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '5'
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: rake
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - "~>"
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '11.2'
|
68
|
+
type: :development
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - "~>"
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '11.2'
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: rspec
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - "~>"
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '3.5'
|
82
|
+
type: :development
|
83
|
+
prerelease: false
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - "~>"
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '3.5'
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: yard
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - "~>"
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0.9'
|
96
|
+
type: :development
|
97
|
+
prerelease: false
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - "~>"
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '0.9'
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: uv-rays
|
105
|
+
requirement: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - "~>"
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '2.0'
|
110
|
+
type: :development
|
111
|
+
prerelease: false
|
112
|
+
version_requirements: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - "~>"
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '2.0'
|
117
|
+
- !ruby/object:Gem::Dependency
|
118
|
+
name: em-synchrony
|
119
|
+
requirement: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - "~>"
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: '1.0'
|
124
|
+
type: :development
|
125
|
+
prerelease: false
|
126
|
+
version_requirements: !ruby/object:Gem::Requirement
|
127
|
+
requirements:
|
128
|
+
- - "~>"
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: '1.0'
|
131
|
+
description: A wrapper around libcouchbase for Ruby
|
132
|
+
email:
|
133
|
+
- steve@cotag.me
|
134
|
+
executables: []
|
135
|
+
extensions:
|
136
|
+
- ext/Rakefile
|
137
|
+
extra_rdoc_files: []
|
138
|
+
files:
|
139
|
+
- ".gitignore"
|
140
|
+
- ".gitmodules"
|
141
|
+
- ".rspec"
|
142
|
+
- ".travis.yml"
|
143
|
+
- Gemfile
|
144
|
+
- LICENSE
|
145
|
+
- README.md
|
146
|
+
- Rakefile
|
147
|
+
- ext/README.md
|
148
|
+
- ext/Rakefile
|
149
|
+
- lib/libcouchbase.rb
|
150
|
+
- lib/libcouchbase/bucket.rb
|
151
|
+
- lib/libcouchbase/callbacks.rb
|
152
|
+
- lib/libcouchbase/connection.rb
|
153
|
+
- lib/libcouchbase/design_docs.rb
|
154
|
+
- lib/libcouchbase/error.rb
|
155
|
+
- lib/libcouchbase/ext/libcouchbase.rb
|
156
|
+
- lib/libcouchbase/ext/libcouchbase/cmdbase.rb
|
157
|
+
- lib/libcouchbase/ext/libcouchbase/cmdcounter.rb
|
158
|
+
- lib/libcouchbase/ext/libcouchbase/cmdendure.rb
|
159
|
+
- lib/libcouchbase/ext/libcouchbase/cmdfts.rb
|
160
|
+
- lib/libcouchbase/ext/libcouchbase/cmdget.rb
|
161
|
+
- lib/libcouchbase/ext/libcouchbase/cmdgetreplica.rb
|
162
|
+
- lib/libcouchbase/ext/libcouchbase/cmdhttp.rb
|
163
|
+
- lib/libcouchbase/ext/libcouchbase/cmdn1ql.rb
|
164
|
+
- lib/libcouchbase/ext/libcouchbase/cmdobseqno.rb
|
165
|
+
- lib/libcouchbase/ext/libcouchbase/cmdobserve.rb
|
166
|
+
- lib/libcouchbase/ext/libcouchbase/cmdstore.rb
|
167
|
+
- lib/libcouchbase/ext/libcouchbase/cmdstoredur.rb
|
168
|
+
- lib/libcouchbase/ext/libcouchbase/cmdsubdoc.rb
|
169
|
+
- lib/libcouchbase/ext/libcouchbase/cmdverbosity.rb
|
170
|
+
- lib/libcouchbase/ext/libcouchbase/cmdviewquery.rb
|
171
|
+
- lib/libcouchbase/ext/libcouchbase/contigbuf.rb
|
172
|
+
- lib/libcouchbase/ext/libcouchbase/create_st.rb
|
173
|
+
- lib/libcouchbase/ext/libcouchbase/create_st0.rb
|
174
|
+
- lib/libcouchbase/ext/libcouchbase/create_st1.rb
|
175
|
+
- lib/libcouchbase/ext/libcouchbase/create_st2.rb
|
176
|
+
- lib/libcouchbase/ext/libcouchbase/create_st3.rb
|
177
|
+
- lib/libcouchbase/ext/libcouchbase/crst_u.rb
|
178
|
+
- lib/libcouchbase/ext/libcouchbase/durability_opts_st_v.rb
|
179
|
+
- lib/libcouchbase/ext/libcouchbase/durability_opts_t.rb
|
180
|
+
- lib/libcouchbase/ext/libcouchbase/durabilityopt_sv0.rb
|
181
|
+
- lib/libcouchbase/ext/libcouchbase/enums.rb
|
182
|
+
- lib/libcouchbase/ext/libcouchbase/fragbuf.rb
|
183
|
+
- lib/libcouchbase/ext/libcouchbase/ftshandle.rb
|
184
|
+
- lib/libcouchbase/ext/libcouchbase/histogram.rb
|
185
|
+
- lib/libcouchbase/ext/libcouchbase/http_request_t.rb
|
186
|
+
- lib/libcouchbase/ext/libcouchbase/keybuf.rb
|
187
|
+
- lib/libcouchbase/ext/libcouchbase/multicmd_ctx.rb
|
188
|
+
- lib/libcouchbase/ext/libcouchbase/mutation_token.rb
|
189
|
+
- lib/libcouchbase/ext/libcouchbase/n1qlhandle.rb
|
190
|
+
- lib/libcouchbase/ext/libcouchbase/n1qlparams.rb
|
191
|
+
- lib/libcouchbase/ext/libcouchbase/respbase.rb
|
192
|
+
- lib/libcouchbase/ext/libcouchbase/respcounter.rb
|
193
|
+
- lib/libcouchbase/ext/libcouchbase/respendure.rb
|
194
|
+
- lib/libcouchbase/ext/libcouchbase/respfts.rb
|
195
|
+
- lib/libcouchbase/ext/libcouchbase/respget.rb
|
196
|
+
- lib/libcouchbase/ext/libcouchbase/resphttp.rb
|
197
|
+
- lib/libcouchbase/ext/libcouchbase/respmcversion.rb
|
198
|
+
- lib/libcouchbase/ext/libcouchbase/respn1ql.rb
|
199
|
+
- lib/libcouchbase/ext/libcouchbase/respobseqno.rb
|
200
|
+
- lib/libcouchbase/ext/libcouchbase/respobserve.rb
|
201
|
+
- lib/libcouchbase/ext/libcouchbase/respserverbase.rb
|
202
|
+
- lib/libcouchbase/ext/libcouchbase/respstats.rb
|
203
|
+
- lib/libcouchbase/ext/libcouchbase/respstore.rb
|
204
|
+
- lib/libcouchbase/ext/libcouchbase/respstoredur.rb
|
205
|
+
- lib/libcouchbase/ext/libcouchbase/respsubdoc.rb
|
206
|
+
- lib/libcouchbase/ext/libcouchbase/respviewquery.rb
|
207
|
+
- lib/libcouchbase/ext/libcouchbase/sdentry.rb
|
208
|
+
- lib/libcouchbase/ext/libcouchbase/sdspec.rb
|
209
|
+
- lib/libcouchbase/ext/libcouchbase/t.rb
|
210
|
+
- lib/libcouchbase/ext/libcouchbase/valbuf.rb
|
211
|
+
- lib/libcouchbase/ext/libcouchbase/valbuf_u_buf.rb
|
212
|
+
- lib/libcouchbase/ext/libcouchbase/viewhandle.rb
|
213
|
+
- lib/libcouchbase/ext/libcouchbase_libuv.rb
|
214
|
+
- lib/libcouchbase/ext/tasks.rb
|
215
|
+
- lib/libcouchbase/n1ql.rb
|
216
|
+
- lib/libcouchbase/query_full_text.rb
|
217
|
+
- lib/libcouchbase/query_n1ql.rb
|
218
|
+
- lib/libcouchbase/query_view.rb
|
219
|
+
- lib/libcouchbase/results_fiber.rb
|
220
|
+
- lib/libcouchbase/results_native.rb
|
221
|
+
- lib/libcouchbase/subdoc_request.rb
|
222
|
+
- lib/libcouchbase/version.rb
|
223
|
+
- libcouchbase.gemspec
|
224
|
+
- spec/bucket_spec.rb
|
225
|
+
- spec/connection_spec.rb
|
226
|
+
- spec/design_docs_spec.rb
|
227
|
+
- spec/error_spec.rb
|
228
|
+
- spec/fts_spec.rb
|
229
|
+
- spec/n1ql_spec.rb
|
230
|
+
- spec/results_libuv_spec.rb
|
231
|
+
- spec/results_native_spec.rb
|
232
|
+
- spec/seed/2016-10-25T043505Z/2016-10-25T043505Z-full/bucket-default/design.json
|
233
|
+
- spec/seed/2016-10-25T043505Z/2016-10-25T043505Z-full/bucket-default/node-127.0.0.1%3A8091/data-0000.cbb
|
234
|
+
- spec/seed/2016-10-25T043505Z/2016-10-25T043505Z-full/bucket-default/node-127.0.0.1%3A8091/failover.json
|
235
|
+
- spec/seed/2016-10-25T043505Z/2016-10-25T043505Z-full/bucket-default/node-127.0.0.1%3A8091/meta.json
|
236
|
+
- spec/seed/2016-10-25T043505Z/2016-10-25T043505Z-full/bucket-default/node-127.0.0.1%3A8091/seqno.json
|
237
|
+
- spec/seed/2016-10-25T043505Z/2016-10-25T043505Z-full/bucket-default/node-127.0.0.1%3A8091/snapshot_markers.json
|
238
|
+
- spec/subdoc_spec.rb
|
239
|
+
- spec/view_spec.rb
|
240
|
+
- windows_build.md
|
241
|
+
homepage: https://github.com/cotag/libcouchbase
|
242
|
+
licenses:
|
243
|
+
- MIT
|
244
|
+
metadata: {}
|
245
|
+
post_install_message:
|
246
|
+
rdoc_options: []
|
247
|
+
require_paths:
|
248
|
+
- lib
|
249
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
250
|
+
requirements:
|
251
|
+
- - ">="
|
252
|
+
- !ruby/object:Gem::Version
|
253
|
+
version: 2.1.0
|
254
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
255
|
+
requirements:
|
256
|
+
- - ">="
|
257
|
+
- !ruby/object:Gem::Version
|
258
|
+
version: '0'
|
259
|
+
requirements: []
|
260
|
+
rubyforge_project:
|
261
|
+
rubygems_version: 2.7.6
|
262
|
+
signing_key:
|
263
|
+
specification_version: 4
|
264
|
+
summary: libcouchbase bindings for Ruby
|
265
|
+
test_files: []
|