Merge pull request #14922 from issyl0/rubocop-naming-method-parameter-name
rubocop: Trim `Naming/MethodParameterName` allowlist
This commit is contained in:
commit
993768106a
@ -182,8 +182,7 @@ Naming/MethodName:
|
|||||||
AllowedPatterns:
|
AllowedPatterns:
|
||||||
- '\A(fetch_)?HEAD\?\Z'
|
- '\A(fetch_)?HEAD\?\Z'
|
||||||
|
|
||||||
# allow those that are standard
|
# TODO: remove all of these
|
||||||
# TODO: try to remove some of these
|
|
||||||
Naming/MethodParameterName:
|
Naming/MethodParameterName:
|
||||||
inherit_mode:
|
inherit_mode:
|
||||||
merge:
|
merge:
|
||||||
@ -192,22 +191,12 @@ Naming/MethodParameterName:
|
|||||||
[
|
[
|
||||||
"a",
|
"a",
|
||||||
"b",
|
"b",
|
||||||
"cc",
|
|
||||||
"c1",
|
"c1",
|
||||||
"c2",
|
"c2",
|
||||||
"d",
|
|
||||||
"e",
|
"e",
|
||||||
"f",
|
"f",
|
||||||
"ff",
|
|
||||||
"fn",
|
|
||||||
"id",
|
|
||||||
"o",
|
"o",
|
||||||
"p",
|
|
||||||
"pr",
|
"pr",
|
||||||
"r",
|
|
||||||
"rb",
|
|
||||||
"s",
|
|
||||||
"v",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
# Both styles are used depending on context,
|
# Both styles are used depending on context,
|
||||||
|
|||||||
@ -57,7 +57,7 @@ module Cask
|
|||||||
downloader.basename
|
downloader.basename
|
||||||
end
|
end
|
||||||
|
|
||||||
def verify_download_integrity(fn)
|
def verify_download_integrity(filename)
|
||||||
if @cask.sha256 == :no_check
|
if @cask.sha256 == :no_check
|
||||||
opoo "No checksum defined for cask '#{@cask}', skipping verification."
|
opoo "No checksum defined for cask '#{@cask}', skipping verification."
|
||||||
return
|
return
|
||||||
@ -65,13 +65,13 @@ module Cask
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
ohai "Verifying checksum for cask '#{@cask}'" if verbose?
|
ohai "Verifying checksum for cask '#{@cask}'" if verbose?
|
||||||
fn.verify_checksum(@cask.sha256)
|
filename.verify_checksum(@cask.sha256)
|
||||||
rescue ChecksumMissingError
|
rescue ChecksumMissingError
|
||||||
opoo <<~EOS
|
opoo <<~EOS
|
||||||
Cannot verify integrity of '#{fn.basename}'.
|
Cannot verify integrity of '#{filename.basename}'.
|
||||||
No checksum was provided for this cask.
|
No checksum was provided for this cask.
|
||||||
For your reference, the checksum is:
|
For your reference, the checksum is:
|
||||||
sha256 "#{fn.sha256}"
|
sha256 "#{filename.sha256}"
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -117,8 +117,8 @@ class Cleaner
|
|||||||
#
|
#
|
||||||
# lib may have a large directory tree (see Erlang for instance), and
|
# lib may have a large directory tree (see Erlang for instance), and
|
||||||
# clean_dir applies cleaning rules to the entire tree
|
# clean_dir applies cleaning rules to the entire tree
|
||||||
def clean_dir(d)
|
def clean_dir(directory)
|
||||||
d.find do |path|
|
directory.find do |path|
|
||||||
path.extend(ObserverPathnameExtension)
|
path.extend(ObserverPathnameExtension)
|
||||||
|
|
||||||
Find.prune if @f.skip_clean? path
|
Find.prune if @f.skip_clean? path
|
||||||
|
|||||||
@ -196,17 +196,17 @@ module Homebrew
|
|||||||
str
|
str
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.deps_for_dependent(d, args:, recursive: false)
|
def self.deps_for_dependent(dependency, args:, recursive: false)
|
||||||
includes, ignores = args_includes_ignores(args)
|
includes, ignores = args_includes_ignores(args)
|
||||||
|
|
||||||
deps = d.runtime_dependencies if @use_runtime_dependencies
|
deps = dependency.runtime_dependencies if @use_runtime_dependencies
|
||||||
|
|
||||||
if recursive
|
if recursive
|
||||||
deps ||= recursive_includes(Dependency, d, includes, ignores)
|
deps ||= recursive_includes(Dependency, dependency, includes, ignores)
|
||||||
reqs = recursive_includes(Requirement, d, includes, ignores)
|
reqs = recursive_includes(Requirement, dependency, includes, ignores)
|
||||||
else
|
else
|
||||||
deps ||= reject_ignores(d.deps, ignores, includes)
|
deps ||= reject_ignores(dependency.deps, ignores, includes)
|
||||||
reqs = reject_ignores(d.requirements, ignores, includes)
|
reqs = reject_ignores(dependency.requirements, ignores, includes)
|
||||||
end
|
end
|
||||||
|
|
||||||
deps + reqs.to_a
|
deps + reqs.to_a
|
||||||
|
|||||||
@ -130,12 +130,12 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.fetch_resource(r, args:)
|
def self.fetch_resource(resource, args:)
|
||||||
puts "Resource: #{r.name}"
|
puts "Resource: #{resource.name}"
|
||||||
fetch_fetchable r, args: args
|
fetch_fetchable resource, args: args
|
||||||
rescue ChecksumMismatchError => e
|
rescue ChecksumMismatchError => e
|
||||||
retry if retry_fetch?(r, args: args)
|
retry if retry_fetch?(resource, args: args)
|
||||||
opoo "Resource #{r.name} reports different sha256: #{e.expected}"
|
opoo "Resource #{resource.name} reports different sha256: #{e.expected}"
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.fetch_formula(f, args:)
|
def self.fetch_formula(f, args:)
|
||||||
@ -152,8 +152,8 @@ module Homebrew
|
|||||||
opoo "Cask reports different sha256: #{e.expected}"
|
opoo "Cask reports different sha256: #{e.expected}"
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.fetch_patch(p, args:)
|
def self.fetch_patch(patch, args:)
|
||||||
fetch_fetchable p, args: args
|
fetch_fetchable patch, args: args
|
||||||
rescue ChecksumMismatchError => e
|
rescue ChecksumMismatchError => e
|
||||||
opoo "Patch reports different sha256: #{e.expected}"
|
opoo "Patch reports different sha256: #{e.expected}"
|
||||||
Homebrew.failed = true
|
Homebrew.failed = true
|
||||||
|
|||||||
@ -17,9 +17,9 @@ module Homebrew
|
|||||||
#
|
#
|
||||||
# @api private
|
# @api private
|
||||||
module Diagnostic
|
module Diagnostic
|
||||||
def self.missing_deps(ff, hide = nil)
|
def self.missing_deps(formulae, hide = nil)
|
||||||
missing = {}
|
missing = {}
|
||||||
ff.each do |f|
|
formulae.each do |f|
|
||||||
missing_dependencies = f.missing_dependencies(hide: hide)
|
missing_dependencies = f.missing_dependencies(hide: hide)
|
||||||
next if missing_dependencies.empty?
|
next if missing_dependencies.empty?
|
||||||
|
|
||||||
|
|||||||
@ -192,20 +192,20 @@ module Kernel
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def pretty_duration(s)
|
def pretty_duration(seconds)
|
||||||
s = s.to_i
|
seconds = seconds.to_i
|
||||||
res = +""
|
res = +""
|
||||||
|
|
||||||
if s > 59
|
if seconds > 59
|
||||||
m = s / 60
|
minutes = seconds / 60
|
||||||
s %= 60
|
seconds %= 60
|
||||||
res = +"#{m} #{Utils.pluralize("minute", m)}"
|
res = +"#{minutes} #{Utils.pluralize("minute", minutes)}"
|
||||||
return res.freeze if s.zero?
|
return res.freeze if seconds.zero?
|
||||||
|
|
||||||
res << " "
|
res << " "
|
||||||
end
|
end
|
||||||
|
|
||||||
res << "#{s} #{Utils.pluralize("second", s)}"
|
res << "#{seconds} #{Utils.pluralize("second", seconds)}"
|
||||||
res.freeze
|
res.freeze
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -471,14 +471,14 @@ module Kernel
|
|||||||
# preserving character encoding validity. The returned string will
|
# preserving character encoding validity. The returned string will
|
||||||
# be not much longer than the specified max_bytes, though the exact
|
# be not much longer than the specified max_bytes, though the exact
|
||||||
# shortfall or overrun may vary.
|
# shortfall or overrun may vary.
|
||||||
def truncate_text_to_approximate_size(s, max_bytes, options = {})
|
def truncate_text_to_approximate_size(str, max_bytes, options = {})
|
||||||
front_weight = options.fetch(:front_weight, 0.5)
|
front_weight = options.fetch(:front_weight, 0.5)
|
||||||
raise "opts[:front_weight] must be between 0.0 and 1.0" if front_weight < 0.0 || front_weight > 1.0
|
raise "opts[:front_weight] must be between 0.0 and 1.0" if front_weight < 0.0 || front_weight > 1.0
|
||||||
return s if s.bytesize <= max_bytes
|
return str if str.bytesize <= max_bytes
|
||||||
|
|
||||||
glue = "\n[...snip...]\n"
|
glue = "\n[...snip...]\n"
|
||||||
max_bytes_in = [max_bytes - glue.bytesize, 1].max
|
max_bytes_in = [max_bytes - glue.bytesize, 1].max
|
||||||
bytes = s.dup.force_encoding("BINARY")
|
bytes = str.dup.force_encoding("BINARY")
|
||||||
glue_bytes = glue.encode("BINARY")
|
glue_bytes = glue.encode("BINARY")
|
||||||
n_front_bytes = (max_bytes_in * front_weight).floor
|
n_front_bytes = (max_bytes_in * front_weight).floor
|
||||||
n_back_bytes = max_bytes_in - n_front_bytes
|
n_back_bytes = max_bytes_in - n_front_bytes
|
||||||
|
|||||||
@ -622,9 +622,9 @@ class Formula
|
|||||||
# This directory points to {#opt_prefix} if it exists and if #{prefix} is not
|
# This directory points to {#opt_prefix} if it exists and if #{prefix} is not
|
||||||
# called from within the same formula's {#install} or {#post_install} methods.
|
# called from within the same formula's {#install} or {#post_install} methods.
|
||||||
# Otherwise, return the full path to the formula's versioned cellar.
|
# Otherwise, return the full path to the formula's versioned cellar.
|
||||||
def prefix(v = pkg_version)
|
def prefix(version = pkg_version)
|
||||||
versioned_prefix = versioned_prefix(v)
|
versioned_prefix = versioned_prefix(version)
|
||||||
if !@prefix_returns_versioned_prefix && v == pkg_version &&
|
if !@prefix_returns_versioned_prefix && version == pkg_version &&
|
||||||
versioned_prefix.directory? && Keg.new(versioned_prefix).optlinked?
|
versioned_prefix.directory? && Keg.new(versioned_prefix).optlinked?
|
||||||
opt_prefix
|
opt_prefix
|
||||||
else
|
else
|
||||||
@ -643,10 +643,10 @@ class Formula
|
|||||||
end
|
end
|
||||||
|
|
||||||
# If a formula's linked keg points to the prefix.
|
# If a formula's linked keg points to the prefix.
|
||||||
def prefix_linked?(v = pkg_version)
|
def prefix_linked?(version = pkg_version)
|
||||||
return false unless linked?
|
return false unless linked?
|
||||||
|
|
||||||
linked_keg.resolved_path == versioned_prefix(v)
|
linked_keg.resolved_path == versioned_prefix(version)
|
||||||
end
|
end
|
||||||
|
|
||||||
# {PkgVersion} of the linked keg for the formula.
|
# {PkgVersion} of the linked keg for the formula.
|
||||||
@ -2281,8 +2281,8 @@ class Formula
|
|||||||
end
|
end
|
||||||
|
|
||||||
# @private
|
# @private
|
||||||
def verify_download_integrity(fn)
|
def verify_download_integrity(filename)
|
||||||
active_spec.verify_download_integrity(fn)
|
active_spec.verify_download_integrity(filename)
|
||||||
end
|
end
|
||||||
|
|
||||||
# @private
|
# @private
|
||||||
@ -2636,8 +2636,8 @@ class Formula
|
|||||||
|
|
||||||
# Returns the prefix for a given formula version number.
|
# Returns the prefix for a given formula version number.
|
||||||
# @private
|
# @private
|
||||||
def versioned_prefix(v)
|
def versioned_prefix(version)
|
||||||
rack/v
|
rack/version
|
||||||
end
|
end
|
||||||
|
|
||||||
def exec_cmd(cmd, args, out, logfn)
|
def exec_cmd(cmd, args, out, logfn)
|
||||||
|
|||||||
@ -23,8 +23,8 @@ module Homebrew
|
|||||||
other =~ @text
|
other =~ @text
|
||||||
end
|
end
|
||||||
|
|
||||||
def include?(s)
|
def include?(str)
|
||||||
@text.include? s
|
@text.include? str
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_s
|
def to_s
|
||||||
|
|||||||
@ -78,7 +78,7 @@ module OS
|
|||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
|
||||||
def sdk_path_if_needed(_v = nil)
|
def sdk_path_if_needed(_version = nil)
|
||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -113,11 +113,11 @@ module OS
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def sdk(v = nil)
|
def sdk(version = nil)
|
||||||
sdk_locator.sdk_if_applicable(v)
|
sdk_locator.sdk_if_applicable(version)
|
||||||
end
|
end
|
||||||
|
|
||||||
def sdk_for_formula(f, v = nil, check_only_runtime_requirements: false)
|
def sdk_for_formula(f, version = nil, check_only_runtime_requirements: false)
|
||||||
# If the formula requires Xcode, don't return the CLT SDK
|
# If the formula requires Xcode, don't return the CLT SDK
|
||||||
# If check_only_runtime_requirements is true, don't necessarily return the
|
# If check_only_runtime_requirements is true, don't necessarily return the
|
||||||
# Xcode SDK if the XcodeRequirement is only a build or test requirement.
|
# Xcode SDK if the XcodeRequirement is only a build or test requirement.
|
||||||
@ -128,16 +128,16 @@ module OS
|
|||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
sdk(v)
|
sdk(version)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns the path to an SDK or nil, following the rules set by {sdk}.
|
# Returns the path to an SDK or nil, following the rules set by {sdk}.
|
||||||
def sdk_path(v = nil)
|
def sdk_path(version = nil)
|
||||||
s = sdk(v)
|
s = sdk(version)
|
||||||
s&.path
|
s&.path
|
||||||
end
|
end
|
||||||
|
|
||||||
def sdk_path_if_needed(v = nil)
|
def sdk_path_if_needed(version = nil)
|
||||||
# Prefer CLT SDK when both Xcode and the CLT are installed.
|
# Prefer CLT SDK when both Xcode and the CLT are installed.
|
||||||
# Expected results:
|
# Expected results:
|
||||||
# 1. On Xcode-only systems, return the Xcode SDK.
|
# 1. On Xcode-only systems, return the Xcode SDK.
|
||||||
@ -148,7 +148,7 @@ module OS
|
|||||||
|
|
||||||
return unless sdk_root_needed?
|
return unless sdk_root_needed?
|
||||||
|
|
||||||
sdk_path(v)
|
sdk_path(version)
|
||||||
end
|
end
|
||||||
|
|
||||||
# See these issues for some history:
|
# See these issues for some history:
|
||||||
|
|||||||
@ -42,9 +42,9 @@ module OS
|
|||||||
|
|
||||||
class NoSDKError < StandardError; end
|
class NoSDKError < StandardError; end
|
||||||
|
|
||||||
sig { params(v: OS::Mac::Version).returns(SDK) }
|
sig { params(version: OS::Mac::Version).returns(SDK) }
|
||||||
def sdk_for(v)
|
def sdk_for(version)
|
||||||
sdk = all_sdks.find { |s| s.version == v }
|
sdk = all_sdks.find { |s| s.version == version }
|
||||||
raise NoSDKError if sdk.nil?
|
raise NoSDKError if sdk.nil?
|
||||||
|
|
||||||
sdk
|
sdk
|
||||||
@ -80,13 +80,13 @@ module OS
|
|||||||
@all_sdks
|
@all_sdks
|
||||||
end
|
end
|
||||||
|
|
||||||
sig { params(v: T.nilable(OS::Mac::Version)).returns(T.nilable(SDK)) }
|
sig { params(version: T.nilable(OS::Mac::Version)).returns(T.nilable(SDK)) }
|
||||||
def sdk_if_applicable(v = nil)
|
def sdk_if_applicable(version = nil)
|
||||||
sdk = begin
|
sdk = begin
|
||||||
if v.blank?
|
if version.blank?
|
||||||
sdk_for OS::Mac.version
|
sdk_for OS::Mac.version
|
||||||
else
|
else
|
||||||
sdk_for v
|
sdk_for version
|
||||||
end
|
end
|
||||||
rescue NoSDKError
|
rescue NoSDKError
|
||||||
latest_sdk
|
latest_sdk
|
||||||
@ -95,7 +95,7 @@ module OS
|
|||||||
|
|
||||||
# On OSs lower than 11, whenever the major versions don't match,
|
# On OSs lower than 11, whenever the major versions don't match,
|
||||||
# only return an SDK older than the OS version if it was specifically requested
|
# only return an SDK older than the OS version if it was specifically requested
|
||||||
return if v.blank? && sdk.version < OS::Mac.version
|
return if version.blank? && sdk.version < OS::Mac.version
|
||||||
|
|
||||||
sdk
|
sdk
|
||||||
end
|
end
|
||||||
|
|||||||
@ -140,14 +140,14 @@ module OS
|
|||||||
@sdk_locator ||= XcodeSDKLocator.new
|
@sdk_locator ||= XcodeSDKLocator.new
|
||||||
end
|
end
|
||||||
|
|
||||||
sig { params(v: T.nilable(MacOS::Version)).returns(T.nilable(SDK)) }
|
sig { params(version: T.nilable(MacOS::Version)).returns(T.nilable(SDK)) }
|
||||||
def sdk(v = nil)
|
def sdk(version = nil)
|
||||||
sdk_locator.sdk_if_applicable(v)
|
sdk_locator.sdk_if_applicable(version)
|
||||||
end
|
end
|
||||||
|
|
||||||
sig { params(v: T.nilable(MacOS::Version)).returns(T.nilable(Pathname)) }
|
sig { params(version: T.nilable(MacOS::Version)).returns(T.nilable(Pathname)) }
|
||||||
def sdk_path(v = nil)
|
def sdk_path(version = nil)
|
||||||
sdk(v)&.path
|
sdk(version)&.path
|
||||||
end
|
end
|
||||||
|
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
@ -290,14 +290,14 @@ module OS
|
|||||||
@sdk_locator ||= CLTSDKLocator.new
|
@sdk_locator ||= CLTSDKLocator.new
|
||||||
end
|
end
|
||||||
|
|
||||||
sig { params(v: T.nilable(MacOS::Version)).returns(T.nilable(SDK)) }
|
sig { params(version: T.nilable(MacOS::Version)).returns(T.nilable(SDK)) }
|
||||||
def sdk(v = nil)
|
def sdk(version = nil)
|
||||||
sdk_locator.sdk_if_applicable(v)
|
sdk_locator.sdk_if_applicable(version)
|
||||||
end
|
end
|
||||||
|
|
||||||
sig { params(v: T.nilable(MacOS::Version)).returns(T.nilable(Pathname)) }
|
sig { params(version: T.nilable(MacOS::Version)).returns(T.nilable(Pathname)) }
|
||||||
def sdk_path(v = nil)
|
def sdk_path(version = nil)
|
||||||
sdk(v)&.path
|
sdk(version)&.path
|
||||||
end
|
end
|
||||||
|
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
|
|||||||
@ -118,9 +118,9 @@ module Readall
|
|||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def syntax_errors_or_warnings?(rb)
|
def syntax_errors_or_warnings?(filename)
|
||||||
# Retrieve messages about syntax errors/warnings printed to `$stderr`.
|
# Retrieve messages about syntax errors/warnings printed to `$stderr`.
|
||||||
_, err, status = system_command(RUBY_PATH, args: ["-c", "-w", rb], print_stderr: false)
|
_, err, status = system_command(RUBY_PATH, args: ["-c", "-w", filename], print_stderr: false)
|
||||||
|
|
||||||
# Ignore unnecessary warning about named capture conflicts.
|
# Ignore unnecessary warning about named capture conflicts.
|
||||||
# See https://bugs.ruby-lang.org/issues/12359.
|
# See https://bugs.ruby-lang.org/issues/12359.
|
||||||
|
|||||||
@ -187,17 +187,17 @@ class Resource
|
|||||||
download
|
download
|
||||||
end
|
end
|
||||||
|
|
||||||
def verify_download_integrity(fn)
|
def verify_download_integrity(filename)
|
||||||
if fn.file?
|
if filename.file?
|
||||||
ohai "Verifying checksum for '#{fn.basename}'" if verbose?
|
ohai "Verifying checksum for '#{filename.basename}'" if verbose?
|
||||||
fn.verify_checksum(checksum)
|
filename.verify_checksum(checksum)
|
||||||
end
|
end
|
||||||
rescue ChecksumMissingError
|
rescue ChecksumMissingError
|
||||||
opoo <<~EOS
|
opoo <<~EOS
|
||||||
Cannot verify integrity of '#{fn.basename}'.
|
Cannot verify integrity of '#{filename.basename}'.
|
||||||
No checksum was provided for this resource.
|
No checksum was provided for this resource.
|
||||||
For your reference, the checksum is:
|
For your reference, the checksum is:
|
||||||
sha256 "#{fn.sha256}"
|
sha256 "#{filename.sha256}"
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -286,7 +286,7 @@ class HeadSoftwareSpec < SoftwareSpec
|
|||||||
@resource.version = Version.create("HEAD")
|
@resource.version = Version.create("HEAD")
|
||||||
end
|
end
|
||||||
|
|
||||||
def verify_download_integrity(_fn)
|
def verify_download_integrity(_filename)
|
||||||
# no-op
|
# no-op
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -50,14 +50,14 @@ module Formatter
|
|||||||
# so we always wrap one word before an option.
|
# so we always wrap one word before an option.
|
||||||
# @see https://github.com/Homebrew/brew/pull/12672
|
# @see https://github.com/Homebrew/brew/pull/12672
|
||||||
# @see https://macromates.com/blog/2006/wrapping-text-with-regular-expressions/
|
# @see https://macromates.com/blog/2006/wrapping-text-with-regular-expressions/
|
||||||
def format_help_text(s, width: 172)
|
def format_help_text(str, width: 172)
|
||||||
desc = OPTION_DESC_WIDTH
|
desc = OPTION_DESC_WIDTH
|
||||||
indent = width - desc
|
indent = width - desc
|
||||||
s.gsub(/(?<=\S) *\n(?=\S)/, " ")
|
str.gsub(/(?<=\S) *\n(?=\S)/, " ")
|
||||||
.gsub(/([`>)\]]:) /, "\\1\n ")
|
.gsub(/([`>)\]]:) /, "\\1\n ")
|
||||||
.gsub(/^( +-.+ +(?=\S.{#{desc}}))(.{1,#{desc}})( +|$)(?!-)\n?/, "\\1\\2\n#{" " * indent}")
|
.gsub(/^( +-.+ +(?=\S.{#{desc}}))(.{1,#{desc}})( +|$)(?!-)\n?/, "\\1\\2\n#{" " * indent}")
|
||||||
.gsub(/^( {#{indent}}(?=\S.{#{desc}}))(.{1,#{desc}})( +|$)(?!-)\n?/, "\\1\\2\n#{" " * indent}")
|
.gsub(/^( {#{indent}}(?=\S.{#{desc}}))(.{1,#{desc}})( +|$)(?!-)\n?/, "\\1\\2\n#{" " * indent}")
|
||||||
.gsub(/(.{1,#{width}})( +|$)(?!-)\n?/, "\\1\n")
|
.gsub(/(.{1,#{width}})( +|$)(?!-)\n?/, "\\1\n")
|
||||||
end
|
end
|
||||||
|
|
||||||
def url(string)
|
def url(string)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user