[#71439] [Ruby trunk - Feature #11339] [PATCH] io.c: avoid kwarg parsing in C API — matz@...
Issue #11339 has been updated by Yukihiro Matsumoto.
7 messages
2015/11/11
[#71473] Re: [Ruby trunk - Feature #11339] [PATCH] io.c: avoid kwarg parsing in C API
— Eric Wong <normalperson@...>
2015/11/13
Entire series for sockets
[#71450] Ruby 2.3.0-preview1 Released — "NARUSE, Yui" <naruse@...>
Hi,
5 messages
2015/11/11
[#71617] [Ruby trunk - Feature #11664] [PATCH] introduce rb_autoload_value to replace rb_autoload — nobu@...
Issue #11664 has been updated by Nobuyoshi Nakada.
3 messages
2015/11/20
[#71721] [Ruby trunk - Feature #11741] Migrate Ruby to Git from Subversion — me@...
Issue #11741 has been updated by Jon Moss.
4 messages
2015/11/28
[ruby-core:71685] [Ruby trunk - Feature #11735] Porting String#squish and String#squish! from Ruby on Rails' Active Support
From:
deivid.rodriguez@...
Date:
2015-11-25 17:03:06 UTC
List:
ruby-core #71685
Issue #11735 has been updated by David Rodr=C3=ADguez. I don't think the two features are the same, and would find both of them us= eful. ---------------------------------------- Feature #11735: Porting String#squish and String#squish! from Ruby on Rails= ' Active Support https://bugs.ruby-lang.org/issues/11735#change-55089 * Author: Prem Sichanugrist * Status: Open * Priority: Normal * Assignee:=20 ---------------------------------------- Hi, I have been using this `String#squish` method so many time when I'm using R= ails, and I think it should be a useful addition to core. Here's the method on Rails' documentation: http://api.rubyonrails.org/v4.2.= 5/classes/String.html#method-i-squish This method is very useful when you have to write a multi-line string using= heredoc, but you actually does not care about the white-spaces before, aft= er, and in-between the string. For example: ~~~ruby <<-SQL.squish SELECT * FROM users WHERE users.username =3D 'sikachu' SQL #=3D> "SELECT * FROM users WHERE users.username=3D'sikachu'" ~~~ Another example usage is when you are on the project that have a line lengt= h code standard, and you have to write a long warning message that needs to= be printed to stdout: ~~~ruby puts <<-WARNING.squish Unable to connect to the server. Please double-check that you are current= ly connecting to the internet and your proxy server is working. WARNING #=3D> Unable to connect to the server. Please double-check that you are cur= rently connecting to the internet and your proxy server is working. ~~~ By the way, this is my first patch and my first time writing something in C= , so there might be something that does not look right to you. I'll happy t= o revise this patch (and learn about C in the process!) from your feedback. Thank you, Prem ---Files-------------------------------- 0001-Introduce-String-squish-and-String-squish.patch (4.67 KB) --=20 https://bugs.ruby-lang.org/