mirror of
https://github.com/docusealco/docuseal
synced 2026-11-04 06:42:32 -05:00
fix rubocop
This commit is contained in:
1 parent
f9c12b9d78
commit
9bfa6f7f4a
25 files changed
+27
-52
No files matched your search
+2
-2
@@ -111,7 +111,7 @@ module LoadIco
|
||||
and_scanline_stride = 0
|
||||
if has_and_mask
|
||||
and_mask_data_offset = xor_mask_data_offset + (image_pixel_height * xor_scanline_stride)
|
||||
and_scanline_stride = (((dib_width * 1) + 31) / 32) * 4
|
||||
and_scanline_stride = ((dib_width + 31) / 32) * 4
|
||||
end
|
||||
|
||||
flat_rgba_pixels = []
|
||||
@@ -128,7 +128,7 @@ module LoadIco
|
||||
if has_and_mask
|
||||
dib_io.seek(and_mask_data_offset + (y_dib_row * and_scanline_stride))
|
||||
and_mask_scanline_bytes = dib_io.read(and_scanline_stride)
|
||||
min_and_bytes_needed = ((dib_width * 1) + 7) / 8
|
||||
min_and_bytes_needed = (dib_width + 7) / 8
|
||||
return nil unless and_mask_scanline_bytes && and_mask_scanline_bytes.bytesize >= min_and_bytes_needed
|
||||
|
||||
(0...dib_width).each do |x_pixel|
|
||||
|
||||
@@ -75,7 +75,7 @@ module MarkdownToHtml
|
||||
html.presence || '<p></p>'
|
||||
end
|
||||
|
||||
# rubocop:disable Metrics
|
||||
# rubocop:disable-next Metrics
|
||||
def parse_inline(text)
|
||||
context = []
|
||||
out = ''
|
||||
@@ -128,5 +128,4 @@ module MarkdownToHtml
|
||||
|
||||
(out + text[last..].to_s + flush.call).gsub('<a>', '[')
|
||||
end
|
||||
# rubocop:enable Metrics
|
||||
end
|
||||
+2
-4
@@ -86,7 +86,7 @@ class Pdfium
|
||||
end
|
||||
end
|
||||
|
||||
# rubocop:disable Naming/ClassAndModuleCamelCase
|
||||
# rubocop:disable-next Naming/ClassAndModuleCamelCase
|
||||
class FPDF_LIBRARY_CONFIG < FFI::Struct
|
||||
layout :version, :int,
|
||||
:m_pUserFontPaths, :pointer,
|
||||
@@ -95,7 +95,6 @@ class Pdfium
|
||||
:m_pPlatform, :pointer,
|
||||
:m_RendererType, :int
|
||||
end
|
||||
# rubocop:enable Naming/ClassAndModuleCamelCase
|
||||
|
||||
attach_function :FPDF_InitLibraryWithConfig, [:pointer], :void
|
||||
attach_function :FPDF_DestroyLibrary, [], :void
|
||||
@@ -234,7 +233,7 @@ class Pdfium
|
||||
typedef :int, :FPDF_BOOL
|
||||
typedef :pointer, :IPDF_JSPLATFORM
|
||||
|
||||
# rubocop:disable Naming/ClassAndModuleCamelCase
|
||||
# rubocop:disable-next Naming/ClassAndModuleCamelCase
|
||||
class FPDF_FORMFILLINFO_V2 < FFI::Struct
|
||||
layout :version, :int,
|
||||
:Release, :pointer,
|
||||
@@ -272,7 +271,6 @@ class Pdfium
|
||||
:FFI_OnFocusChange, :pointer,
|
||||
:FFI_DoURIActionWithKeyboardModifier, :pointer
|
||||
end
|
||||
# rubocop:enable Naming/ClassAndModuleCamelCase
|
||||
|
||||
attach_function :FPDFDOC_InitFormFillEnvironment, %i[FPDF_DOCUMENT pointer], :FPDF_FORMHANDLE
|
||||
attach_function :FPDFDOC_ExitFormFillEnvironment, [:FPDF_FORMHANDLE], :void
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
require 'puma/plugin'
|
||||
|
||||
# rubocop:disable Metrics
|
||||
# rubocop:disable-next Metrics
|
||||
Puma::Plugin.create do
|
||||
def start(launcher)
|
||||
return if ENV['LOCAL_REDIS_URL'].to_s.empty?
|
||||
@@ -68,4 +68,3 @@ Puma::Plugin.create do
|
||||
nil
|
||||
end
|
||||
end
|
||||
# rubocop:enable Metrics
|
||||
@@ -3,7 +3,7 @@
|
||||
require 'puma/plugin'
|
||||
require 'redis_client'
|
||||
|
||||
# rubocop:disable Metrics
|
||||
# rubocop:disable-next Metrics
|
||||
Puma::Plugin.create do
|
||||
def config(cfg)
|
||||
return if cfg.instance_variable_get(:@options)[:workers] <= 0
|
||||
@@ -73,4 +73,3 @@ Puma::Plugin.create do
|
||||
end
|
||||
end
|
||||
end
|
||||
# rubocop:enable Metrics
|
||||
@@ -32,7 +32,7 @@ module ReplaceEmailVariables
|
||||
|
||||
module_function
|
||||
|
||||
# rubocop:disable Metrics
|
||||
# rubocop:disable-next Metrics
|
||||
def call(text, submitter:, tracking_event_type: 'click_email', html_escape: false, sig: nil)
|
||||
text = replace(text, TEMPLATE_NAME, html_escape:) do
|
||||
(submitter.template || submitter.submission.template || submitter.submission).name
|
||||
@@ -94,7 +94,6 @@ module ReplaceEmailVariables
|
||||
|
||||
text.tr(ESCAPED_BRACES, '{}')
|
||||
end
|
||||
# rubocop:enable Metrics
|
||||
|
||||
def build_documents_links_text(submitter, sig = nil)
|
||||
url_options = build_url_options_for(submitter)
|
||||
|
||||
@@ -13,7 +13,7 @@ module SendWebhookRequest
|
||||
|
||||
module_function
|
||||
|
||||
# rubocop:disable Metrics/AbcSize
|
||||
# rubocop:disable-next Metrics/AbcSize
|
||||
def call(webhook_url, event_uuid:, event_type:, record:, data:, attempt: 0)
|
||||
uri = parse_uri(webhook_url.url)
|
||||
|
||||
@@ -53,7 +53,6 @@ module SendWebhookRequest
|
||||
rescue Faraday::Error => e
|
||||
handle_error(webhook_event, attempt:, error_message: e.message&.truncate(100))
|
||||
end
|
||||
# rubocop:enable Metrics/AbcSize
|
||||
|
||||
def parse_uri(url)
|
||||
URI(url)
|
||||
|
||||
@@ -14,7 +14,7 @@ module Submissions
|
||||
|
||||
module_function
|
||||
|
||||
# rubocop:disable Metrics
|
||||
# rubocop:disable-next Metrics
|
||||
def call(submission, submitters = nil, params = {}, with_events: true, with_documents: true, with_values: true,
|
||||
expires_at: Accounts.link_expires_at(Account.new(id: submission.account_id)))
|
||||
submitters ||= submission.submitters.preload(documents_attachments: :blob, attachments_attachments: :blob)
|
||||
@@ -62,7 +62,6 @@ module Submissions
|
||||
|
||||
json
|
||||
end
|
||||
# rubocop:enable Metrics
|
||||
|
||||
def build_status(submission, submitters)
|
||||
if submitters.any?(&:declined_at?)
|
||||
|
||||
@@ -21,7 +21,7 @@ module Submissions
|
||||
signature[:SubFilter] = :'ETSI.RFC3161'
|
||||
end
|
||||
|
||||
# rubocop:disable Metrics
|
||||
# rubocop:disable-next Metrics
|
||||
def sign(io, byte_range)
|
||||
digest = OpenSSL::Digest.new(HASH_ALGORITHM)
|
||||
|
||||
@@ -59,7 +59,6 @@ module Submissions
|
||||
|
||||
OpenSSL::ASN1::GeneralizedTime.new(Time.now.utc).to_der
|
||||
end
|
||||
# rubocop:enable Metrics
|
||||
|
||||
def build_payload(digest)
|
||||
req = OpenSSL::Timestamp::Request.new
|
||||
|
||||
+1
-2
@@ -197,7 +197,7 @@ module Submitters
|
||||
end
|
||||
end
|
||||
|
||||
# rubocop:disable Metrics
|
||||
# rubocop:disable-next Metrics
|
||||
def current_submitter_order?(submitter)
|
||||
submission = submitter.submission
|
||||
|
||||
@@ -228,7 +228,6 @@ module Submitters
|
||||
submitter.nil? || submitter.viewer? || submitter.completed_at?
|
||||
end
|
||||
end
|
||||
# rubocop:enable Metrics
|
||||
|
||||
def build_document_filename(submitter, blob, filename_format)
|
||||
return blob.filename.to_s if filename_format.blank?
|
||||
|
||||
@@ -19,7 +19,7 @@ module Submitters
|
||||
|
||||
module_function
|
||||
|
||||
# rubocop:disable Metrics
|
||||
# rubocop:disable-next Metrics
|
||||
def call(template, values, submitter_name: nil, role_names: nil, for_submitter: nil, throw_errors: false,
|
||||
add_fields: false, purpose: nil)
|
||||
fields =
|
||||
@@ -85,7 +85,6 @@ module Submitters
|
||||
|
||||
[normalized_values, attachments, new_fields]
|
||||
end
|
||||
# rubocop:enable Metrics
|
||||
|
||||
def normalize_value(field, value)
|
||||
if field['type'] == 'checkbox'
|
||||
|
||||
@@ -384,7 +384,7 @@ module Submitters
|
||||
end.exclude?(false)
|
||||
end
|
||||
|
||||
# rubocop:disable Metrics
|
||||
# rubocop:disable-next Metrics
|
||||
def check_field_condition(condition, submitter_values, fields_uuid_index)
|
||||
value = submitter_values[condition['field_uuid']]
|
||||
field = fields_uuid_index[condition['field_uuid']]
|
||||
@@ -437,7 +437,6 @@ module Submitters
|
||||
true
|
||||
end
|
||||
end
|
||||
# rubocop:enable Metrics
|
||||
|
||||
def replace_default_variables(value, attrs, submission, with_time: false, field: nil)
|
||||
return value if value.in?([true, false]) || value.is_a?(Numeric) || value.is_a?(Array)
|
||||
|
||||
@@ -4,7 +4,7 @@ module Templates
|
||||
module ReplaceAttachments
|
||||
module_function
|
||||
|
||||
# rubocop:disable Metrics
|
||||
# rubocop:disable-next Metrics
|
||||
def call(template, params = {}, extract_fields: false)
|
||||
documents, = Templates::CreateAttachments.call(template, params, extract_fields:)
|
||||
submitter = template.submitters.first
|
||||
@@ -60,6 +60,5 @@ module Templates
|
||||
|
||||
documents
|
||||
end
|
||||
# rubocop:enable Metrics
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user