diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-12-01 12:45:13 +0100 |
---|---|---|
committer | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-12-01 15:33:55 +0100 |
commit | 1e888e0a2b1e3f56c4bdfa3256ab51ce67ebe4aa (patch) | |
tree | 3c8d4b9c3bfd4f8e1ff9048c1dafc76fde2dc2d1 | |
parent | 5227358ae255377440d0da0560fc3962b73a7bb9 (diff) | |
download | bundler-1e888e0a2b1e3f56c4bdfa3256ab51ce67ebe4aa.tar.gz |
Rename `env_version` to `source`
This is usually provided as an `ENV` variable but that's completely
transparent to this class. Also, this is not always a version number. I
think something like "source" is a better fit.
-rw-r--r-- | spec/support/rubygems_version_manager.rb | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/spec/support/rubygems_version_manager.rb b/spec/support/rubygems_version_manager.rb index ca5f0bcd6d..59fdc38475 100644 --- a/spec/support/rubygems_version_manager.rb +++ b/spec/support/rubygems_version_manager.rb @@ -8,8 +8,8 @@ class RubygemsVersionManager include Spec::Helpers include Spec::Path - def initialize(env_version) - @env_version = env_version + def initialize(source) + @source = source end def switch @@ -23,7 +23,7 @@ class RubygemsVersionManager private def use_system? - @env_version.nil? + @source.nil? end def unrequire_rubygems_if_needed @@ -57,7 +57,7 @@ private end def local_copy_switch_needed? - !env_version_is_path? && target_tag != local_copy_tag + !source_is_path? && target_tag != local_copy_tag end def target_tag @@ -75,7 +75,7 @@ private end def resolve_local_copy_path - return expanded_env_version if env_version_is_path? + return expanded_source if source_is_path? rubygems_path = root.join("tmp/rubygems") @@ -87,17 +87,17 @@ private rubygems_path end - def env_version_is_path? - expanded_env_version.directory? + def source_is_path? + expanded_source.directory? end - def expanded_env_version - @expanded_env_version ||= Pathname.new(@env_version).expand_path(root) + def expanded_source + @expanded_source ||= Pathname.new(@source).expand_path(root) end def resolve_target_tag - return "v#{@env_version}" if @env_version.match(/^\d/) + return "v#{@source}" if @source.match(/^\d/) - @env_version + @source end end |