@@ -202,21 +202,33 @@ def initialize(args)
202202 @hash = @hash . merge environment_config
203203 end
204204
205+ @hash . transform_keys! do |k |
206+ # gemhome and gempath are not working with symbol keys
207+ if %w[ backtrace bulk_threshold verbose update_sources cert_expiration_length_days
208+ install_extension_in_lib ipv4_fallback_enabled sources disable_default_gem_server
209+ ssl_verify_mode ssl_ca_cert ssl_client_cert ] . include? ( k )
210+ k . to_sym
211+ else
212+ k
213+ end
214+ end
215+
205216 # HACK: these override command-line args, which is bad
206217 @backtrace = @hash [ :backtrace ] if @hash . key? :backtrace
207218 @bulk_threshold = @hash [ :bulk_threshold ] if @hash . key? :bulk_threshold
208- @home = @hash [ :gemhome ] if @hash . key? :gemhome
209- @path = @hash [ :gempath ] if @hash . key? :gempath
210- @update_sources = @hash [ :update_sources ] if @hash . key? :update_sources
211219 @verbose = @hash [ :verbose ] if @hash . key? :verbose
212- @disable_default_gem_server = @hash [ :disable_default_gem_server ] if @hash . key? :disable_default_gem_server
213- @sources = @hash [ :sources ] if @hash . key? :sources
220+ @update_sources = @hash [ :update_sources ] if @hash . key? :update_sources
221+ # TODO: We should handle concurrent_downloads same as other options
214222 @cert_expiration_length_days = @hash [ :cert_expiration_length_days ] if @hash . key? :cert_expiration_length_days
215223 @ipv4_fallback_enabled = @hash [ :ipv4_fallback_enabled ] if @hash . key? :ipv4_fallback_enabled
216224
217- @ssl_verify_mode = @hash [ :ssl_verify_mode ] if @hash . key? :ssl_verify_mode
218- @ssl_ca_cert = @hash [ :ssl_ca_cert ] if @hash . key? :ssl_ca_cert
219- @ssl_client_cert = @hash [ :ssl_client_cert ] if @hash . key? :ssl_client_cert
225+ @home = @hash [ :gemhome ] if @hash . key? :gemhome
226+ @path = @hash [ :gempath ] if @hash . key? :gempath
227+ @sources = @hash [ :sources ] if @hash . key? :sources
228+ @disable_default_gem_server = @hash [ :disable_default_gem_server ] if @hash . key? :disable_default_gem_server
229+ @ssl_verify_mode = @hash [ :ssl_verify_mode ] if @hash . key? :ssl_verify_mode
230+ @ssl_ca_cert = @hash [ :ssl_ca_cert ] if @hash . key? :ssl_ca_cert
231+ @ssl_client_cert = @hash [ :ssl_client_cert ] if @hash . key? :ssl_client_cert
220232
221233 @api_keys = nil
222234 @rubygems_api_key = nil
0 commit comments