[Rubygems-developers] local, remote, and....

Gavin Sinclair gsinclair at soyabean.com.au
Tue Oct 5 10:40:20 EDT 2004

On Tuesday, October 5, 2004, 9:35:19 PM, Hugh wrote:

>> Hi Hugh!
>> Could you give us some specific usage examples?  I'm having trouble picturing
>> what you mean, so a little more detail might help.
>> I'm probably just being dense though :)

> Well, this is a bit sketchy, because it would probably mean changing
> the interface to disambiguate --local from --user, but something
> like this:

> I have FXRuby installed.  I See 1.2.2 is out, but don't want to
> disturb others' usage till I've tried it.

> gem install -r FXRuby -u
>   <mumble>smething about installing FXRuby 1.2.2 in
>   /home/hgs/rubygems/fxruby...</mumble>

> gem query -u FXRuby
>     Well, you've got FXRuby-1.2.2 in your home gems directory

> gem query -l FXRuby
>     You've got FXRuby-1.2.1 in your system gems directory

> gem -query -r FXRuby
>     1.2.2 is the latest actually.

> Is that any help about what I mean, or not?

I think this is a more sensible interface:

  gem list --local fxruby                             # (1)

      fxruby (1.2.1)

  gem install --remote --user FXRuby                  # (2)

  gem list --local                                    # (3)

      extensions (0.4.0)

      fxruby (1.2.2[u], 1.2.1)

  gem list --user                                     # (4)

      fxruby (1.2.2)

  gem list --system                                   # (5)

      extentsions (0.4.0)

      fxruby (1.2.1)


 2. --remote is the *source* of the install; --user is the *target* of

 3. list --local lists *all* local gems, be they system or user.  User
    gems are marked with [u].

 4. list --user implies "not remote".

 5. --system is the opposite of --user.  It also implies "not remote".

So we have the following permutations:

  gem install rake --system                   # default
  gem install rake --user

  gem list rake --local                       # default; system + user
  gem list rake --user
  gem list rake --system
  gem list rake --remote                      # also search/query

  gem uninstall rake --user
  gem uninstall rake --system
  gem uninstall rake                          # offers system and/or
                                              # user gems to uninstall
                                              # based on permissions

Other commands are not as interesting.  The common thread is this:
--user and --system are just specific sources of gems.  If you don't
select one, all sources of gems are considered for the operation.

So, for example:

  gem rdoc rake               # RDocs all rake gems
  gem rdoc rake --system      # RDocs system rake gems
  gem rdoc rake --user        # RDocs user rake gems

Other commands would be analogous.

I'm pretty keen on this.  What do others think?  What do you think of
this interface, Hugh?


More information about the Rubygems-developers mailing list