From 0f496b9b29a38cfe39710c96111549d387f73321 Mon Sep 17 00:00:00 2001 From: aycabta Date: Thu, 24 Jun 2021 18:04:02 +0900 Subject: [ruby/reline] Define StringWithTiparm instead of singular method https://github.com/ruby/reline/commit/de234dc875 --- lib/reline/terminfo.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/reline/terminfo.rb b/lib/reline/terminfo.rb index 53809c4937..5c881a375c 100644 --- a/lib/reline/terminfo.rb +++ b/lib/reline/terminfo.rb @@ -72,12 +72,14 @@ module Reline::Terminfo end end - def self.tigetstr(capname) - result = @tigetstr.(capname).to_s - def result.tiparm(*args) # for method chain + class StringWithTiparm < String + def tiparm(*args) # for method chain Reline::Terminfo.tiparm(self, *args) end - result + end + + def self.tigetstr(capname) + StringWithTiparm.new(@tigetstr.(capname).to_s) end def self.tiparm(str, *args) -- cgit v1.2.3