From d98a158fc87ced9d392cfeef31bf17ffa7ef63cb Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Mon, 27 Aug 2018 08:59:20 +0200 Subject: [PATCH] Formally deprecate #use_clean_gemset --- lib/aruba/api.rb | 2 -- lib/aruba/api/deprecated.rb | 26 ++++++++++++++++++++++++++ lib/aruba/api/rvm.rb | 37 ------------------------------------- 3 files changed, 26 insertions(+), 39 deletions(-) delete mode 100644 lib/aruba/api/rvm.rb diff --git a/lib/aruba/api.rb b/lib/aruba/api.rb index 3d89f547f..d2e33ce36 100644 --- a/lib/aruba/api.rb +++ b/lib/aruba/api.rb @@ -16,7 +16,6 @@ require 'aruba/api/filesystem' require 'aruba/api/text' require 'aruba/api/bundler' -require 'aruba/api/rvm' Aruba.platform.require_matching_files('../matchers/**/*.rb', __FILE__) @@ -29,7 +28,6 @@ module Api include Aruba::Api::Environment include Aruba::Api::Filesystem include Aruba::Api::Bundler - include Aruba::Api::Rvm include Aruba::Api::Deprecated include Aruba::Api::Text end diff --git a/lib/aruba/api/deprecated.rb b/lib/aruba/api/deprecated.rb index 7873cf8a4..fddc45032 100644 --- a/lib/aruba/api/deprecated.rb +++ b/lib/aruba/api/deprecated.rb @@ -935,6 +935,32 @@ def announcer @announcer end + # @deprecated + # Use a clean rvm gemset + # + # Please make sure that you've got [rvm](http://rvm.io/) installed. + # + # @param [String] gemset + # The name of the gemset to be used + def use_clean_gemset(gemset) + Aruba.platform.deprecated('The use of "#use_clean_gemset" is deprecated.') + run_simple(%{rvm gemset create "#{gemset}"}, true) + if all_stdout =~ /'#{gemset}' gemset created \((.*)\)\./ + gem_home = Regexp.last_match[1] + set_environment_variable('GEM_HOME', gem_home) + set_environment_variable('GEM_PATH', gem_home) + set_environment_variable('BUNDLE_PATH', gem_home) + + paths = (ENV['PATH'] || "").split(File::PATH_SEPARATOR) + paths.unshift(File.join(gem_home, 'bin')) + set_environment_variable('PATH', paths.uniq.join(File::PATH_SEPARATOR)) + + run_simple("gem install bundler", true) + else + raise "I didn't understand rvm's output: #{all_stdout}" + end + end + # @private # @deprecated def process_monitor diff --git a/lib/aruba/api/rvm.rb b/lib/aruba/api/rvm.rb deleted file mode 100644 index 7baf145c1..000000000 --- a/lib/aruba/api/rvm.rb +++ /dev/null @@ -1,37 +0,0 @@ -require 'aruba/api/environment' -require 'aruba/api/commands' - -# Aruba -module Aruba - # Api - module Api - # RVM - # - # @deprecated - module Rvm - # Use a clean rvm gemset - # - # Please make sure that you've got [rvm](http://rvm.io/) installed. - # - # @param [String] gemset - # The name of the gemset to be used - def use_clean_gemset(gemset) - run_command_and_stop(%{rvm gemset create "#{gemset}"}, true) - if all_stdout =~ /'#{gemset}' gemset created \((.*)\)\./ - gem_home = Regexp.last_match[1] - set_environment_variable('GEM_HOME', gem_home) - set_environment_variable('GEM_PATH', gem_home) - set_environment_variable('BUNDLE_PATH', gem_home) - - paths = (ENV['PATH'] || "").split(File::PATH_SEPARATOR) - paths.unshift(File.join(gem_home, 'bin')) - set_environment_variable('PATH', paths.uniq.join(File::PATH_SEPARATOR)) - - run_command_and_stop("gem install bundler", true) - else - raise "I didn't understand rvm's output: #{all_stdout}" - end - end - end - end -end