1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

added text.no_pager method to turn off paging for the duration of a block

This commit is contained in:
John Mair 2011-12-11 21:33:33 +13:00
parent 9eea662733
commit a090810f4c

View file

@ -61,11 +61,23 @@ class Pry
# @param [Proc]
# @return [void]
def no_color &block
boolean = Pry.color
Pry.color = false
boolean = Pry.config.color
Pry.config.color = false
yield
ensure
Pry.color = boolean
Pry.config.color = boolean
end
# Executes _block_ with _Pry.config.pager_ set to false.
#
# @param [Proc]
# @return [void]
def no_pager &block
boolean = Pry.config.pager
Pry.config.pager = false
yield
ensure
Pry.config.pager = boolean
end
# Returns _text_ in a numbered list, beginning at _offset_.