[#104004] [Ruby master Feature#17883] Load bundler/setup earlier to make `bundle exec ruby -r` respect Gemfile — mame@...
Issue #17883 has been reported by mame (Yusuke Endoh).
21 messages
2021/05/24
[ruby-core:104055] [Ruby master Feature#12913] A way to configure the default maximum width of pp
From:
nobu@...
Date:
2021-05-26 13:00:14 UTC
List:
ruby-core #104055
Issue #12913 has been updated by nobu (Nobuyoshi Nakada).
https://github.com/nobu/ruby/runs/2672425246?check_suite_focus=true#step:15:239
A test in rbs passes keyword arguments to `pp`.
Also @ko1 says he uses keywords arguments with `pp` very often.
----------------------------------------
Feature #12913: A way to configure the default maximum width of pp
https://bugs.ruby-lang.org/issues/12913#change-92197
* Author: mame (Yusuke Endoh)
* Status: Assigned
* Priority: Normal
* Assignee: nobu (Nobuyoshi Nakada)
----------------------------------------
How about having an easy way to configure the maximum width of a line of `pp` output?
Currently, `pp` accepts the maximum width as an optional argument:
pp(big_array, $>, 120)
However, this is obviously too long for a useful debugging-purpose method like `pp`. Even worse, we must add the fragment "`, $>, 120`" to all calls to `pp`. I don't feel this is reasonable.
The patch attached provides `PP.default_maxwidth=` and `PP.default_maxwidth`, which can be used to configure the default setting of the maxwidth.
PP.default_maxwidth = 1
pp([1, 2, 3])
#=> [1,
# 2,
# 3]
Akr-san, what do you think?
---Files--------------------------------
pp-default-maxwidth.patch (1.05 KB)
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>