Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > setup.rb and/or gem assist

Reply
Thread Tools

setup.rb and/or gem assist

 
 
Hal Fulton
Guest
Posts: n/a
 
      09-28-2004
Hello all...

I am rather package-phobic and usually just offer a .tgz and a readme.
But I'm thinking of doing a little more this time.

I have an app I want to package, and I want to create a gem.

I *believe* that setup.rb is still required, is it not??

Anyhow, I have never used setup.rb except to play with it, and I've
never created a gem.

Some of my constraints are:

1. I have libs that are require'd only by this app (i.e., they are
just separate pieces for convenience). Where should they go, and
how should I reference them in the app?
2. Same question for data files and such. Where to put them, how to
reference them?
3. Suppose I have a file of marshalled data and want to run a little
utility program to load it into a .db -- how/when should I do this?

Any assistance appreciated.


Thanks,
Hal




 
Reply With Quote
 
 
 
 
Jim Weirich
Guest
Posts: n/a
 
      09-28-2004

Hal Fulton said:
> Hello all...
>
> I am rather package-phobic and

[...]
> I have an app I want to package, and I want to create a gem.


There are two steps to creating a gem ...
1) Create a Gem Specification.
2) Run: gem builder gemspecfile.

The hard part is step one where you need to come up with all the metadata.
A good place to start is:

http://rubygems.rubyforge.org/wiki/w...emInTenMinutes

The page has a gem spec that you can start with an edit to your
satisfication.

Or wait till this weekend and we can help you in person!

--
-- Jim Weirich http://www.velocityreviews.com/forums/(E-Mail Removed) http://onestepback.org
-----------------------------------------------------------------
"Beware of bugs in the above code; I have only proved it correct,
not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)



 
Reply With Quote
 
 
 
 
Hal Fulton
Guest
Posts: n/a
 
      09-28-2004
Jim Weirich wrote:

> There are two steps to creating a gem ...
> 1) Create a Gem Specification.
> 2) Run: gem builder gemspecfile.


Reminds me of the old recipe for elephant stew. Or -- was it Carl Sagan
who said, "To make chicken soup from scratch, you must first create the
universe"?

> The hard part is step one where you need to come up with all the metadata.
> A good place to start is:
>
> http://rubygems.rubyforge.org/wiki/w...emInTenMinutes
>
> The page has a gem spec that you can start with an edit to your
> satisfication.


Yes, I did read that. My questions were all post-RTFM FWIW. One should
always RTFM ASAP IMHO.

> Or wait till this weekend and we can help you in person!


Now there's a thought.

Really it shouldn't take long. Maybe Thur evening?

At any rate, I want to make it available no later than my talk. Just in case
people want to look at it.


Thanks,
Hal





 
Reply With Quote
 
Mauricio Fernández
Guest
Posts: n/a
 
      09-28-2004
On Wed, Sep 29, 2004 at 01:17:27AM +0900, Hal Fulton wrote:
> Hello all...
>
> I am rather package-phobic and usually just offer a .tgz and a readme.
> But I'm thinking of doing a little more this time.


If you point me to your .tgz, RPA might repackage it for you

> I have an app I want to package, and I want to create a gem.
>
> I *believe* that setup.rb is still required, is it not??


RubyGems does not require setup.rb; it needs a "gemspec".

> Anyhow, I have never used setup.rb except to play with it, and I've
> never created a gem.
>
> Some of my constraints are:
>
> 1. I have libs that are require'd only by this app (i.e., they are
> just separate pieces for convenience). Where should they go, and
> how should I reference them in the app?


If they are packaged independently, you can indicate the dependencies.
You probably want to install them under a common namespace (myapp/).

> 2. Same question for data files and such. Where to put them, how to
> reference them?


There's a problem with RubyGems + datafiles;
see http://blade.nagaokaut.ac.jp/cgi-bin...by-talk/110665
and http://blade.nagaokaut.ac.jp/cgi-bin...by-talk/110679

Data files are normally found under
File.join(::Config::CONFIG["datadir"], "share")
but this won't work with RubyGems so you would have to modify your program.

> 3. Suppose I have a file of marshalled data and want to run a little
> utility program to load it into a .db -- how/when should I do this?


A mechanism to run post-installation scripts is being discussed in
RubyGems' ML. It seems unlikely to be implemented, though, since the
majority seems to be against it.

> Any assistance appreciated.


Just give me a link to the tgz

--
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com



 
Reply With Quote
 
Chad Fowler
Guest
Posts: n/a
 
      09-28-2004
On Wed, 29 Sep 2004 02:56:29 +0900, Mauricio Fernández
<(E-Mail Removed)> wrote:
> > 2. Same question for data files and such. Where to put them, how to
> > reference them?

>
> There's a problem with RubyGems + datafiles;


"problem" is an overstatement, butyou're generally right. It's
obviously possible, but it requires RubyGems-specific code. A
standard ruby library that is gems-aware, as you suggest would be a
way to abstract it. The second option seems like a recipe for
disaster.

> see http://blade.nagaokaut.ac.jp/cgi-bin...by-talk/110665
> and http://blade.nagaokaut.ac.jp/cgi-bin...by-talk/110679
>
> Data files are normally found under
> File.join(::Config::CONFIG["datadir"], "share")
> but this won't work with RubyGems so you would have to modify your program.
>
> > 3. Suppose I have a file of marshalled data and want to run a little
> > utility program to load it into a .db -- how/when should I do this?

