Class Juicer::Install::Base
In: lib/juicer/install/base.rb
Parent: Object

Installer skeleton. Provides basic functionality like figuring out where to install, create base directories, remove unneeded directories and more housekeeping.

Methods

bin_path   dependencies   dependency   download   install   installed?   latest   log   name   new   path   uninstall  

Attributes

install_dir  [R] 

Public Class methods

Public Instance methods

Returns the path to search for binaries from

Yields depencies one at a time: class and version and returns an array of arrays: [dependency, version] where dependency is an instance and version a string.

Add a dependency. Dependency should be a Juicer::Install::Base installer class (not instance) OR a symbol/string like :rhino/"rhino" (which will be expanded unto Juicer::Install::RhinoInstaller). Version is optional and defaults to latest and greatest.

Download a file to Juicer temporary directory. The file will be kept until purge is called to wipe it. If the installer receives a request to download the same file again, the disk cache will be used unless the force argument is true (default false)

Install the component. Creates basic directory structure.

Checks if the component is currently installed.

If no version is provided the most recent version is assumed.

Returns the latest available version number. Must be implemented in subclasses. Raises an exception when called directly.

Display a message to the user through Juicer::LOGGER

Returns name of component. Default implementation returns class name with "Installer" removed

Returns the path relative to installation path this installer will install to

Uninstalls the given version of the component.

If no version is provided the most recent version is assumed.

If there are no more files left in INSTALLATION_PATH/<path>, the whole directory is removed.

This method takes a block and can be used from subclasses like so:

  def self.uninstall(install_dir = nil, version = nil)
    super do |home_dir, version|
      # Custom uninstall logic
    end
  end

[Validate]