Packaging common code with gems

Discussion in 'Ruby' started by R.. Kumar, Jun 6, 2010.

  1. R.. Kumar

    R.. Kumar Guest

    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.
    --
    Posted via http://www.ruby-forum.com/.
     
    R.. Kumar, Jun 6, 2010
    #1
    1. Advertising

  2. R.. Kumar

    Intransition Guest

    On Jun 6, 4:45=A0am, "R.. Kumar" <> wrote:
    > 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.




    > thx.
    > --
    > Posted viahttp://www.ruby-forum.com/.
     
    Intransition, Jun 6, 2010
    #2
    1. Advertising

  3. R.. Kumar

    R.. Kumar Guest

    Thomas Sawyer wrote:
    > On Jun 6, 4:45�am, "R.. Kumar" <> wrote:
    >> 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.


    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 ?
    --
    Posted via http://www.ruby-forum.com/.
     
    R.. Kumar, Jun 6, 2010
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tomás

    Gems -- #include <gems.hpp>

    Tomás, Mar 4, 2006, in forum: C++
    Replies:
    7
    Views:
    428
    Tomás
    Mar 5, 2006
  2. Lloyd Zusman
    Replies:
    3
    Views:
    186
    Lloyd Zusman
    Jun 21, 2005
  3. Dany Cayouette

    'private' gems/gems hierarchy

    Dany Cayouette, Nov 25, 2005, in forum: Ruby
    Replies:
    3
    Views:
    160
    Jim Weirich
    Nov 25, 2005
  4. Thaddeus L Olczyk

    Problem getting gems/listing gems. EINVAL

    Thaddeus L Olczyk, Aug 15, 2006, in forum: Ruby
    Replies:
    0
    Views:
    193
    Thaddeus L Olczyk
    Aug 15, 2006
  5. Tony Arcieri
    Replies:
    8
    Views:
    120
    Roger Pack
    Nov 30, 2009
Loading...

Share This Page