зеркало из https://github.com/github/ruby.git
[ruby/reline] Define StringWithTiparm instead of singular method
https://github.com/ruby/reline/commit/de234dc875
This commit is contained in:
Родитель
5b9f3ed326
Коммит
0f496b9b29
|
@ -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)
|
||||
|
|
Загрузка…
Ссылка в новой задаче