Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 10 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(1)
是的!
Authlogic 很可能是我读过的最复杂、文档最齐全、最有趣的宝石。它完美地展示了如何建造宝石。也就是说,我不使用 Authlogic,只是因为我喜欢在 Rack 中间件中进行身份验证。如果您对 Rack 以及与 Rack 一起使用的宝石感兴趣,请尝试阅读 Warden。它同样优雅且非常有趣。
如果您想要一些令人兴奋的阅读,请深入研究 Unicorn 源代码。它们使用您可能不知道的 ruby 部分,即内核交互。
另外,很明显,Rails 源代码是值得阅读的好东西,尤其是自 Rails 3 以来。
这有点取决于您想用 gem 完成什么,但这些是一些很好的起点。您能做的最好的事情就是当您有问题时直接查看源代码,而不是查看文档。一开始会比较慢,但最终你会成为超级红宝石忍者。
Yes!
Authlogic may well be the most complex, well documented, and interesting gem I've ever read. It's a beautiful display of how a gem should be built. That said, I don't use Authlogic, but only because I like authentication to live in the Rack middleware. If you are interested in Rack and gems that play with Rack, try reading through Warden. It's similarly elegant and pretty interesting.
If you want some mindblowing reading, dig into the Unicorn source code. They play with parts of ruby you probably didn't know existed, namely Kernel interaction.
Also, and somewhat obviously, the Rails source is a great thing to read through, especially since Rails 3.
It kinda depends what you want to accomplish with your gems, but these are some good starting points. The best thing you can do is to go straight to the source when you have a question instead of going to documentation. It'll be slower at first, but eventually you'll just become a super ruby ninja.