Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
cf46a13
#428 Reduce excessive calling of Sisimai::String.sweep in ARF
azumakuniyuki May 3, 2026
4e1cbe2
#428 Reduce excessive calling of Sisimai::String.sweep in Sisimai::Fact
azumakuniyuki May 3, 2026
41482ae
#428 Reduce excessive calling of Sisimai::String.sweep in Lhost::Acti…
azumakuniyuki May 3, 2026
ec8a2c4
#428 Reduce excessive calling of Sisimai::String.sweep in Lhost::Amaz…
azumakuniyuki May 3, 2026
3282962
#428 Reduce excessive calling of Sisimai::String.sweep in Lhost::Apac…
azumakuniyuki May 3, 2026
ed3f1e2
#428 Reduce excessive calling of Sisimai::String.sweep in Lhost::Biglobe
azumakuniyuki May 3, 2026
158c145
#428 Reduce excessive calling of Sisimai::String.sweep in Lhost::Courier
azumakuniyuki May 3, 2026
6787ece
#428 Reduce excessive calling of Sisimai::String.sweep in Lhost::Domino
azumakuniyuki May 3, 2026
ef165b6
#428 Reduce excessive calling of Sisimai::String.sweep in Lhost::Drag…
azumakuniyuki May 3, 2026
303d295
#428 Reduce excessive calling of Sisimai::String.sweep in Lhost::Eins…
azumakuniyuki May 3, 2026
bf1317b
#428 Reduce excessive calling of Sisimai::String.sweep in Lhost::Exch…
azumakuniyuki May 3, 2026
8268f19
#428 Reduce excessive calling of Sisimai::String.sweep in Lhost::Exch…
azumakuniyuki May 3, 2026
be862f2
#428 Reduce excessive calling of Sisimai::String.sweep in Lhost::Exim
azumakuniyuki May 3, 2026
f020f85
#428 Reduce excessive calling of Sisimai::String.sweep in Lhost::FML
azumakuniyuki May 3, 2026
0c86ecd
#428 Reduce excessive calling of Sisimai::String.sweep in Lhost::Gmail
azumakuniyuki May 3, 2026
c2af82e
#428 Reduce excessive calling of Sisimai::String.sweep in Lhost::GMX
azumakuniyuki May 3, 2026
c472d0a
#428 Reduce excessive calling of Sisimai::String.sweep in Lhost::Goog…
azumakuniyuki May 3, 2026
6b929ab
#428 Reduce excessive calling of Sisimai::String.sweep in Lhost::Goog…
azumakuniyuki May 3, 2026
474c99a
#428 Reduce excessive calling of Sisimai::String.sweep in Lhost::IMai…
azumakuniyuki May 3, 2026
80b2764
#428 Reduce excessive calling of Sisimai::String.sweep in Lhost::KDDI
azumakuniyuki May 3, 2026
56ceeb6
#428 Reduce excessive calling of Sisimai::String.sweep in Lhost::Mail…
azumakuniyuki May 3, 2026
6f17080
#428 Reduce excessive calling of Sisimai::String.sweep in Lhost::Mail…
azumakuniyuki May 3, 2026
489931b
#428 Reduce excessive calling of Sisimai::String.sweep in Lhost::Mess…
azumakuniyuki May 3, 2026
1828a94
#428 Reduce excessive calling of Sisimai::String.sweep in Lhost::MFilter
azumakuniyuki May 3, 2026
9937f33
#428 Reduce excessive calling of Sisimai::String.sweep in Lhost::Mime…
azumakuniyuki May 3, 2026
571e43b
#428 Reduce excessive calling of Sisimai::String.sweep in Lhost::Open…
azumakuniyuki May 3, 2026
699426e
#428 Reduce excessive calling of Sisimai::String.sweep in Lhost::Postfix
azumakuniyuki May 3, 2026
0bbe344
#428 Reduce excessive calling of Sisimai::String.sweep in Lhost::Qmail
azumakuniyuki May 3, 2026
f083b57
#428 Reduce excessive calling of Sisimai::String.sweep in Lhost::Send…
azumakuniyuki May 3, 2026
a40ae11
#428 Reduce excessive calling of Sisimai::String.sweep in Lhost::Tren…
azumakuniyuki May 3, 2026
90b2511
#428 Reduce excessive calling of Sisimai::String.sweep in Lhost::V5se…
azumakuniyuki May 3, 2026
5516feb
#428 Reduce excessive calling of Sisimai::String.sweep in Lhost::Verizon
azumakuniyuki May 3, 2026
73e1333
#428 Reduce excessive calling of Sisimai::String.sweep in Lhost::X1
azumakuniyuki May 3, 2026
19724c5
#428 Reduce excessive calling of Sisimai::String.sweep in Lhost::X2
azumakuniyuki May 3, 2026
81bbe51
#428 Reduce excessive calling of Sisimai::String.sweep in Lhost::X3
azumakuniyuki May 3, 2026
e52f6ee
#428 Reduce excessive calling of Sisimai::String.sweep in Lhost::X6
azumakuniyuki May 3, 2026
f44e7a6
#428 Reduce excessive calling of Sisimai::String.sweep in Lhost::Zoho
azumakuniyuki May 3, 2026
c13ef36
#428 Reduce excessive calling of Sisimai::String.sweep in Sisimai::Me…
azumakuniyuki May 3, 2026
8ddd874
#428 Reduce excessive calling of Sisimai::String.sweep in Sisimai::RF…
azumakuniyuki May 3, 2026
444af94
#428 Reduce excessive calling of Sisimai::String.sweep in Sisimai::RF…
azumakuniyuki May 3, 2026
3499ebc
#428 Reduce excessive calling of Sisimai::String.sweep in Sisimai::RF…
azumakuniyuki May 3, 2026
f1529dc
#428 Replace Sisimai::String.sweep with String#split and String#join
azumakuniyuki May 3, 2026
81e52a1
#428 Reduce excessive calling of Sisimai::String.sweep in Sisimai::Lh…
azumakuniyuki May 3, 2026
30f82f6
#428 Replace Sisimai::String.sweep with String#split and String#join
azumakuniyuki May 3, 2026
20c4dcf
#428 Replace Sisimai::String.sweep with String#split and String#join
azumakuniyuki May 3, 2026
1c64956
#428 Replace Sisimai::String.sweep with String#split and String#join
azumakuniyuki May 3, 2026
4a2c92c
#428 Replace Sisimai::String.sweep with String#split and String#join
azumakuniyuki May 3, 2026
9fca7b1
#428 Replace Sisimai::String.sweep with String#split and String#join
azumakuniyuki May 3, 2026
1b30263
#428 Replace Sisimai::String.sweep with String#split and String#join
azumakuniyuki May 3, 2026
435f00d
#428 Sisimai::String.sweep has been removed
azumakuniyuki May 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
#428 Sisimai::String.sweep has been removed
  • Loading branch information
