lib/codelation/development/ruby.rb in codelation-cli-0.0.17 vs lib/codelation/development/ruby.rb in codelation-cli-0.0.18

- old
+ new

@@ -3,16 +3,20 @@ module Codelation class Cli < Thor RUBY_INSTALL_VERSION = "0.5.0" RUBY_INSTALL_URL = "https://github.com/postmodern/ruby-install/archive/v#{RUBY_INSTALL_VERSION}.tar.gz" - RUBY_VERSION = "2.2.1" + RUBY_VERSION = "2.2.2" private # Install Ruby binary and add it to PATH. def install_ruby return if `~/.codelation/ruby/bin/ruby -v`.include?(RUBY_VERSION) + + # Remove existing Ruby install from older version + ruby_directory = File.expand_path("~/.codelation/ruby") + FileUtils.rm_rf(ruby_directory) if Dir.exist?(ruby_directory) # Create the directory ~/.codelation/temp if it doesn't exist FileUtils.mkdir_p(File.expand_path("~/.codelation/temp")) print_command("Installing ruby-install")