Packaging common code with gems

R

R.. Kumar

Let's say I have some common code, I use in various scripts or ruby
apps. I've got it in a common folder which I've put in my RUBYLIB
environment variable.

In the old days (Java), I'd put this in (say) commons.jar, and
distribute such jars with my apps. Now if i decide to put these apps on
github or create gems, how would i distribute the common code.

1. Should I keep copies with each app (more maintenance)
2. Should i create a common gem ?
3. Include these files in the gemspec (pointing to a folder outside the
tree)

thx.
 
I

Intransition

Let's say I have some common code, I use in various scripts or ruby
apps. I've got it in a common folder which I've put in my RUBYLIB
environment variable.

In the old days (Java), I'd put this in (say) commons.jar, and
distribute such jars with my apps. Now if i decide to put these apps on
github or create gems, how would i distribute the common code.

1. Should I keep copies with each app (more maintenance)
2. Should i create a common gem ?
3. Include these files in the gemspec (pointing to a folder outside the
tree)

#1 might not be so bad if you vendor them. That way there is no
dependency but there is central management.

Otherwise #2 is a good option. #3 sounds like a very bad idea.

You might also consider, how common is common? Are these libs common
enough that you might already find their equivalent in a support
library like ActiveSupport or Facets? Where your common libs do not
appear you mght even be able to contribute to those projects.

trans.
 
R

R.. Kumar

Thomas said:
#1 might not be so bad if you vendor them. That way there is no
dependency but there is central management.

Otherwise #2 is a good option. #3 sounds like a very bad idea.

You might also consider, how common is common? Are these libs common
enough that you might already find their equivalent in a support
library like ActiveSupport or Facets? Where your common libs do not
appear you mght even be able to contribute to those projects.

trans.

I haven't looked at ActiveSupport. These are command line apps (not web
stuff). These are not so common enough that Facets might have them.

I used Facets a few years back but lost touch with it. Is it 1.9
compliant ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top