Alexey
Alexey

Reputation: 9447

Rails: When and why to create a gem/plugin?

While working on my project, I created 3 mini-libraries (100-1000 lines). They are quite complete for the their purposes, though of cause they maybe do not suite any relevant use case.

So the question is: what should i conider deciding if i should make a plug-in/gem from it and publish? When it worth and it doesn't to publish a library?

It would be nice if you supported you advice with some of successful or frustrating experience of creating and publishing a gem/plug-in.

Update:

I've finally published a plug-in: active_factory

Upvotes: 0

Views: 145

Answers (2)

Rein Henrichs
Rein Henrichs

Reputation: 15605

Make it a gem when you think you or others might reuse the code, or simply because you want to manage its development (and tests, etc) separately. The cost is trivial.

Upvotes: 1

Mike Lewis
Mike Lewis

Reputation: 64137

I'd say you should consider making it a plugin/gem when you think the idea is modular enough to be a drop and use(with some configuration if needed) for other projects. You should publish it if you think others will also find it useful.

I want to note that I said the "idea" is modular enough. Right now your implementation many not be completely modular, however if the idea itself is, then I'd spend some time making the implementation modular.

In terms of what deems a gem 'useful', I would initially just put it out in the public(aka github for example) and see if there is interest. Some of the greatest ideas spawned from just throwing it out there into the public. You can try your hardest to think about what others are thinking, but you never know until your try. And in this case, there really isn't much overhead in putting it out in the public.

Upvotes: 3

Related Questions