开发者

Best way to learn new ruby gems? [closed]

开发者 https://www.devze.com 2023-03-08 01:55 出处:网络
Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing
Closed. This question is opinion-based. It is not currently accepting answers.

Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.

Closed 开发者_运维知识库9 years ago.

Improve this question

I wonder what is the best way to learn new gems when you first encounter it.

I know that you can check official website (easiest way!), check the Rdoc, generate yard doc, play in irb and of course, glad the source code.

But, what YOU do ? What's the more efficient method or process ? Any other tools to use ?


My favourite way of learning new gems (besides reading the readme sometimes) is gemedit:

gem edit <gem_name>
# vim opens the gem directory


Normally I search for Gems if I'm looking for a specified task that I think has already been implemented by somebody else (e.g. API Wrapper for Facebook or Twitter).

So I...

  • Read the homepage/wiki (at least parts of it)
  • Tutorials
  • Documentation, if I'm looking for something specific
  • Browse the code - this is often more effective than reading the docs, since the documentation and tutorials are sometimes outdated and/or for another version. The truth is always in the code.. ;)

Also you'll learn a lot by reading the stuff other people have written.


If you're using bundler installed you can run

bundle show <gem_name>
# or
bundle open <gem_name>

which will show the location of the gem or open it in the editor you have set.


If the gem is on Github, I also spend some time browsing the issues (both open and closed). There's a ton of insight to be found there, both in terms of how actively supported the gem is and how robust it is for potentially soling my problem(s).

0

精彩评论

暂无评论...
验证码 换一张
取 消