From: Benoit Daloze Date: 2010-12-28T09:47:29+09:00 Subject: Re: to_lang: my first gem, looking for feedback On 27 December 2010 23:46, Jimmy C. wrote: > Greetings, > > I've been working on a library that adds language translation methods to > strings using the Google Translate API. It's my first time writing a > gem, using RSpec, and documenting with YARD. I've gotten it to a point I > feel is worth sharing but I'd love any feedback anyone can provide on my > specs, the documentation, or the code in general. Feel free to be harsh > if it's bad, cause I'd like to learn and get better. > > The source code is on GitHub: https://github.com/jimmycuadra/to_lang > > Thanks in advance. :) > > P.S. The rules say no posting advertisements - I hope this doesn't come > across as one. Apologies if this is against the rules somehow. > > -- > Posted via http://www.ruby-forum.com/. > > You might be aware, but there is already a Google translate gem: https://github.com/caius/gtranslate It seems very well documented and the code is fine IMO. For the API, I prefer "org_to_dst" to "to_dst_from_org", but that is personal. A detail, but You define String#{method_missing,respond_to?}, and might override these methods if they were defined by another library. You should probably copy the old method with alias, and call it instead of super.