Skip to content
Merged
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 Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ task :check_syntax do
fail_count = 0
errors = []

Dir.glob("modules/**/*.rb").sort.each do |file|
Dir.glob("modules/devguide/examples/*/*.rb").sort.each do |file|
source = File.read(file)
RubyVM::InstructionSequence.compile(source, file)
pass += 1
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion modules/hello-world/pages/overview.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

[source,ruby]
----
include::howtos:example$kv_operations.rb[tag=named-collection-upsert]
include::devguide:example$ruby/kv_operations.rb[tag=named-collection-upsert]
----

The Couchbase Ruby SDK allows you to connect to a Couchbase cluster from Ruby.
Expand Down
4 changes: 2 additions & 2 deletions modules/hello-world/pages/start-using-sdk.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ If you are connecting to https://docs.couchbase.com/cloud/index.html[Couchbase C

[source,ruby]
----
include::hello-world:example$cloud.rb[tags=**]
include::devguide:example$ruby/cloud.rb[tags=**]
----

The Couchbase Capella free tier version comes with the Travel Sample Bucket, and its Query indexes, loaded and ready.
Expand All @@ -47,7 +47,7 @@ Local Couchbase Server::
--
[source,ruby]
----
include::hello-world:example$start_using.rb[tags=**]
include::devguide:example$ruby/start_using.rb[tags=**]
----

As well as the Ruby SDK (see below), and a running instance of Couchbase Server, you will need to load up the Travel Sample Bucket
Expand Down
20 changes: 10 additions & 10 deletions modules/howtos/pages/analytics-using-sdk.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ In these examples we will be using an `airports` dataset created on the `travel-

[source,ruby]
----
include::example$analytics.rb[tag=simple]
include::devguide:example$ruby/analytics.rb[tag=simple]
----


Expand All @@ -36,13 +36,13 @@ If parameters are used, they can either be `positional` or `named`:
.Positional parameters
[source,ruby]
----
include::example$analytics.rb[tag=positional]
include::devguide:example$ruby/analytics.rb[tag=positional]
----

.Named parameters
[source,ruby]
----
include::example$analytics.rb[tag=named]
include::devguide:example$ruby/analytics.rb[tag=named]
----

NOTE: As timeouts are propagated to the server by the client, a timeout set on the client side may be used to stop the processing of a request, in order to save system resources.
Expand Down Expand Up @@ -72,21 +72,21 @@ Here, we set a `client_context_id`:

[source,ruby]
----
include::example$analytics.rb[tag=clientcontextid]
include::devguide:example$ruby/analytics.rb[tag=clientcontextid]
----

And here we set high priority for the query:

[source,ruby]
----
include::example$analytics.rb[tag=priority]
include::devguide:example$ruby/analytics.rb[tag=priority]
----

Here we pass `readonly` to explicitly mark a query as being read only, and not mutating any documents on the server side.

[source,ruby]
----
include::example$analytics.rb[tag=readonly]
include::devguide:example$ruby/analytics.rb[tag=readonly]
----


Expand Down Expand Up @@ -116,7 +116,7 @@ The `metadata` object contains useful metadata, such as `Metrics` and `ClientCon

[source,ruby]
----
include::example$analytics.rb[tag=printmetrics]
include::devguide:example$ruby/analytics.rb[tag=printmetrics]
----

// For a listing of available `Metrics` in `MetaData`, see the xref:concept-docs:analytics-for-sdk-users.adoc[Understanding Analytics] SDK doc.
Expand All @@ -131,7 +131,7 @@ Analytics allows `:request_plus` queries -- ensuring results contain information

[source,ruby]
----
include::example$analytics.rb[tag=scanconsistency]
include::devguide:example$ruby/analytics.rb[tag=scanconsistency]
----


Expand All @@ -149,12 +149,12 @@ You can run a query as follows:

[source,ruby]
----
include::example$analytics.rb[tag=handle-collection]
include::devguide:example$ruby/analytics.rb[tag=handle-collection]
----

