# Gem or plugin?

**URL:** <https://www.ruby-forum.com/t/gem-or-plugin/176358>\
**Category:** Rails\
**Created:** [September 29, 2009, 3:19pm UTC](https://www.ruby-forum.com/t/gem-or-plugin/176358 "2009-09-29T15:19:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![elliottg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/b77776/32.png) [@elliottg](https://www.ruby-forum.com/u/elliottg)\
**Post date:** [September 29, 2009, 3:19pm UTC](https://www.ruby-forum.com/t/gem-or-plugin/176358/1 "2009-09-29T15:19:15Z")

</div>

I have never packaged any code for a Rails app before. I have read a  
fair amount about differences between Gems and Rails plugins, but I  
was wanting to get some other opinions.

I have a small cms I have built. As far as what I need to package…  
it’s basically just a few generators. Here’s a few details.

- The app is rails dependent.
- At least for a while, it will not be open source but hopefully will  
be at some point.

So what would you guys do. Gem or plugin?

Thanks, Elliott

---

<div class="post-metadata">

**Author:** ![elliottg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/b77776/32.png) [@elliottg](https://www.ruby-forum.com/u/elliottg)\
**Post date:** [September 29, 2009, 3:36pm UTC](https://www.ruby-forum.com/t/gem-or-plugin/176358/2 "2009-09-29T15:36:18Z")

</div>

Elliott G. wrote:

> I have never packaged any code for a Rails app before. I have read a  
> fair amount about differences between Gems and Rails plugins, but I  
> was wanting to get some other opinions.
> 
> I have a small cms I have built. As far as what I need to package…  
> it’s basically just a few generators. Here’s a few details.
> 
> - The app is rails dependent.
> - At least for a while, it will not be open source but hopefully will  
> be at some point.

How do you propose to distribute a gem or plugin without exposing the  
source?

> So what would you guys do. Gem or plugin?

Probably neither. It sounds like a standalone Rails app, so just do it  
that way.

> Thanks, Elliott

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![elliottg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/b77776/32.png) [@elliottg](https://www.ruby-forum.com/u/elliottg)\
**Post date:** [September 29, 2009, 4:01pm UTC](https://www.ruby-forum.com/t/gem-or-plugin/176358/3 "2009-09-29T16:01:59Z")

</div>

On Tue, Sep 29, 2009 at 3:36 PM, Marnen Laibow-Koser  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > - At least for a while, it will not be open source but hopefully will  
> > be at some point.
> 
> How do you propose to distribute a gem or plugin without exposing the  
> source?

If you don’t wanna expose the source and you need to distribute the  
app, you should look for some “encryptor” if there is such a thing.  
Ruby is an interpreted language, at least 1.8.x. Either you decide to  
distribute the application as a plugin or a gem, you will need to  
distribute the source since those are the files that get executed.

–  
Leonardo M…  
There’s no place like ~

---

<div class="post-metadata">

**Author:** ![elliottg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/b77776/32.png) [@elliottg](https://www.ruby-forum.com/u/elliottg)\
**Post date:** [September 29, 2009, 6:09pm UTC](https://www.ruby-forum.com/t/gem-or-plugin/176358/4 "2009-09-29T18:09:04Z")

</div>

It may have been a bit misleading to mention open source. By it not  
being open source, I meant that the remote repo where the package will  
live will be private. I may open it up to the public at some point.  
The only reason I mentioned that, is because I thought that info may  
help make the decision to make a Gem or plugin better informed.

Basically, I just want to package my code so I can easily include it  
in my custom Rails templates when building out a new cms powered app.  
The basic question is do you guys prefer to package code as a Gem or  
plugin these days? I hear a lot about Gems being preferred, but just  
curious what your thoughts are.

Thanks heaps, EG

On Sep 29, 10:17 am, Rob B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![elliottg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/b77776/32.png) [@elliottg](https://www.ruby-forum.com/u/elliottg)\
**Post date:** [September 29, 2009, 4:19pm UTC](https://www.ruby-forum.com/t/gem-or-plugin/176358/5 "2009-09-29T16:19:33Z")

</div>

On Sep 29, 2009, at 10:00 AM, Leonardo M. wrote:

> > > - The app is rails dependent.  
> > > distribute the application as a plugin or a gem, you will need to  
> > > distribute the source since those are the files that get executed.
> 
> –  
> Leonardo M…  
> There’s no place like ~

It sounds like you want your little cms to be a plugin. In any case  
you want to “install” it for a given Rails application, so dropping  
something into …/vendor/plugins/… gives you a place to put  
initializers, rake tasks, your templates, etc.

As for the “not be open source”, you just need good license agreements  
with your clients. Don’t worry about encrypting the code. Just don’t  
post it anywhere public. If you’re going to be “marketing” your cms as  
part of a hosted service (as opposed to a product), then the packaging  
choice might not even matter.

-Rob

Rob B. [http://agileconsultingllc.com](http://agileconsultingllc.com)  
removed\_email\_address@domain.invalid
