根据v2.4.6(最近版本,但不是最新版本),我没有看到相当于.local
。
虽然,RubyGems的源代码声明了与您想实现的内容相关的内容。例如,在src/ruby-2.3.0/lib/rubygems/config_file.rb
:
##
# Gem::ConfigFile RubyGems options and gem command options from gemrc.
#
# gemrc is a YAML file that uses strings to match gem command arguments and
# symbols to match RubyGems options.
#
# Gem command arguments use a String key that matches the command name and
# +:sources+:: Sets Gem::sources
# +:verbose+:: See #verbose
#
# gemrc files may exist in various locations and are read and merged in
# the following order:
#
# - system wide (/etc/gemrc)
# - per user (~/.gemrc)
# - per environment (gemrc files listed in the GEMRC environment variable)
所以,你可以使用GEMRC
环境变量来加载额外的,私人的文件。
This works。尽管如此,有一件令人讨厌的事情是,你必须重复列出所有:sources:在GEMRC指向的文件中,这个文件中的值覆盖了当前的设置(尽管我能理解他们为什么这样做)。 – rainkinz
是的,它通过文件...每个文件都是全部或全部没有。也许到目前为止,对更精细的粒度的需求不大? –
我从字面上看了一下编码的东西,但鉴于这个问题似乎并没有出现之前,它可能是一个非常罕见的要求。 – rainkinz