Lots of rubocop

This commit is contained in:
Maruno17
2023-01-28 15:21:12 +00:00
parent 2d056052ce
commit 13aab8d911
159 changed files with 1679 additions and 1931 deletions

View File

@@ -41,9 +41,7 @@ class CharacterEntryHelper
return false if @maxlength >= 0 && chars.length >= @maxlength
chars.insert(@cursor, ch)
@text = ""
chars.each do |ch|
@text += ch if ch
end
chars.each { |char| @text += char if char }
@cursor += 1
return true
end
@@ -66,14 +64,14 @@ class CharacterEntryHelper
return true
end
#-----------------------------------------------------------------------------
private
def ensure
return if @maxlength < 0
chars = self.text.scan(/./m)
if chars.length > @maxlength && @maxlength >= 0
chars = chars[0, @maxlength]
end
chars = chars[0, @maxlength] if chars.length > @maxlength && @maxlength >= 0
@text = ""
chars.each do |ch|
@text += ch if ch