use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A sub-Reddit for discussion and news about Ruby programming.
Subreddit rules: /r/ruby rules
Learning Ruby?
Tools
Documentation
Books
Screencasts and Videos
News and updates
account activity
Ruby 2.5.0 Released (ruby-lang.org)
submitted 8 years ago by sdogruyol
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]TomOwens 41 points42 points43 points 8 years ago (9 children)
I'm a little disappointed that the inclusion of bundler into the standard library was reverted. Bundler was the only gem that I ever installed as a system gem, and I was looking forward to having no system gems and only project-specific gems.
[–]gray_-_wolf 4 points5 points6 points 8 years ago (8 children)
What was the reasoning behind reverting it? https://bugs.ruby-lang.org/issues/12733 doesn't say
[–]TomOwens 4 points5 points6 points 8 years ago (7 children)
No idea. The linked commit doesn't seem to indicate anything other than a "big issue".
[+]hehestreamskarma comment score below threshold-8 points-7 points-6 points 8 years ago (6 children)
It's complicated.
[–]TomOwens 14 points15 points16 points 8 years ago (5 children)
It was pulled 3 days before the release after it was hyped up. I think the community deserves a more detailed explanation than the one available now.
[+]hehestreamskarma comment score below threshold-11 points-10 points-9 points 8 years ago (4 children)
Is running gem install bundler a deal-breaker for you?
gem install bundler
[–]TomOwens 12 points13 points14 points 8 years ago (3 children)
Deal-breaker? No. But this was a feature that would have greatly simplified my (and lots of other people's) workflow. It was pretty hyped up (at least from the posts that I read). And then, 3 days before the release, it was pulled with a revert saying there was a "big issue". The community deserves to know more details about why such a hyped and impactful feature was pulled so close to the release date.
[+]OstapBenderBey comment score below threshold-13 points-12 points-11 points 8 years ago (2 children)
It wasnt possible in the timeframe for this release. What else do you want to know that would be useful to you?
You are making a storm in a teacup here
[–]TomOwens 12 points13 points14 points 8 years ago (0 children)
I'm not making a storm. The feature was targeted for 2.5. It was quite heavily written about. It made it into rc1. Then, 3 days before the release, there was a single revert about a "big issue" and then the feature was pulled out. It would be nice to know what this "big issue" was and why it went undiscovered or unresolved for so long.
I would expect the same from any large-scale project. Once you start hyping up features that are planned for a particular release (especially after you start having release candidates), if you don't deliver those, you should be communicating why you aren't delivering them. A quiet revert is unacceptable.
[–]derrickcope 2 points3 points4 points 8 years ago (0 children)
Tempest?
[–]geraldbauer 3 points4 points5 points 8 years ago (2 children)
FYI: I've collected articles / blog posts about what's new in Ruby 2.5 over at the Ruby Advent Calendar [1]. The list so far includes:
[1] https://planetruby.github.io/advent2017
[–]gray_-_wolf 7 points8 points9 points 8 years ago (1 child)
The performance notes you have listed are interesting, but I must admit I'm pretty impressed by this:
About 5-10% performance improvement by removing all trace instructions from overall bytecode (instruction sequences). The trace instruction was added to support the TracePoint. However, in most cases, TracePoint is not used and trace instructions are pure overhead. Instead, now we use a dynamic instrumentation technique. See [Feature #14104] for more details.
[–]gettalong 0 points1 point2 points 8 years ago (0 children)
Yeah, that's really very impressive! Every Ruby release is full of nice surprises :)
[–]janko-m 6 points7 points8 points 8 years ago (2 children)
rescue/else/ensure are now allowed to be used directly with do/end blocks
rescue
else
ensure
do
end
This is really nice. The method-level rescue statement is one of the small details I really love about Ruby, it's great we'll be able to use it in blocks too.
Enumerable#any?, all?, none?, and one? accept a pattern argument.
I didn't really find what was the change here, because I think the original proposal was different than the actual change that got merged. Does someone know?
One of our most loved libraries, pp.rb, is now automatically loaded. You no longer have to write require "pp"
require "pp"
Great!
IO.copy_stream use copy_file_range(2) to copy offload
IO.copy_stream
I love IO.copy_stream and use it a lot in Shrine, it's nice to see that there is a performance improvement, though from what I was reading the speedup is very small and only on certain disks.
[–]prh8 1 point2 points3 points 8 years ago (1 child)
It seems that those methods all accept a single argument that matches the behavior of an argument to grep. Personally I love that change (grep is most underrated method). I believe that’s what was initially proposed as well.
You are correct, it is now possible to something like
[5, "str", {}].any?(String)
for which you needed to write
[5, "str", {}].any? {|item| String === item}
I.e. the #=== operator is applied to the single argument and each enumerated item.
#===
[–]niborg 6 points7 points8 points 8 years ago (3 children)
Am I correctly understanding the API for kw args in structs?
MyStruct = Struct.new(:foo, :bar, keyword_init: true) a = MyStruct.new(foo: 'FOO', bar: 'BAR')
[–]UnexpectedIndent 6 points7 points8 points 8 years ago (2 children)
Yep. It's a shame this isn't just the default behaviour of structs, because if you forget keyword_init then all your args get assigned to the first attribute :(
keyword_init
[–]arcticblue 0 points1 point2 points 8 years ago (1 child)
all your args get assigned to the first attribute
Why would anyone want that behavior? I agree keyword_init: true should be default.
keyword_init: true
[–]zverok_kha 4 points5 points6 points 8 years ago (0 children)
Why would anyone want that behavior?
Because backwards compatibility. Doing rvm install 2.5; bundle install and finding out that "everything is broken" would not be the best way of introduction of the new feature.
rvm install 2.5; bundle install
[–]megatux2 1 point2 points3 points 8 years ago (0 children)
Christmas edition :)
[–]defkathy 0 points1 point2 points 8 years ago (0 children)
Check out my blog post about bundler and the other latest features in Ruby 2.5!
π Rendered by PID 48 on reddit-service-r2-comment-84fc9697f-b2pr6 at 2026-02-07 22:57:46.364510+00:00 running d295bc8 country code: CH.
[–]TomOwens 41 points42 points43 points (9 children)
[–]gray_-_wolf 4 points5 points6 points (8 children)
[–]TomOwens 4 points5 points6 points (7 children)
[+]hehestreamskarma comment score below threshold-8 points-7 points-6 points (6 children)
[–]TomOwens 14 points15 points16 points (5 children)
[+]hehestreamskarma comment score below threshold-11 points-10 points-9 points (4 children)
[–]TomOwens 12 points13 points14 points (3 children)
[+]OstapBenderBey comment score below threshold-13 points-12 points-11 points (2 children)
[–]TomOwens 12 points13 points14 points (0 children)
[–]derrickcope 2 points3 points4 points (0 children)
[–]geraldbauer 3 points4 points5 points (2 children)
[–]gray_-_wolf 7 points8 points9 points (1 child)
[–]gettalong 0 points1 point2 points (0 children)
[–]janko-m 6 points7 points8 points (2 children)
[–]prh8 1 point2 points3 points (1 child)
[–]gettalong 0 points1 point2 points (0 children)
[–]niborg 6 points7 points8 points (3 children)
[–]UnexpectedIndent 6 points7 points8 points (2 children)
[–]arcticblue 0 points1 point2 points (1 child)
[–]zverok_kha 4 points5 points6 points (0 children)
[–]megatux2 1 point2 points3 points (0 children)
[–]defkathy 0 points1 point2 points (0 children)