TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ruby 2.1 In Detail

112 点作者 timblair大约 11 年前

4 条评论

losvedir大约 11 年前
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 未加载
ollysb大约 11 年前
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-area大约 11 年前
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.
anonova大约 11 年前
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 未加载