summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndre Medeiros <me@andremedeiros.info>2014-05-12 14:14:46 +0100
committerAndre Medeiros <me@andremedeiros.info>2014-05-12 14:14:46 +0100
commitacec7fd69d1c88d3867b77759e28bad7989870a8 (patch)
tree1feb952f9c544fd05b2ba51b69f5f17f2f50b7a2 /lib
parentaac716213549c5c35609de3d7f3a81bba407c59f (diff)
downloadbundler-plugin-system.tar.gz
Implemented a very basic plugin system.plugin-system
The way this works is pretty much the same way as `git` commands work. When invoking `bundler <task>`, if the task isn't defined on Bundler::CLI, Bundler will try and figure out if there is a `bundler-<task>` binary present on the path. If so, it's invoked. Same error message (and error codes) apply when a binary isn't found. Also, this is just a first, simple pass at the problem. @indirect and I had a chat about how it should work, and we should probably think about offering the possibility of loading up Ruby plugins in the already loaded Bundler environment.
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler/cli.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb
index bae7f54641..e9c47b6db1 100644
--- a/lib/bundler/cli.rb
+++ b/lib/bundler/cli.rb
@@ -67,6 +67,12 @@ module Bundler
end
end
+ def self.handle_no_command_error(command, has_namespace = $thor_runner)
+ return super unless command_path = Bundler.which("bundler-#{command}")
+
+ Kernel.exec(command_path, *ARGV[1..-1])
+ end
+
desc "init [OPTIONS]", "Generates a Gemfile into the current working directory"
long_desc <<-D
Init generates a default Gemfile in the current working directory. When adding a