Run Rubocop autocorrect on app/services
This commit is contained in:
parent
fbc6926402
commit
02fcd03b0e
@ -21,3 +21,9 @@ RSpec/MultipleMemoizedHelpers:
|
||||
Enabled: false
|
||||
Style/Documentation:
|
||||
Enabled: false
|
||||
Metrics/MethodLength:
|
||||
Max: 20
|
||||
Rails/SkipsModelValidations:
|
||||
Enabled: false
|
||||
Metrics/AbcSize:
|
||||
Enabled: false
|
@ -1,10 +1,12 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
class CaptchaController < ApplicationController
|
||||
skip_before_action :authenticate_user!
|
||||
skip_before_action :set_tenant
|
||||
def create
|
||||
id = LibreCaptcha.new.get_id
|
||||
id = LibreCaptcha.new.id
|
||||
render json: {
|
||||
id:,
|
||||
media_url: media_captcha_index_url(id:)
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
class AffinityGroupsHierarchy < Array
|
||||
|
@ -1,20 +1,20 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
class LibreCaptcha
|
||||
def get_id
|
||||
HTTParty.post("http://libre-captcha:8888/v2/captcha",
|
||||
def id
|
||||
HTTParty.post('http://libre-captcha:8888/v2/captcha',
|
||||
body: {
|
||||
input_type: "text",
|
||||
input_type: 'text',
|
||||
level: :hard,
|
||||
media: 'image/png',
|
||||
size: '350x100'
|
||||
}.to_json
|
||||
).then { |raw| JSON.parse(raw)['id'] }
|
||||
}.to_json).then { |raw| JSON.parse(raw)['id'] }
|
||||
end
|
||||
|
||||
def valid?(id:, answer:)
|
||||
HTTParty.post("http://libre-captcha:8888/v2/answer",
|
||||
body: { id:, answer: }.to_json
|
||||
).then { |raw| JSON.parse(raw)['result'] == 'True' }
|
||||
HTTParty.post('http://libre-captcha:8888/v2/answer',
|
||||
body: { id:, answer: }.to_json).then { |raw| JSON.parse(raw)['result'] == 'True' }
|
||||
end
|
||||
end
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
module Tables
|
||||
@ -7,6 +9,7 @@ module Tables
|
||||
distance = AffinityGroupsHierarchy.instance.distance(id_a, id_b)
|
||||
|
||||
return 1 if distance.nil?
|
||||
|
||||
Rational(distance, distance + 1)
|
||||
end
|
||||
end
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
require_relative '../../extensions/tree_node_extension'
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
module Tables
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
module Tables
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
module Tables
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
module VNS
|
||||
|
Loading…
x
Reference in New Issue
Block a user