Gem ideas

J

John Joyce

I have a few ideas I'd like to see the Gem tool. Please correct me if
they don't already exist!
options, like the gem path variable, but to display, say 10 at a time
with gem list (or an arbitrary number, or even a regex-ish thing...)
Something similar to ri or other command line tools that allow for
pagination.
Nothing is more obnoxious than having to scroll back up a long list
of gems.

Next dumb idea of mine:
Aliases.
Aliasing a gem name or a group of gems.
With the ability to essentially create your own grouping of gems.
So, say I want to create 'railsgems' as a group alias for all the
gems I use with Rails...
something like this:
gem alias -g ActiveRecord RMagick ActionPack

so gem alias wold allow creation of an alias, to prevent the need to
always type a long version number (yes I'm lazy)
but also have a -g or --g flag for group aliasing, followed by
argument list of gem names.

With indexing, there could easily be automatic aliases for first
character.
so
gem list a
would not have to search the gems, just quickly list all of the a*
named gems
gem list r would list all the r* gems without searching every time.

But one step further, let's also make requiring gems, particularly
groups of gems easier.
require 'rubygems'
require 'my_gem_group'

Or even:
require 'rubygems:my_gem_group'

or something like that!

Granted, gem aliases might make dependencies and deployment more
fragile in a sense, but no more than other required libraries in
software. So, there is one last idea to go with this group alias
require approach...
Auto generate (with optional on or off flag or gem env variable) RDOC
that names the alias contents.

I suppose internally gem aliases should essentially need to be either
a simple alias_name_here.rb file generated that requires all the gems
included in the alias.
This step might make (re)distribution a little easier.

Perhaps an additional Rake task included to add gems in the requires
or alias requires when those gems are not already on a system.
 
E

Eric Hodel

I have a few ideas I'd like to see the Gem tool. Please correct me
if they don't already exist!
options, like the gem path variable, but to display, say 10 at a
time with gem list (or an arbitrary number, or even a regex-ish
thing...)
Something similar to ri or other command line tools that allow for
pagination.
Nothing is more obnoxious than having to scroll back up a long list
of gems.
/usr/bin/more

Next dumb idea of mine:
Aliases.
Aliasing a gem name or a group of gems.
With the ability to essentially create your own grouping of gems.
So, say I want to create 'railsgems' as a group alias for all the
gems I use with Rails...
something like this:
gem alias -g ActiveRecord RMagick ActionPack

Create a new gem with the gems you want as dependencies.
so gem alias wold allow creation of an alias, to prevent the need
to always type a long version number (yes I'm lazy)
but also have a -g or --g flag for group aliasing, followed by
argument list of gem names.

If I'm typing version numbers, I'm doing something like uninstalling
and I want to make sure I get it right. The inconvenience presented
by the extra typing helps me focus.
With indexing, there could easily be automatic aliases for first
character.
so
gem list a
would not have to search the gems, just quickly list all of the a*
named gems
gem list r would list all the r* gems without searching every time.

gem help list

gem help search
But one step further, let's also make requiring gems, particularly
groups of gems easier.
require 'rubygems'
require 'my_gem_group'

Or even:
require 'rubygems:my_gem_group'

or something like that!

autorequire was removed on purpose. You'll have to require the files
you want by hand.
Granted, gem aliases might make dependencies and deployment more
fragile in a sense, but no more than other required libraries in
software.

More fragile is never good. I'd rather have a RubyGems that is
reliable, dependable and predictable.
Auto generate (with optional on or off flag or gem env variable)
RDOC that names the alias contents.

I suppose internally gem aliases should essentially need to be
either a simple alias_name_here.rb file generated that requires all
the gems included in the alias.

You can't require a gem, you can only activate it. You can require
files in a gem, but there is no automatic way to determine what files
are appropriate (other than requiring all of them). If there is a
common set of files, it is up to the author to provide a method of
loading all of them.
This step might make (re)distribution a little easier.

This sentence is nearly opposite of the "more fragile" one. How can
it be both more fragile and easier to redistribute?

Why do you need to redistribute? spec.add_dependency takes care of
that for you.

You have to gather the dependencies and repackage them anyways if
you're moving to a different packaging system, so I can't see how
this would decrease the amount of work you have to do.
Perhaps an additional Rake task included to add gems in the
requires or alias requires when those gems are not already on a
system.

If you have your own gem listing your dependencies, `gem install`
takes care of it for you.
 
E

Eric Hodel

more or less <G>

$ ll /usr/bin/more /usr/bin/less
-rwxr-xr-x 2 root wheel 118508 Mar 20 2005 /usr/bin/less*
-rwxr-xr-x 2 root wheel 118508 Mar 20 2005 /usr/bin/more*

less is more

(you can shoot me now)
 
K

Konrad Meyer

--nextPart1437579.SeR4ynbdAa
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Quoth Eric Hodel:
=20
$ ll /usr/bin/more /usr/bin/less
-rwxr-xr-x 2 root wheel 118508 Mar 20 2005 /usr/bin/less*
-rwxr-xr-x 2 root wheel 118508 Mar 20 2005 /usr/bin/more*
=20
less is more
=20
(you can shoot me now)
=20

Or is it?

$ ls -l /usr/bin/less /bin/more /usr/bin/more
ls: cannot access /usr/bin/more: No such file or directory
=2Drwxr-xr-x 1 root root 32176 2007-08-08 08:05 /bin/more*
=2Drwxr-xr-x 1 root root 129984 2007-02-20 01:04 /usr/bin/less*

Regards,
=2D-=20
Konrad Meyer <[email protected]> http://konrad.sobertillnoon.com/

--nextPart1437579.SeR4ynbdAa
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)

iD8DBQBHBwkqCHB0oCiR2cwRAj0CAJ9jq5+NX6VCE3TjF64xUUIGieGH/wCgqtvu
nbBGUjIC8m0ucfltNgIFTeU=
=txob
-----END PGP SIGNATURE-----

--nextPart1437579.SeR4ynbdAa--
 

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

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top