summaryrefslogtreecommitdiff
path: root/lib/bundler/plugin/api
diff options
context:
space:
mode:
authorAsutosh Palai <asupalai@gmail.com>2016-06-30 17:40:02 +0530
committerAsutosh Palai <asupalai@gmail.com>2016-07-03 09:41:58 +0530
commitc2154b0a44a71611c0aee9c4a6b8d6bd38973ecd (patch)
tree2ea826da357068dc3533fbc2709b701195b14b3b /lib/bundler/plugin/api
parentb9b2600fb900a342a7fff8dcdf9153909b7e983e (diff)
downloadbundler-c2154b0a44a71611c0aee9c4a6b8d6bd38973ecd.tar.gz
Added to api/source
Diffstat (limited to 'lib/bundler/plugin/api')
-rw-r--r--lib/bundler/plugin/api/source.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/bundler/plugin/api/source.rb b/lib/bundler/plugin/api/source.rb
index 4179f82498..78514563f7 100644
--- a/lib/bundler/plugin/api/source.rb
+++ b/lib/bundler/plugin/api/source.rb
@@ -84,6 +84,24 @@ module Bundler
raise MalformattedPlugin, "Source plugins need to override the install method."
end
+ # It builds extensions, generates bins and installs them for the spec
+ # provided.
+ #
+ # It depends on `spec.loaded_from` to get full_gem_path. The source
+ # plugins should set that.
+ #
+ # It should be called in `install` after the plugin is done placing the
+ # gem at correct install location.
+ #
+ # It also runs Gem hooks `post_install`, `post_build` and `post_install`
+ #
+ # Note: Do not override if you don't know what you are doing.
+ def post_install(spec, disable_exts = false)
+ opts = { :env_shebang => false, :disable_extensions => disable_exts }
+ installer = Bundler::Source::Path::Installer.new(spec, opts)
+ installer.post_install
+ end
+
# A default installation path to install a single gem. If the source
# servers multiple gems, it's not of much use and the source should one
# of its own.