{"action":"created","issue":{"url":"https://api.github.com/repos/bundler/bundler/issues/3463","labels_url":"https://api.github.com/repos/bundler/bundler/issues/3463/labels{/name}","comments_url":"https://api.github.com/repos/bundler/bundler/issues/3463/comments","events_url":"https://api.github.com/repos/bundler/bundler/issues/3463/events","html_url":"https://github.com/bundler/bundler/issues/3463","id":60275383,"number":3463,"title":"Bundler Plugin System","user":{"login":"maclover7","id":3020626,"avatar_url":"https://avatars.githubusercontent.com/u/3020626?v=3","gravatar_id":"","url":"https://api.github.com/users/maclover7","html_url":"https://github.com/maclover7","followers_url":"https://api.github.com/users/maclover7/followers","following_url":"https://api.github.com/users/maclover7/following{/other_user}","gists_url":"https://api.github.com/users/maclover7/gists{/gist_id}","starred_url":"https://api.github.com/users/maclover7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maclover7/subscriptions","organizations_url":"https://api.github.com/users/maclover7/orgs","repos_url":"https://api.github.com/users/maclover7/repos","events_url":"https://api.github.com/users/maclover7/events{/privacy}","received_events_url":"https://api.github.com/users/maclover7/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-03-08T20:48:21Z","updated_at":"2015-03-11T09:17:07Z","closed_at":null,"body":"This was discussed in [bundler/bundler-features#8](https://github.com/bundler/bundler-features#8) and also in #1945. I am suggesting that we go with a combination of what Heroku and Vagrant have done for their plugin ecosystem.\r\n\r\n# Part 1: Installation/Storage/Activation\r\n- [ ] Plugins are packaged as gems following the convention: bundler-[plugin name]\r\n\r\n# Part 2: Usage\r\n- [ ] Plugins can run executables\r\n  - [ ] Provide an API/base class for CLI plugins to inherit from\r\n- [ ] Plugins can do things/run tasks after Bundler does something\r\n  - [ ] [Provide some sort of hook system/notifier/thing for plugins to latch onto](https://trello.com/c/LJUJNMGN/73-add-lifecycle-hooks)\r\n\r\n# Part 3: Decisions\r\n## - [ ] Declaring plugins\r\n\r\nIn the Gemfile there are a few options about how one could say \"I want to use the gem 'bundler-svn'\"\r\n~~- Option 1:~~\r\n```shell\r\ngem \"bundler-svn\"\r\n```\r\n~~Pro: Super easy syntax. Makes sense.~~\r\n~~Con: Not really any cons.~~\r\n\r\n~~- Option 2:~~\r\n```shell\r\ngroup :plugins do\r\n  gem \"bundler-svn\"\r\nend\r\n```\r\n~~Pro: Easier to parse than trying to ask each gem: \"Do you have the prefix 'bundler-'\"~~\r\n~~Pro: Easier to see what plugins you have, they are all next to each other.~~\r\n~~Con: Maybe some people don't want a separate group for plugins?~~\r\n\r\n- Option 3:\r\n```shell\r\nplugin \"svn\"\r\n```\r\nPro: Even easier syntax than option 1.\r\nCon: Requires some special wiring through Bundler to support.\r\nCon: Either way the 'bundler-' gem prefix will be applied, makes no difference.\r\n\r\n## - [ ] Plugins at the User or Project levels\r\nSome plugins may need to be loaded at the user level. For example, someone may want to install a svn plugin, and be able to use svn on all projects. I think we need to be consistent across all 3 plugin subtypes about this policy - subcommands, hooks, and source hooks (svn, hg)\r\n\r\n- Option 1: Have all plugins be available at the user level\r\n\r\n- Option 2: Have all plugins be available at the project level. This will require everything to be included in the Gemfile manifest.\r\n\r\n## - [ ] Plugin Dependencies\r\n\r\n- If your plugin had any dependencies, you must vendor them within the gem. Documentation will be coming out explaining how to do this."},"comment":{"url":"https://api.github.com/repos/bundler/bundler/issues/comments/78228474","html_url":"https://github.com/bundler/bundler/issues/3463#issuecomment-78228474","issue_url":"https://api.github.com/repos/bundler/bundler/issues/3463","id":78228474,"user":{"login":"andremedeiros","id":9689,"avatar_url":"https://avatars.githubusercontent.com/u/9689?v=3","gravatar_id":"","url":"https://api.github.com/users/andremedeiros","html_url":"https://github.com/andremedeiros","followers_url":"https://api.github.com/users/andremedeiros/followers","following_url":"https://api.github.com/users/andremedeiros/following{/other_user}","gists_url":"https://api.github.com/users/andremedeiros/gists{/gist_id}","starred_url":"https://api.github.com/users/andremedeiros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andremedeiros/subscriptions","organizations_url":"https://api.github.com/users/andremedeiros/orgs","repos_url":"https://api.github.com/users/andremedeiros/repos","events_url":"https://api.github.com/users/andremedeiros/events{/privacy}","received_events_url":"https://api.github.com/users/andremedeiros/received_events","type":"User","site_admin":false},"created_at":"2015-03-11T09:17:07Z","updated_at":"2015-03-11T09:17:07Z","body":"As for what level plugins are installed, we need both, which is why discoverability is paramount.\r\n\r\nFor instance, `bundle gem` should really be a plugin, and that's never going to be a project plugin. That's the plugin that creates them."}}