Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Support using the GEM_VERSION env variable in addition to the _VERSION_ argument #887

Open
wants to merge 1 commit into from

2 participants

@postmodern
  • If GEM_VERSION is specified, it is deleted from ENV so it is not passed to sub-processes.
  • Use of an env variable is preferrable, as non-rubygem binstubs do not support the VERSION argument (ex: Bundler's binstubs).
@postmodern postmodern Support using the GEM_VERSION env variable instead of _VERSION_ argum…
…ent.

* If GEM_VERSION is specified, it is deleted from ENV so it is not
  passed to sub-processes.
* Use of an env variable is preferrable, as non-rubygem binstubs do not
  support the _VERSION_ argument (ex: Bundler's binstubs).
85ee269
@drbrain drbrain added this to the Future milestone
@drbrain
Owner

This needs documentation, too, perhaps in gem install

@postmodern postmodern changed the title from Support using the GEM_VERSION env variable instead of _VERSION_ argument to Support using the GEM_VERSION env variable in addition to the _VERSION_ argument
@postmodern

@drbrain where should I add the documentation and what should I say exactly? It doesn't seem like the _VERSION_ was originally documented either, so I don't have text to build on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 18, 2014
  1. @postmodern

    Support using the GEM_VERSION env variable instead of _VERSION_ argum…

    postmodern authored
    …ent.
    
    * If GEM_VERSION is specified, it is deleted from ENV so it is not
      passed to sub-processes.
    * Use of an env variable is preferrable, as non-rubygem binstubs do not
      support the _VERSION_ argument (ex: Bundler's binstubs).
This page is out of date. Refresh to see the latest.
View
4 lib/rubygems/installer.rb
@@ -647,6 +647,10 @@ def app_script_text(bin_file_name)
end
end
+if ENV['GEM_VERSION']
+ version = ENV.delete('GEM_VERSION')
+end
+
gem '#{spec.name}', version
load Gem.bin_path('#{spec.name}', '#{bin_file_name}', version)
TEXT
View
4 test/rubygems/test_gem_installer.rb
@@ -47,6 +47,10 @@ def test_app_script_text
end
end
+if ENV['GEM_VERSION']
+ version = ENV.delete('GEM_VERSION')
+end
+
gem 'a', version
load Gem.bin_path('a', 'executable', version)
EOF
Something went wrong with that request. Please try again.