Skip to content

Commit 8300ae9

Browse files
committed
fix rubocop complaints
1 parent abaf772 commit 8300ae9

File tree

105 files changed

+269
-79
lines changed

Some content is hidden

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

105 files changed

+269
-79
lines changed

.rubocop_todo.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
Style/Documentation:
22
Enabled: false
33

4-
Style/FrozenStringLiteralComment:
5-
Enabled: false
6-
74
Style/NumericLiterals:
85
Enabled: false
96

@@ -40,8 +37,5 @@ Naming/PredicateName:
4037
Style/AccessorGrouping:
4138
Enabled: false
4239

43-
Style/ExplicitBlockArgument:
44-
Enabled: false
45-
4640
Minitest/MultipleAssertions:
4741
Enabled: false

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Copyright 2020-2021 Couchbase, Inc.
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");

Rakefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Copyright 2020-2021 Couchbase, Inc.
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");

bin/console

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
23

34
# Copyright 2020-2021 Couchbase, Inc.
45
#

bin/fetch-stats

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
3+
24
# Copyright 2020-2021 Couchbase, Inc.
35
#
46
# Licensed under the Apache License, Version 2.0 (the "License");

bin/generate-fake-data

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
23

34
# Copyright 2022-Present Couchbase, Inc.
45
#

bin/init-cluster

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
23

34
# Copyright 2020-2021 Couchbase, Inc.
45
#

bin/jenkins/patch-version.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
3+
24
# Copyright 2020-2021 Couchbase, Inc.
35
#
46
# Licensed under the Apache License, Version 2.0 (the "License");

couchbase.gemspec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Copyright 2020-2021 Couchbase, Inc.
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");

examples/analytics.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Copyright 2020-2021 Couchbase, Inc.
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");

examples/auth.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Copyright 2020-2021 Couchbase, Inc.
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");

examples/crud.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Copyright 2020-2021 Couchbase, Inc.
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");

examples/managing_analytics_indexes.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Copyright 2020-2021 Couchbase, Inc.
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");

examples/managing_buckets.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Copyright 2020-2021 Couchbase, Inc.
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");

examples/managing_collections.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Copyright 2020-2021 Couchbase, Inc.
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");

examples/managing_query_indexes.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Copyright 2020-2021 Couchbase, Inc.
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");

examples/managing_search_indexes.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Copyright 2020-2021 Couchbase, Inc.
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");

examples/managing_users.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Copyright 2021 Couchbase, Inc.
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");

examples/managing_view_indexes.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Copyright 2020-2021 Couchbase, Inc.
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");

examples/query.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Copyright 2020-2021 Couchbase, Inc.
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");

examples/query_with_consistency.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Copyright 2020-2021 Couchbase, Inc.
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");

examples/range_scan.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Copyright 2023. Couchbase, Inc.
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");

examples/search.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Copyright 2020-2021 Couchbase, Inc.
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");

examples/search_with_consistency.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Copyright 2020-2021 Couchbase, Inc.
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");

examples/subdocument.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Copyright 2020-2021 Couchbase, Inc.
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");

examples/view.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Copyright 2020-2021 Couchbase, Inc.
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");

lib/active_support/cache/couchbase_store.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Copyright 2020-2021 Couchbase, Inc.
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");

lib/couchbase.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Copyright 2020-2021 Couchbase, Inc.
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");

lib/couchbase/analytics_options.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Copyright 2020-2021 Couchbase, Inc.
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");

lib/couchbase/authenticator.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Copyright 2020-2021 Couchbase, Inc.
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");

lib/couchbase/binary_collection.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Copyright 2020-2021 Couchbase, Inc.
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");

lib/couchbase/binary_collection_options.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Copyright 2020-2021 Couchbase, Inc.
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");

lib/couchbase/bucket.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Copyright 2020-2021 Couchbase, Inc.
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");

lib/couchbase/cluster.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Copyright 2020-2021 Couchbase, Inc.
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");

