Illegal environment variable name for gem repo mirror setting

103 views
Skip to first unread message

Jack C

unread,
Apr 22, 2016, 2:27:40 PM4/22/16
to ruby-bundler
Hi,

Currently it is technically "possible" to set a mirror for a gem repo using environment variables. For example, use "BUNDLE_MIRROR__HTTPS://FOO__RUBYGEMS__ORG/" to set a mirror for the repo "https://foo.rubygems.org/". Unfortunately the name of this environment variable is illegal. If I do "export BUNDLE_MIRROR__HTTPS://FOO__RUBYGEMS__ORG/=https://rubygems.org/", I got an error "not a valid identifier". Is it possible to escape the illegal characters here (namely : and /)?

Jack

André Arko

unread,
Apr 22, 2016, 2:29:29 PM4/22/16
to ruby-b...@googlegroups.com
It seems that the spec says the only illegal character is “=“, which we don’t use: http://stackoverflow.com/a/2821183. That said, it might be worth it to see if there’s a way to accommodate implementations that only support [a-zA-z_].

--
You received this message because you are subscribed to the Google Groups "ruby-bundler" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-bundler...@googlegroups.com.
To post to this group, send email to ruby-b...@googlegroups.com.
Visit this group at https://groups.google.com/group/ruby-bundler.
For more options, visit https://groups.google.com/d/optout.

Tim Moore

unread,
Apr 22, 2016, 2:57:38 PM4/22/16
to ruby-b...@googlegroups.com
There was a change made in this pull request to allow you to specify credentials in the environment using just the hostname rather than the full URI https://github.com/bundler/bundler/pull/3295

BUNDLE_GEMS__COMPANY__COM=user:pass


It doesn't look like the same pattern is currently supported for mirrors, unfortunately, but maybe someone could submit a pull request to add it?

-- Tim

Reply all
Reply to author
Forward
0 new messages