>
> A mechanism to run post-installation scripts is being discussed in
> RubyGems' ML. It seems unlikely to be implemented, though, since the
> majority seems to be against it.
>


I'd say it _is_ likely, actually. RubyConf will be a great time for
us to discuss some of the ongoing questions and reach resolutions.

It's also a great time for attendees to contribute ideas, opinions,
CODE, etc. Looking forward to making some big RubyGems progress as
a result of its first conference-year birthday.

> > Any assistance appreciated.

>
> Just give me a link to the tgz
>


If not before the conference, catch me when you get there. We'll
package your app together.

There's also a chapter in the Pickaxe II that will help (available
online as a PDF preview).

Chad



 
Reply With Quote
 
David A. Black
Guest
Posts: n/a
 
      09-28-2004
Hi --

On Wed, 29 Sep 2004, Hal Fulton wrote:

> Jim Weirich wrote:
>
> > There are two steps to creating a gem ...
> > 1) Create a Gem Specification.
> > 2) Run: gem builder gemspecfile.

>
> Reminds me of the old recipe for elephant stew.


I wonder whether that's similar to the recipe for cubed moose. I
suspect it is.


David

--
David A. Black
(E-Mail Removed)



 
Reply With Quote
 
Eivind Eklund
Guest
Posts: n/a
 
      10-01-2004
On Wed, 29 Sep 2004 04:24:45 +0900, Chad Fowler <(E-Mail Removed)> wrote:
> I'd say it _is_ likely, actually. RubyConf will be a great time for
> us to discuss some of the ongoing questions and reach resolutions.


Will there be anybody at RubyConf that has experience with packaging
and/or full operating systems engineering? Neither Mauricio nor I
will be there.

If nobody else with large scale experience step up to be the "voice of
criticism and care", I think making decisions there is a bad idea.

Eivind.


 
Reply With Quote
 
vruz
Guest
Posts: n/a
 
      10-01-2004
> If nobody else with large scale experience step up to be the "voice of
> criticism and care", I think making decisions there is a bad idea.


Especially being Mr Matz absent from it this year...

Pushing standards for technical excellence is okay, it's great, it's
at the very core of the opensource philosophy.

Pushing standards for the sake of it ignoring experienced people,
ignoring relevant engineering processes: now that sucks, it's
anti-opensource.

Proprietary lock-in, land-grabbing, blocking out "competition", and
defining standards in closed rooms are practices that have NOTHING to
do with an opensource community.

This attempt doesn't have ANYTHING to do with the concept of meritocracy.

It's not only a bad idea, it's a SHAME.

The decision of what's a standard and what's not a standard in Ruby
has always been taken by Mr Yukihiro Matsumoto, and it should be kept
that way.

I recognise no other authority in the Rubysphere.

> Eivind.


--
--- vruz


 
Reply With Quote
 
David A. Black
Guest
Posts: n/a
 
      10-01-2004
Hi --

On Sat, 2 Oct 2004, vruz wrote:

> > If nobody else with large scale experience step up to be the "voice of
> > criticism and care", I think making decisions there is a bad idea.

>
> Especially being Mr Matz absent from it this year...
>
> Pushing standards for technical excellence is okay, it's great, it's
> at the very core of the opensource philosophy.
>
> Pushing standards for the sake of it ignoring experienced people,
> ignoring relevant engineering processes: now that sucks, it's
> anti-opensource.
>
> Proprietary lock-in, land-grabbing, blocking out "competition", and
> defining standards in closed rooms are practices that have NOTHING to
> do with an opensource community.


Open source does not mean that every person in the world is present at
every coding session. It means the code -- the result of the work of
a person or group of people -- is open, which is the case of
RubyGems.

> This attempt doesn't have ANYTHING to do with the concept of meritocracy.


I'm not sure it's supposed to. It's a project -- hopefully a good
project. If you're talking about its possible eventual role in the
Ruby distribution, that's obviously completely up to Matz.

> It's not only a bad idea, it's a SHAME.
>
> The decision of what's a standard and what's not a standard in Ruby
> has always been taken by Mr Yukihiro Matsumoto, and it should be kept
> that way.
>
> I recognise no other authority in the Rubysphere.


Neither does anyone else. This takes us into realms of speculation
and accusation that are not appropriate and have nothing to do with
the RubyGems project (or any other that I know of).


David

--
David A. Black
(E-Mail Removed)



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RubyGems 0.9.1 calling a gem with gem '<gem>' Austin 7873 Ruby 5 01-27-2007 10:05 PM
gem.cmd install RMagick-win32-1.9.2-mswin32.gem: Buffer error Clifford Heath Ruby 7 06-09-2006 07:02 PM
[GEM PATCH] allow gem to install bin file to different location Ara.T.Howard Ruby 0 10-26-2005 11:52 PM
ERROR: While executing gem ... (Gem::GemNotFoundException) Could not find rubygems-upodate (> 0) in the repository han Ruby 1 10-24-2005 10:28 PM
[ANN] Getopt-Declare 1.12 (gem/zip) and GGEnv (gem/zip) gga Ruby 0 07-18-2005 03:21 PM



Advertisments