TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ruby 2.1 In Detail

112 pointsby timblairabout 11 years ago

4 comments

losvedirabout 11 years ago
Funny! I actually came across this article yesterday when trying to look into the current state of Ruby&#x27;s global method cache. I had a question about the write-up, so maybe I can ask it here!<p>The page says:<p>&gt; <i>This is now no longer an issue, Ruby 2.1 uses a method cache based on the class hierarchy, invalidating the cache for only the class in question and any subclasses.</i><p>How does this work with an <i>instance</i> of a class? Does it invalidate only that instance&#x27;s method cache, or all instances in that class? If I do DCI-style:<p><pre><code> @user.extend(PasswordConfirmable) </code></pre> Does that blow away the cache for all User instances, or just that one?
评论 #7703948 未加载
ollysbabout 11 years ago
There&#x27;s some great little improvements in there, to_h, required keywords and being able to decorate methods are all things that I regularly want. They&#x27;re really making good on their philosophy of optimising for developer happiness :)
grey-areaabout 11 years ago
Hurray, they fixed a little bug I reported: Dir glob returns composed characters. I hit this bug a year or so ago when processing files on OS X.<p>Thanks to the Ruby team for all the hard work on 2.1, it looks like there&#x27;s a lot of little changes in there.
anonovaabout 11 years ago
Does Ruby truly follow semantic versioning now? I still see the patch version.<p><pre><code> $ ruby -v ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin13.0]</code></pre>
评论 #7704458 未加载
评论 #7704031 未加载