[#97678] [Ruby master Feature#16752] :private param for const_set — bughitgithub@...
Issue #16752 has been reported by bughit (bug hit).
5 messages
2020/04/02
[ruby-core:97852] [Ruby master Feature#16779] Add sprintf %q format option
From:
eregontp@...
Date:
2020-04-12 10:57:30 UTC
List:
ruby-core #97852
Issue #16779 has been updated by Eregon (Benoit Daloze).
Isn't `%p` enough (which uses `#inspect`)?
----------------------------------------
Feature #16779: Add sprintf %q format option
https://bugs.ruby-lang.org/issues/16779#change-85076
* Author: gearnode (Bryan Frimin)
* Status: Open
* Priority: Normal
----------------------------------------
It would be great to have format option for quoted string for sprintf (like golang sprintf),
it's particularly useful to format log message for example.
Currently we have to do this:
``` ruby
sprintf("%s", some_value.inspect.dump)
```
I propose to introduce the `%q` format option which allow to do this:
```ruby
sprintf("%q", some_value)
```
---Files--------------------------------
add-quoted-string-sprintf-format.patch (1.52 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>