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:
parent
9eea662733
commit
a090810f4c
1 changed files with 15 additions and 3 deletions
|
@ -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_.
|
||||
|
|
Loading…
Reference in a new issue