Setup.rb and/or gem assist

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

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/wiki.pl?CreateAGemInTenMinutes

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 jim@weirichhouse.org 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)

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 :wink:

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/scat.rb/ruby/ruby-talk/110665
and http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-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 :slight_smile:

···

On Wed, Sep 29, 2004 at 01:17:27AM +0900, Hal Fulton wrote:

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

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/wiki.pl?CreateAGemInTenMinutes

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

> 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/scat.rb/ruby/ruby-talk/110665
and http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-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. :slight_smile: 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 :slight_smile:

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

···

On Wed, 29 Sep 2004 02:56:29 +0900, Mauricio Fernández <batsman.geo@yahoo.com> wrote:

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
dblack@wobblini.net

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.

···

On Wed, 29 Sep 2004 04:24:45 +0900, Chad Fowler <chadfowler@gmail.com> 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.

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

Hi --

> 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

···

On Sat, 2 Oct 2004, vruz wrote:

--
David A. Black
dblack@wobblini.net