class Bundler::Plugin::API

def self.command(command, cls = self)

Parameters:
  • (optional) (Class) -- class that handles the command. If not
  • command (String) -- being handled by them
def self.command(command, cls = self)
  Plugin.add_command command, cls
end

def self.hook(event, &block)

def self.hook(event, &block)
  Plugin.add_hook(event, &block)
end

def self.source(source, cls = self)

Parameters:
  • (optional) (Class) -- class that handles the source. If not
  • the (String) -- source type they provide
def self.source(source, cls = self)
  cls.send :include, Bundler::Plugin::API::Source
  Plugin.add_source source, cls
end

def cache_dir

Returns:
  • (Pathname) - path of the cache dir
def cache_dir
  Plugin.cache.join("plugins")
end

def method_missing(name, *args, &blk)

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

def respond_to_missing?(name, include_private = false)

def respond_to_missing?(name, include_private = false)
  SharedHelpers.respond_to?(name, include_private) ||
    Bundler.respond_to?(name, include_private) || super
end

def tmp(*names)

Returns:
  • (Pathname) - object for the new directory created
def tmp(*names)
  Bundler.tmp(["plugin", *names].join("-"))
end