The plugins should declare that they handle a command through this helper.
@param [String] command being handled by them @param [Class] (optional) class that handles the command. If not
provided, the `self` class will be used.
# File bundler/plugin/api.rb, line 32
def self.command(command, cls = self)
Plugin.add_command command, cls
end
# File bundler/plugin/api.rb, line 47
def self.hook(event, &block)
Plugin.add_hook(event, &block)
end
The plugins should declare that they provide a installation source through this helper.
@param [String] the source type they provide @param [Class] (optional) class that handles the source. If not
provided, the `self` class will be used.
# File bundler/plugin/api.rb, line 42
def self.source(source, cls = self)
cls.send :include, Bundler::Plugin::API::Source
Plugin.add_source source, cls
end
The cache dir to be used by the plugins for storage
@return [Pathname] path of the cache dir
# File bundler/plugin/api.rb, line 54
def cache_dir
Plugin.cache.join("plugins")
end
# File bundler/plugin/api.rb, line 66
def method_missing(name, *args, &blk)
return Bundler.send(name, *args, &blk) if Bundler.respond_to?(name)
return SharedHelpers.send(name, *args, &blk) if SharedHelpers.respond_to?(name)
super
end