setup.rb and/or gem assist

H

Hal Fulton

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
 
J

Jim Weirich

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!
 
H

Hal Fulton

Jim said:
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
 
M

Mauricio Fernández

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/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 :)
 
C

Chad Fowler

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. :) Looking forward to making some big RubyGems progress as
a result of its first conference-year birthday.
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
 
E

Eivind Eklund

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.
 
V

vruz

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.
 
D

David A. Black

Hi --

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top