lib/couchbase/collection.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Copyright 2020-2021 Couchbase, Inc.
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");

lib/couchbase/collection_options.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Copyright 2020-2021 Couchbase, Inc.
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");

lib/couchbase/config_profiles.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Copyright 2020-2022 Couchbase, Inc.
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");

lib/couchbase/configuration.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Copyright 2020-2021 Couchbase, Inc.
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");

lib/couchbase/datastructures.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Copyright 2020-2021 Couchbase, Inc.
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");

lib/couchbase/datastructures/couchbase_list.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Copyright 2020-2021 Couchbase, Inc.
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -42,7 +44,7 @@ def initialize(id, collection, options = Options::CouchbaseList.new)
4244
# @yieldparam [Object] item
4345
#
4446
# @return [CouchbaseList, Enumerable]
45-
def each
47+
def each(&)
4648
if block_given?
4749
begin
4850
result = @collection.get(@id, @options.get_options)
@@ -52,9 +54,7 @@ def each
5254
current = []
5355
@cas = 0
5456
end
55-
current.each do |entry|
56-
yield entry
57-
end
57+
current.each(&)
5858
self
5959
else
6060
enum_for(:each)

lib/couchbase/datastructures/couchbase_map.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Copyright 2020-2021 Couchbase, Inc.
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -42,7 +44,7 @@ def initialize(id, collection, options = Options::CouchbaseMap.new)
4244
# @yieldparam [Object] item
4345
#
4446
# @return [CouchbaseMap, Enumerable]
45-
def each
47+
def each(&)
4648
if block_given?
4749
begin
4850
result = @collection.get(@id, @options.get_options)
@@ -52,9 +54,7 @@ def each
5254
current = []
5355
@cas = 0
5456
end
55-
current.each do |key, value|
56-
yield key, value
57-
end
57+
current.each(&)
5858
self
5959
else
6060
enum_for(:each)

lib/couchbase/datastructures/couchbase_queue.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Copyright 2020-2021 Couchbase, Inc.
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -42,7 +44,7 @@ def initialize(id, collection, options = Options::CouchbaseQueue.new)
4244
# @yieldparam [Object] item
4345
#
4446
# @return [CouchbaseQueue, Enumerable]
45-
def each
47+
def each(&)
4648
if block_given?
4749
begin
4850
result = @collection.get(@id, @options.get_options)
@@ -52,9 +54,7 @@ def each
5254
current = []
5355
@cas = 0
5456
end
55-
current.each do |entry|
56-
yield entry
57-
end
57+
current.each(&)
5858
self
5959
else
6060
enum_for(:each)

lib/couchbase/datastructures/couchbase_set.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Copyright 2020-2021 Couchbase, Inc.
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -42,7 +44,7 @@ def initialize(id, collection, options = Options::CouchbaseSet.new)
4244
# @yieldparam [Object] item
4345
#
4446
# @return [CouchbaseSet, Enumerable]
45-
def each
47+
def each(&)
4648
if block_given?
4749
begin
4850
result = @collection.get(@id, @options.get_options)
@@ -52,9 +54,7 @@ def each
5254
current = []
5355
@cas = 0
5456
end
55-
current.each do |entry|
56-
yield entry
57-
end
57+
current.each(&)
5858
self
5959
else
6060
enum_for(:each)

lib/couchbase/diagnostics.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Copyright 2020-2021 Couchbase, Inc.
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");

lib/couchbase/errors.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Copyright 2020-2023 Couchbase, Inc.
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");

lib/couchbase/json_transcoder.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Copyright 2020-2021 Couchbase, Inc.
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");

lib/couchbase/key_value_scan.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Copyright 2023. Couchbase, Inc.
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");

lib/couchbase/logger.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Copyright 2020-Present Couchbase, Inc.
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");

lib/couchbase/management.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Copyright 2020-2021 Couchbase, Inc.
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");

lib/couchbase/management/analytics_index_manager.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Copyright 2020-2021 Couchbase, Inc.
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");

0 commit comments

Comments
 (0)