# Worthwhile to build a gem?

**URL:** <https://www.ruby-forum.com/t/worthwhile-to-build-a-gem/142050>\
**Category:** Ruby\
**Created:** [July 2, 2008, 11:17pm UTC](https://www.ruby-forum.com/t/worthwhile-to-build-a-gem/142050 "2008-07-02T23:17:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![S-gw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ed655f/32.png) [@S-gw](https://www.ruby-forum.com/u/S-gw)\
**Post date:** [July 2, 2008, 11:17pm UTC](https://www.ruby-forum.com/t/worthwhile-to-build-a-gem/142050/1 "2008-07-02T23:17:51Z")

</div>

I have a project where a number of internally-developed Ruby libraries  
will need to be installed on numerous machines. Small apps will then be  
written using this set of libraries almost like a framework really.

Is it worth considering building a gem out of this library and running a  
private gem server in order to manage these libraries? The alternative  
would be to maintain working copies (maybe in site\_ruby?) from an svn  
server – much like you’d typically maintain a Rails app on servers.

This site seems to to be very out of date [http://docs.rubygems.org/](http://docs.rubygems.org/)  
based on the version numbers and self-proclaimed recent updates page.

This page [http://docs.rubygems.org/read/chapter/5](http://docs.rubygems.org/read/chapter/5) says to see the  
DevelopersGuide, but I can’t find such a critter anywhere, so where is  
there current info available on building gems?

Thx.

– gw

---

<div class="post-metadata">

**Author:** ![S-gw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ed655f/32.png) [@S-gw](https://www.ruby-forum.com/u/S-gw)\
**Post date:** [July 3, 2008, 12:11am UTC](https://www.ruby-forum.com/t/worthwhile-to-build-a-gem/142050/2 "2008-07-03T00:11:36Z")

</div>

On Jul 2, 5:14 pm, Greg W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I have a project where a number of internally-developed Ruby libraries  
> will need to be installed on numerous machines. Small apps will then be  
> written using this set of libraries almost like a framework really.

Will these libraries all be in single project (ie. gem), or do your  
see them each as separate projects?

> Is it worth considering building a gem out of this library and running a  
> private gem server in order to manage these libraries? The alternative  
> would be to maintain working copies (maybe in site\_ruby?) from an svn  
> server – much like you’d typically maintain a Rails app on servers.

your using svn rather than git I take it.

T.

---

<div class="post-metadata">

**Author:** ![S-gw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ed655f/32.png) [@S-gw](https://www.ruby-forum.com/u/S-gw)\
**Post date:** [July 3, 2008, 2:57am UTC](https://www.ruby-forum.com/t/worthwhile-to-build-a-gem/142050/3 "2008-07-03T02:57:47Z")

</div>

On Jul 2, 2008, at 14:14 PM, Greg W. wrote:

> This site seems to to be very out of date [http://docs.rubygems.org/](http://docs.rubygems.org/)  
> based on the version numbers and self-proclaimed recent updates page.
> 
> This page [http://docs.rubygems.org/read/chapter/5](http://docs.rubygems.org/read/chapter/5) says to see the  
> DevelopersGuide, but I can’t find such a critter anywhere, so where is  
> there current info available on building gems?

Rake::GemPackageTask is probably what you’ll find easiest for this:

Rake::PackageTask.new(“package”) do |p|  
p.name = PKG\_NAME # string  
p.version = PKG\_VERSION # string  
p.package\_files = PKG\_FILES # array  
end

---

<div class="post-metadata">

**Author:** ![S-gw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ed655f/32.png) [@S-gw](https://www.ruby-forum.com/u/S-gw)\
**Post date:** [July 3, 2008, 3:36am UTC](https://www.ruby-forum.com/t/worthwhile-to-build-a-gem/142050/4 "2008-07-03T03:36:58Z")

</div>

On Jul 2, 6:59 pm, Greg W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> server side data aggregation apps.  
> Cool. I’d say create a gem for it. Would Capistrano be helpful?

> > > Is it worth considering building a gem out of this library and running a  
> > > private gem server in order to manage these libraries? The alternative  
> > > would be to maintain working copies (maybe in site\_ruby?) from an svn  
> > > server – much like you’d typically maintain a Rails app on servers.
> 
> > your [you’re] using svn rather than git I take it.
> 
> svn, yes. If I changed my code with every new fasionable thing, I’d  
> never get anything done. svn works just fine for me.

🙂 i can relate.

T.

---

<div class="post-metadata">

**Author:** ![S-gw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ed655f/32.png) [@S-gw](https://www.ruby-forum.com/u/S-gw)\
**Post date:** [July 3, 2008, 1:02am UTC](https://www.ruby-forum.com/t/worthwhile-to-build-a-gem/142050/5 "2008-07-03T01:02:18Z")

</div>

Trans wrote:

> On Jul 2, 5:14pm, Greg W. wrote:
> 
> > I have a project where a number of internally-developed Ruby libraries  
> > will need to be installed on numerous machines. Small apps will then be  
> > written using this set of libraries almost like a framework really.
> 
> Will these libraries all be in single project (ie. gem), or do your  
> see them each as separate projects?

The libraries form a single core of tools and logic upon which to build  
server side data aggregation apps.

> > Is it worth considering building a gem out of this library and running a  
> > private gem server in order to manage these libraries? The alternative  
> > would be to maintain working copies (maybe in site\_ruby?) from an svn  
> > server – much like you’d typically maintain a Rails app on servers.
> 
> your [you’re] using svn rather than git I take it.

svn, yes. If I changed my code with every new fasionable thing, I’d  
never get anything done. svn works just fine for me.

– gw

---

<div class="post-metadata">

**Author:** ![S-gw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ed655f/32.png) [@S-gw](https://www.ruby-forum.com/u/S-gw)\
**Post date:** [July 3, 2008, 7:17am UTC](https://www.ruby-forum.com/t/worthwhile-to-build-a-gem/142050/6 "2008-07-03T07:17:37Z")

</div>

On Thu, Jul 03, 2008 at 06:14:49AM +0900, Greg W. wrote:

> I have a project where a number of internally-developed Ruby libraries  
> will need to be installed on numerous machines. Small apps will then be  
> written using this set of libraries almost like a framework really.
> 
> Is it worth considering building a gem out of this library and running a  
> private gem server in order to manage these libraries? The alternative  
> would be to maintain working copies (maybe in site\_ruby?) from an svn  
> server – much like you’d typically maintain a Rails app on servers.

yes, it is always worthwhile to build a gem :-). Its good experience  
and something every ruby developer should know how to do. And if the  
code is useful outside your specific application it makes it easy to  
distribute to the rest of the world.

This is exactly what we do at my job. Currently we have 18 gems that  
define our private codebase. We maintain an internal gem server, and  
capistrano deployment scripts to manage the installation of the gems on  
the various machines depending on their role. Our infrastructure is a  
mixture of command line, rails and merb apps, and this approach is  
working pretty well for us.

enjoy,

-jeremy
