Module: Rabbit::GemManager
Instance Method Summary collapse
- #install(gem_name) ⇒ Object
- #installed?(gem_name) ⇒ Boolean
- #uninstall(gem_name) ⇒ Object
- #update(gem_name) ⇒ Object
Instance Method Details
#install(gem_name) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# 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. [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) ⇒ Boolean
10 11 12 |
# 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) ⇒ Object
33 34 35 |
# File 'lib/rabbit/gem_manager.rb', line 33 def uninstall(gem_name) #TODO: implement! end |
#update(gem_name) ⇒ Object
29 30 31 |
# File 'lib/rabbit/gem_manager.rb', line 29 def update(gem_name) #TODO: implement! end |