module Rabbit::GemManager

Public Instance Methods

install(gem_name) click to toggle source
# File lib/rabbit/gem_manager.rb, line 14
def install(gem_name)
  return success false if installed? gem_name
  command = Gem::Commands::InstallCommand.new
  command.handle_options [gem_name, '-i', Gem::path.first]
  begin
    command.execute
  rescue Gem::SystemExitException => e
    if e.exit_code == 0
       return success true
    else
      return failure e.exit_code
    end
  end
end
installed?(gem_name) click to toggle source
# File lib/rabbit/gem_manager.rb, line 10
def installed?(gem_name)
  return Gem::Specification.find_all_by_name(gem_name).size > 0
end
uninstall(gem_name) click to toggle source
# File lib/rabbit/gem_manager.rb, line 33
def uninstall(gem_name)
  #TODO: implement!
end
update(gem_name) click to toggle source
# File lib/rabbit/gem_manager.rb, line 29
def update(gem_name)
  #TODO: implement!
end