azumakuniyuki committed May 3, 2026
commit 435f00d6c864b56e25d43c607ff8fa1dc08c2be2
12 changes: 0 additions & 12 deletions lib/sisimai/string.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,6 @@ def is_8bit(argvs)
return false
end

# Clean the string out
# @param [String] argv1 String to be cleaned
# @return [String] Cleaned out string
# @example Clean up text
# sweep(' neko ') #=> 'neko'
def sweep(argv1)
return argv1 if argv1.is_a?(::String) == false
argv1 = argv1.chomp.squeeze(' ').strip
argv1 = argv1.sub(/ [-]{2,}[^ ].+\z/, '')
return argv1
end

# Check if each element of the 2nd argument is aligned in the 1st argument or not
# @param [String] argv1 String to be checked
# @param [Array] argv2 List including the ordered strings
Expand Down
14 changes: 1 addition & 13 deletions test/public/string-test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require 'sisimai/string'

class StringTest < Minitest::Test
Methods = { class: %w[is_8bit sweep aligned to_plain to_utf8] }
Methods = { class: %w[is_8bit aligned to_plain to_utf8] }

def test_methods
Methods[:class].each { |e| assert_respond_to Sisimai::String, e }
Expand All @@ -20,18 +20,6 @@ def test_is_8bit
assert_match /wrong number of arguments/, ce.to_s
end

def test_sweep
assert_nil Sisimai::String.sweep(nil)
assert_equal 'neko nyaan', Sisimai::String.sweep(' neko nyaan ')
assert_equal 'nekochan !', Sisimai::String.sweep(' nekochan !')

ce = assert_raises ArgumentError do
Sisimai::String.sweep()
Sisimai::String.sweep("", "")
end
assert_match /wrong number of arguments/, ce.to_s
end

def test_aligned
fr = 'Final-Recipient: rfc822; <neko@example.jp>'
assert_equal false, Sisimai::String.aligned(nil, nil)
Expand Down
Loading