Class: Emissary::Agent::Gem

Inherits:
Emissary::Agent show all
Defined in:
lib/emissary/agent/gem.rb

Instance Attribute Summary

Attributes inherited from Emissary::Agent

#args, #config, #message, #method, #name, #operator

Instance Method Summary collapse

Methods inherited from Emissary::Agent

#activate, #initialize, #post_init, #send

Constructor Details

This class inherits a constructor from Emissary::Agent

Instance Method Details

#install(gem_name, version = :latest, source_url = :default) ⇒ Object

Updates Emissary from the given source to the given version



28
29
30
# File 'lib/emissary/agent/gem.rb', line 28

def install gem_name, version = :latest, source_url = :default
  ::Emissary::GemHelper.new(gem_name).install(version, source_url)
end

#uninstall(gem_name, version = :latest, ignore_dependencies = true, remove_executables = false) ⇒ Object Also known as: remove



36
37
38
# File 'lib/emissary/agent/gem.rb', line 36

def uninstall gem_name, version = :latest, ignore_dependencies = true, remove_executables = false
  ::Emissary::GemHelper.new(gem_name).uninstall(version, ignore_dependencies, remove_executables)
end

#update(gem_name, version = :latest, source_url = :default) ⇒ Object



32
33
34
# File 'lib/emissary/agent/gem.rb', line 32

def update gem_name, version = :latest, source_url = :default
  ::Emissary::GemHelper.new(gem_name).update(version, source_url)
end

#valid_methodsObject



19
20
21
# File 'lib/emissary/agent/gem.rb', line 19

def valid_methods
  [ :update, :install, :remove, :uninstall, :version ]
end

#version(gem_name) ⇒ Object



23
24
25
# File 'lib/emissary/agent/gem.rb', line 23

def version gem_name
  ::Emissary.GemHelper.new(gem_name).version
end