summaryrefslogtreecommitdiffstats
path: root/app/lib
diff options
context:
space:
mode:
authorabcang <abcang1015@gmail.com>2020-07-15 02:05:07 +0900
committerGitHub <noreply@github.com>2020-07-14 19:05:07 +0200
commit6a96af4d20129cea06c716393338aa4f730b7b35 (patch)
tree071f96680125fb4120fc54c1c7ef646bedcf54f3 /app/lib
parenta8e84a18f1d84943e8332ff8deba9d91b1cb3efd (diff)
Fix rubocop warning (#14288)
* Fix rubocop warning * use limit variable * use ContextCreatingMethods option
Diffstat (limited to 'app/lib')
-rw-r--r--app/lib/activitypub/activity/create.rb2
-rw-r--r--app/lib/proof_provider/keybase/config_serializer.rb2
-rw-r--r--app/lib/request.rb1
-rw-r--r--app/lib/settings/scoped_settings.rb5
4 files changed, 5 insertions, 5 deletions
diff --git a/app/lib/activitypub/activity/create.rb b/app/lib/activitypub/activity/create.rb
index d3d46055162..e81452e3cae 100644
--- a/app/lib/activitypub/activity/create.rb
+++ b/app/lib/activitypub/activity/create.rb
@@ -45,7 +45,7 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
RedisLock.acquire(lock_options) do |lock|
if lock.acquired?
- return if delete_arrived_first?(object_uri) || poll_vote?
+ return if delete_arrived_first?(object_uri) || poll_vote? # rubocop:disable Lint/NonLocalExitFromIterator
@status = find_existing_status
diff --git a/app/lib/proof_provider/keybase/config_serializer.rb b/app/lib/proof_provider/keybase/config_serializer.rb
index fbce7aeee8c..c6c364d316f 100644
--- a/app/lib/proof_provider/keybase/config_serializer.rb
+++ b/app/lib/proof_provider/keybase/config_serializer.rb
@@ -55,7 +55,7 @@ class ProofProvider::Keybase::ConfigSerializer < ActiveModel::Serializer
end
def profile_url
- CGI.unescape(short_account_url('%{username}')) # rubocop:disable Style/FormatStringToken
+ CGI.unescape(short_account_url('%{username}'))
end
def check_url
diff --git a/app/lib/request.rb b/app/lib/request.rb
index 247c32958ac..bcba1eebf64 100644
--- a/app/lib/request.rb
+++ b/app/lib/request.rb
@@ -231,6 +231,7 @@ class Request
begin
sock.connect_nonblock(addr_by_socket[sock])
rescue Errno::EISCONN
+ # Do nothing
rescue => e
sock.close
outer_e = e
diff --git a/app/lib/settings/scoped_settings.rb b/app/lib/settings/scoped_settings.rb
index 9ca39510acd..3bec9bd569d 100644
--- a/app/lib/settings/scoped_settings.rb
+++ b/app/lib/settings/scoped_settings.rb
@@ -11,7 +11,7 @@ module Settings
@object = object
end
- # rubocop:disable Style/MethodMissing
+ # rubocop:disable Style/MethodMissingSuper
def method_missing(method, *args)
method_name = method.to_s
# set a value for a variable
@@ -24,7 +24,7 @@ module Settings
self[method_name]
end
end
- # rubocop:enable Style/MethodMissing
+ # rubocop:enable Style/MethodMissingSuper
def respond_to_missing?(*)
true
@@ -48,7 +48,6 @@ module Settings
record.update!(value: value)
Rails.cache.write(Setting.cache_key(key, @object), value)
- value
end
def [](key)