ashmaroli (Ashwin Maroli)
- Login: ashmaroli
- Registered on: 08/09/2017
- Last sign in: 06/27/2021
Issues
| open | closed | Total | |
|---|---|---|---|
| Assigned issues | 0 | 0 | 0 |
| Reported issues | 0 | 2 | 2 |
Activity
09/08/2019
-
10:10 AM Ruby Feature #16150: Add a way to request a frozen string from to_s
- Similar to `Symbol#to_s`, even `nil.to_s` allocates a new string.
``` shell
irb(main):001:0> 5.times { p nil.to_s.__id__ }
21118460
21118340
21118180
21118100
21118000
```
IMO, since `nil` is a singleton, `nil.to_s` should als...
06/16/2019
-
06:46 AM Ruby Feature #15927: Allow string keys to be used for String#% and sprintf methods
- > Can you give us some actual use case(s) where such rewriting would not be possible, or very tedious?
One use-case would be where the Data used by `sprintf` is generated at runtime:
```ruby
require 'yaml'
# contents of 'path/to/...
06/03/2019
-
04:52 PM Ruby Bug #15895 (Closed): String#gsub and String#sub should return original string if no substitution(s) have been made
-
04:10 PM Ruby Bug #15895: String#gsub and String#sub should return original string if no substitution(s) have been made
- Thank you for pointing me to `CGI.escape_html`. I was not aware of it being faster than the `gsub` route. Moreover, you're right about the `gsub` usage not being a bottleneck in my codebase.
It simply resulted in numerous string alloc... -
09:18 AM Ruby Bug #15895 (Closed): String#gsub and String#sub should return original string if no substitution(s) have been made
- Currently if one were to call `'Hello World'.gsub(/[<&>]/, html_entities_hash)` , a copy of 'Hello World' is allocated and returned. If such a call were to occur inside a loop, then that would cause numerous copies to be allocated simply...
03/11/2019
-
10:08 AM Ruby Bug #15655 (Closed): Unable to handle Russian dirname on Windows
- I'm unable to work in a directory with a Russian name.
Running `bundle exec ...` returns an error from Bundler saying that it couldn't locate the Gemfile (which is present)
``` shell
# print current directory
> echo %CD%
=> D:\Евг...