Created
November 9, 2014 11:23
-
-
Save godfat/c232d34a86246ca3e3f4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# slow as hell: | |
require 'rubygems/gem_runner' | |
Gem::GemRunner.new.run(['install', gem_path]) | |
# fast! | |
require 'rubygems/commands/install_command' | |
# read ~/.gemrc | |
Gem.use_paths(Gem.configuration[:gemhome], Gem.configuration[:gempath]) | |
Gem::Command.extra_args = Gem.configuration[:gem] | |
# setup install options | |
cmd = Gem::Commands::InstallCommand.new | |
cmd.handle_options([]) | |
# install | |
install = Gem::Installer.new(gem_path, cmd.options) | |
install.install | |
puts "\e[35mGem installed: \e[33m#{strip_path(install.gem_dir)} \e[0m" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment