Skip to content

Commit de62ca3

Browse files
committed
Rubocop fixes
1 parent 987a0b4 commit de62ca3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+119
-175
lines changed

.github/workflows/linters.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@ jobs:
1818
- name: Set up ruby
1919
uses: ruby/setup-ruby@v1
2020
with:
21-
ruby-version: 3.0
21+
ruby-version: 3.3
2222
- name: Install dependencies
2323
run: bundle install
2424
- name: Run rubocop
25-
run: bundle exec rubocop
25+
run: |
26+
bundle exec rubocop -v
27+
bundle exec rubocop
2628
2729
clang_format:
2830
runs-on: ubuntu-20.04
@@ -54,7 +56,7 @@ jobs:
5456
- name: Set up ruby
5557
uses: ruby/setup-ruby@v1
5658
with:
57-
ruby-version: 3.0
59+
ruby-version: 3.3
5860
- name: Install dependencies
5961
run: |
6062
sudo apt-get update -y

bin/console

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ require "irb"
2020
require "open3"
2121
require "couchbase"
2222

23-
include Couchbase # rubocop:disable Style/MixinUsage for brevity
23+
include Couchbase # rubocop:disable Style/MixinUsage -- for brevity
2424

2525
customer123 = {
2626
"name" => "Douglas Reynholm",
@@ -105,4 +105,4 @@ alias collection default_collection
105105
# cluster # returns connected cluster
106106
# default_collection # returns default collection (accept bucket name, defaults to "default")
107107
# customer123 # returns sample document
108-
binding.irb # rubocop:disable Lint/Debugger start REPL
108+
binding.irb # rubocop:disable Lint/Debugger -- start REPL

bin/init-cluster

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ options = {
3939
sample_buckets: Set.new,
4040
}
4141
default_port = options[:strict_encryption] ? 18091 : 8091
42-
if (options[:cluster_run_nodes]).positive?
42+
if options[:cluster_run_nodes].positive?
4343
default_port = options[:strict_encryption] ? 19000 : 9000
4444
end
4545
options[:port] = ENV.fetch("CB_PORT", default_port).to_i

bin/jenkins/check-rubocop

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,5 @@ chruby ruby-${CB_RUBY_VERSION}
4040
bundle config set --local path ${PROJECT_ROOT}/vendor/bundle
4141

4242
bundle install
43+
bundle exec rubocop -v
4344
bundle exec rubocop

examples/analytics.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616

1717
require "couchbase"
1818

19-
include Couchbase # rubocop:disable Style/MixinUsage for brevity
19+
include Couchbase # rubocop:disable Style/MixinUsage -- for brevity
2020

21-
options = Cluster::ClusterOptions.new
21+
options = Options::Cluster.new
2222
options.authenticate("Administrator", "password")
2323
cluster = Cluster.connect("couchbase://localhost", options)
2424

@@ -202,7 +202,7 @@
202202

203203
# Named parameters
204204
puts "---- named parameters"
205-
options = Cluster::AnalyticsOptions.new
205+
options = Options::Analytics.new
206206
options.named_parameters({user_id: 2})
207207
res = cluster.analytics_query("
208208
USE #{dataverse_name};
@@ -223,7 +223,7 @@
223223

224224
# Positional parameters
225225
puts "---- positional parameters"
226-
options = Cluster::AnalyticsOptions.new
226+
options = Options::Analytics.new
227227
options.positional_parameters([2])
228228
res = cluster.analytics_query("
229229
USE #{dataverse_name};

examples/auth.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
# limitations under the License.
1616

1717
require "couchbase"
18-
include Couchbase # rubocop:disable Style/MixinUsage for brevity
18+
include Couchbase # rubocop:disable Style/MixinUsage -- for brevity
1919

20-
options = Cluster::ClusterOptions.new
20+
options = Options::Cluster.new
2121
# initializes {PasswordAuthenticator} internally
2222
options.authenticate("Administrator", "password")
2323
Cluster.connect("couchbase://localhost", options)

examples/crud.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
# limitations under the License.
1616

1717
require "couchbase"
18-
include Couchbase # rubocop:disable Style/MixinUsage for brevity
18+
include Couchbase # rubocop:disable Style/MixinUsage -- for brevity
1919

20-
options = Cluster::ClusterOptions.new
20+
options = Options::Cluster.new
2121

2222
options.authenticate("Administrator", "password")
2323
cluster = Cluster.connect("couchbase://localhost", options)

examples/managing_analytics_indexes.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
# limitations under the License.
1616

1717
require "couchbase"
18-
include Couchbase # rubocop:disable Style/MixinUsage for brevity
18+
include Couchbase # rubocop:disable Style/MixinUsage -- for brevity
1919

2020
def measure(msg)
2121
start = Time.now
2222
yield
2323
printf "%<msg>s in %<elapsed>.2f seconds\n", msg: msg, elapsed: Time.now - start
2424
end
2525

26-
options = Cluster::ClusterOptions.new
26+
options = Options::Cluster.new
2727
options.authenticate("Administrator", "password")
2828
cluster = Cluster.connect("couchbase://localhost", options)
2929

examples/managing_buckets.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
# limitations under the License.
1616

1717
require "couchbase"
18-
include Couchbase # rubocop:disable Style/MixinUsage for brevity
18+
include Couchbase # rubocop:disable Style/MixinUsage -- for brevity
1919

2020
def measure(msg)
2121
start = Time.now
2222
yield
2323
printf "%<msg>s in %<elapsed>.2f seconds\n", msg: msg, elapsed: Time.now - start
2424
end
2525

26-
options = Cluster::ClusterOptions.new
26+
options = Options::Cluster.new
2727
options.authenticate("Administrator", "password")
2828
cluster = Cluster.connect("couchbase://localhost", options)
2929

examples/managing_collections.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# limitations under the License.
1616

1717
require "couchbase"
18-
include Couchbase # rubocop:disable Style/MixinUsage for brevity
18+
include Couchbase # rubocop:disable Style/MixinUsage -- for brevity
1919

2020
def measure(msg)
2121
start = Time.now
@@ -26,7 +26,7 @@ def measure(msg)
2626
bucket_name = "travel-sample"
2727
scope_name = "myapp"
2828

29-
options = Cluster::ClusterOptions.new
29+
options = Options::Cluster.new
3030
options.authenticate("Administrator", "password")
3131
cluster = Cluster.connect("couchbase://localhost", options)
3232
bucket = cluster.bucket(bucket_name)

0 commit comments

Comments
 (0)