In addition to running a query via the `Cluster` object, you can run one via the `Scope` object.

[source,ruby]
----
include::example$analytics.rb[tag=handle-scope]
include::devguide:example$ruby/analytics.rb[tag=handle-scope]
----
8 changes: 4 additions & 4 deletions modules/howtos/pages/caching-example.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

This example demonstrates how to integrate Couchbase into a caching layer of the https://rubyonrails.org/[Rails] web-framework.

You can also find the https://github.com/couchbase/docs-sdk-ruby/blob/temp/3.5/modules/howtos/examples/rails-caching-example[full code for _this_ example here].
You can also find the https://github.com/couchbase/docs-sdk-ruby/blob/temp/3.8/modules/devguide/examples/rails-caching-example[full code for _this_ example here].


== Configuration
Expand All @@ -17,7 +17,7 @@ so to add it to the application you just need to update your `Gemfile`:

[source,ruby]
----
include::howtos:example$rails-caching-example/Gemfile[tag=add_dependency]
include::devguide:example$rails-caching-example/Gemfile[tag=add_dependency]
----

Do not forget to run `bundle install` to ensure that all dependencies have been satisfied.
Expand All @@ -27,7 +27,7 @@ Corresponding configuration usually kept in the configuration environment file a

[source,ruby]
----
include::howtos:example$rails-caching-example/config/environments/development.rb[tag=cache_store_config]
include::devguide:example$rails-caching-example/config/environments/development.rb[tag=cache_store_config]
----

In this development example, we will try to discover cluster location and credentials in the environment variables, with a fallback to localhost and safe default.
Expand All @@ -41,7 +41,7 @@ In this example, we cache the current time for the 3 seconds:

[source,ruby]
----
include::howtos:example$rails-caching-example/app/controllers/wall_clock_controller.rb[tag=cache_time_for_3_seconds]
include::devguide:example$rails-caching-example/app/controllers/wall_clock_controller.rb[tag=cache_time_for_3_seconds]
----


Expand Down
2 changes: 1 addition & 1 deletion modules/howtos/pages/concurrent-document-mutations.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ include::{version-common}@sdk:shared:partial$cas.adoc[tag=locking]

[source,ruby]
----
include::example$cas.rb[tag=locking]
include::devguide:example$ruby/cas.rb[tag=locking]
----

The handler will unlock the item either via an explicit unlock operation ([.api]`unlock`) or implicitly via modifying the item with the correct CAS.
Expand Down
12 changes: 6 additions & 6 deletions modules/howtos/pages/error-handling.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Transient errors -- such as those caused by resource starvation -- are best tack
////
[source,ruby]
----
include::example$error_handling.rb[tag=handle_retryable]
include::devguide:example$ruby/error_handling.rb[tag=handle_retryable]
----
////

Expand All @@ -84,14 +84,14 @@ Here we will cover some of the most common errors.

[source,ruby]
----
include::example$error_handling.rb[tag=DocumentNotFound]
include::devguide:example$ruby/error_handling.rb[tag=DocumentNotFound]
----

=== Document already exists

[source,ruby]
----
include::example$error_handling.rb[tag=DocumentExists]
include::devguide:example$ruby/error_handling.rb[tag=DocumentExists]
----

=== Document too large
Expand All @@ -102,21 +102,21 @@ include::example$error_handling.rb[tag=DocumentExists]

[source,ruby]
----
include::example$error_handling.rb[tag=CasMismatch]
include::devguide:example$ruby/error_handling.rb[tag=CasMismatch]
----

=== Durability ambiguous

[source,ruby]
----
include::example$error_handling.rb[tag=DurabilityAmbiguous]
include::devguide:example$ruby/error_handling.rb[tag=DurabilityAmbiguous]
----

=== Durability invalid level

[source,ruby]
----
include::example$error_handling.rb[tag=DurabilityLevelNotAvailable]
include::devguide:example$ruby/error_handling.rb[tag=DurabilityLevelNotAvailable]
----


Expand Down