Class | AutomateIt::PackageManager |
In: |
lib/automateit/package_manager.rb
|
Parent: | AutomateIt::Plugin::Manager |
The PackageManager provides a way to manage packages, e.g., install, uninstall and query if the Apache package is installed with APT.
Examples:
package_manager.installed?("apache2") # => false package_manager.install("apache2") # => true package_manager.installed?("apache2") # => true package_manager.uninstall("apache2") # => true package_manager.not_installed("apache2") # => true
Commands can accept arrays:
package_manager.install("apache2", "bash") package_manager.installed? %w(apache2 bash)
Commands can also accept a single, annotated string as a manifest — useful for installing large numbers of packages at once:
package_manager.install <<HERE, :with => :apt # One per line apache bash # Or many on the same line sysvconfig sysv-rc-conf HERE
Commands can also accept a hash of names to paths — necessary for installing packages stored on the filesystem:
# Is the package called "TracTags" installed? If not, run the installer # with the "/tmp/tractags_latest" path as an argument: package.manager.install({"TracTags" => "/tmp/tractags_latest"}, :with => :egg)
Install these packages. Returns true if any packages are installed successfully; or false if all packages were already installed.
# File lib/automateit/package_manager.rb, line 60 def install(*packages) dispatch(*packages) end
Are these packages installed?
Options:
# File lib/automateit/package_manager.rb, line 49 def installed?(*packages) dispatch(*packages) end
Are these packages not installed?
Options:
# File lib/automateit/package_manager.rb, line 56 def not_installed?(*packages) dispatch(*packages) end