Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin bundles #102

Merged
merged 3 commits into from
Sep 23, 2011
Merged

Plugin bundles #102

merged 3 commits into from
Sep 23, 2011

Conversation

sstephenson
Copy link
Contributor

The purpose of this branch is to provide a way to install self-contained plugin bundles into the $RBENV_ROOT/plugins directory without any additional configuration. These plugin bundles make use of existing conventions for providing rbenv commands and hooking into core commands.

(Note that this branch renames the recently-added $RBENV_PLUGIN_PATH environment variable to $RBENV_HOOK_PATH, and rbenv plugin-scripts to rbenv hooks. The rbenv.d directories are now referred to as hook directories, not plugin directories.)

Say you have a plugin named foo. It provides an rbenv foo command and hooks into the rbenv exec and rbenv which core commands. Its plugin bundle directory structure would be as follows:

foo/
  bin/
    rbenv-foo
  etc/
    rbenv.d/
      exec/
        foo.bash
      which/
        foo.bash

When the plugin bundle directory is installed into ~/.rbenv/plugins, the rbenv command will automatically add ~/.rbenv/plugins/foo/bin to $PATH and ~/.rbenv/plugins/foo/etc/rbenv.d/exec:~/.rbenv/plugins/foo/etc/rbenv.d/which to $RBENV_HOOK_PATH.

The structure is designed so that plugins may also be installed via traditional means. For example, a Homebrew package of the plugin could simply merge the bin and etc directories into /usr/local.

Inspired by #99.

@josh
Copy link
Contributor

josh commented Sep 23, 2011

👍 👍

@sstephenson
Copy link
Contributor Author

Soliciting feedback from @scoz (#99), @jamis (rbenv-gemset), @carsomyr (rbenv-bundler).

@scoz
Copy link

scoz commented Sep 23, 2011

Looks good, covers all the needs I had.

@jamis
Copy link
Contributor

jamis commented Sep 23, 2011

I like. This cleans up the whole "rbenv gemset install" noise. Good insight on this one!

@carsomyr
Copy link
Contributor

Looking forward to trying it out! I've only used a subset of the features described above.

@sstephenson
Copy link
Contributor Author

Sounds like a consensus then :)

sstephenson added a commit that referenced this pull request Sep 23, 2011
@sstephenson sstephenson merged commit a3deeba into master Sep 23, 2011
@carsomyr
Copy link
Contributor

I restructured rbenv-bundler to use the new plugin conventions, and it works great! Do you think it would be appropriate to add a gitignore file to the plugins directory just to get it to exist? The ignore pattern would be /*.

@sstephenson
Copy link
Contributor Author

I don't think we should have an empty plugins directory in the repo itself, but we should add /plugins to the root .gitignore file. (Reason being I'd like to start moving away from the current installation instructions which suggest symlinking your rbenv checkout to ~/.rbenv.)

@scoz
Copy link

scoz commented Sep 24, 2011

Are you planning on suggesting a root or system-wide installation?

cehoffman pushed a commit to cehoffman/rbenv that referenced this pull request Apr 8, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants