From: Joel VanderWerf on
Intransition wrote:
> 1) Change "Executables SHOULD NOT require 'rubygems' or modify the
> $LOAD_PATH" to a "MUST NOT". There's no reason to do this in an
> executable.

Except for the _gem_ executable itself, or any other executable that
needs to operate on gems. SHOULD NOT was the right call.

From: Suraj Kurapati on
Hi,

I've only ever used RubyGems for packaging my projects, so I'm kind of
scared of setup.rb's style of separating my project's directories (i.e.
lib/ is no longer next to bin/ and so on). In particular, I am confused
about the following:

I want to run the man executable (pointing it to my project's man/
directory) from my project's executable in bin/. With RubyGems, I can
rely on bin/ being next to man/. But with setup.rb I don't know how to
find my project's man/ directory from my project's executable in bin/!

Any suggestions?

Also, if I provide a man/ directory in my gem/tarball package like this:

man/
└── man1
├── ember.1
└── ember.1.html

1 directory, 2 files

Will it be copied into /usr/share/man/ by RubyGems/setup.rb/Rip and
friends?

Thanks for your consideration.
--
Posted via http://www.ruby-forum.com/.

From: James Britt on
Intransition wrote:
> Final comments for now, I promise ;-)
>
> 1) Change "Executables SHOULD NOT require 'rubygems' or modify the
> $LOAD_PATH" to a "MUST NOT". There's no reason to do this in an
> executable.

I have a JRuby desktop app that clears out and then sets up $: The
reason is that I need to know that it is not loading anything other than
what is bundled up with the application.

If there is a way to restrict the load path without altering $: I'd be
interested to know what it is.


--
James Britt

www.jamesbritt.com - Playing with Better Toys
www.ruby-doc.org - Ruby Help & Documentation
www.rubystuff.com - The Ruby Store for Ruby Stuff
www.neurogami.com - Smart application development

From: Luis Lavena on
On Apr 20, 4:27 am, Christian Neukirchen <chneukirc...(a)gmail.com>
wrote:
> Hello,
>
> earlier this month I wrote up a draft for a specification on how to
> structure Ruby projects.  It started athttp://gist.github.com/361451
> and there was lots of discussion there, which I now want to move to
> ruby-talk to gain a larger audience.
>
> The specification now resides at
>
>                  http://chneukirchen.github.com/rps/
>
> and is generated fromhttp://github.com/chneukirchen/rps.
>
> Please keep discussion on RPS to this thread, so people which usually
> don't follow ruby-talk can discuss too.
>

My comments:

"Extensions" Section:

1) "Extensions SHOULD reside in ext/"

There are project that include more than one extension, I've
encouraged project follow the setup.rb folder structure, exemplified
here:

http://github.com/luislavena/rake-compiler

(under structure)

2) "Extensions SHOULD be buildable with ruby extconf.rb; make."

That is not true, there are extension that even using extconf they
generate Rakefiles, because they depend on mkrf and not mkmf

That can't be enforced on these developers, if done a lot of project
could break.

3) "Extensions SHOULD be installed into an architecture-specific
directory."

RubyGems doesn't do that, it just relocate binaries from ext directory
to lib, adding the platform directory will make impossible for pre-
built binary gems that bundle 1.8 and 1.9 extension.

It also means that RubyGems will need to add RUBY_PLATFORM (or
RbConfig::CONFIG['host_os']) of each gem into $LOAD_PATH.

This has been requested in the past in RubyGems:

http://rubyforge.org/tracker/index.php?func=detail&aid=14943&group_id=126&atid=575

Installations not using RubyGems will need to adapt their libraries to
try loading from RUBY_PLATFORM directory and under failure try from
other options?

If no RubyGems and no developers implementing those tricks, means Ruby
will need to be modified to handle that.

Setup.rb already handles that putting binaries *outside* the package
and inside site_ruby for each RUBY_PLATFORM

3) Files ending with .exe

AFAIK: "Exe"cutables, not extensions or libraries

My two cents

--
Luis Lavena
From: Intransition on


On Apr 20, 1:12 pm, Suraj Kurapati <sun...(a)gmail.com> wrote:
> Hi,
>
> I've only ever used RubyGems for packaging my projects, so I'm kind of
> scared of setup.rb's style of separating my project's directories (i.e.
> lib/ is no longer next to bin/ and so on).  In particular, I am confused
> about the following:
>
> I want to run the man executable (pointing it to my project's man/
> directory) from my project's executable in bin/.  With RubyGems, I can
> rely on bin/ being next to man/.  But with setup.rb I don't know how to
> find my project's man/ directory from my project's executable in bin/!
>
> Any suggestions?

The standard approach would be something like:

require 'rbconfig'
dir = Config::CONFIG['datadir']
file = File.join(dir, 'man/man1/ember.1')

B/c of RubyGems there is an extension method that redirects to the the
appropriate place.

Config.datadir("ember")

But I think it might be a problem to tell which is which for locating
the man/ directory.

> Also, if I provide a man/ directory in my gem/tarball package like this:
>
> man/
> └── man1
>     ├── ember.1
>     └── ember.1.html

Can man handle .html? I glanced at the entries in my system and I
noticed they are all gzipped (ending in .gz).

> Will it be copied into /usr/share/man/ by RubyGems/setup.rb/Rip and
> friends?

Setup.rb does. RubyGems does not. Not sure about Rip.