Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

fixing NoMethodError on settings #5015

Merged
merged 2 commits into from
Sep 24, 2016
Merged

fixing NoMethodError on settings #5015

merged 2 commits into from
Sep 24, 2016

Conversation

m1k3
Copy link
Contributor

@m1k3 m1k3 commented Sep 23, 2016

When the Settings object is initialized with no root directory it cannot read the local_config. This used to not be a problem due to the fact that the #load_config method did not try to exit early. Since now it does it returns nil when the config is not present setting the @local_config instance variable to nil. The fix is to return an empty hash the same way the #load_config method would return if it encountered a problem later on.

The attached test proves that there is a problem and the fix makes the problem go away.

When the Settings object is initialized with no root directory it cannot read the local_config. This used to not be a problem due to the fact that the `#load_config` method did not try to exit early. Since now it does it returns nil when the config is not present setting the @local_config instance variable to nil. The fix is to return an empty hash the same way the `#load_config` method would return if it encountered a problem later on.

The attached test proves that there is a problem and the fix make the problem go away.
@segiddins
Copy link
Member

Thanks! 👍

@segiddins
Copy link
Member

@homu r+

@homu
Copy link
Contributor

homu commented Sep 24, 2016

📌 Commit 664c052 has been approved by segiddins

@homu
Copy link
Contributor

homu commented Sep 24, 2016

⚡ Test exempted - status

@homu homu merged commit 664c052 into rubygems:master Sep 24, 2016
homu added a commit that referenced this pull request Sep 24, 2016
fixing NoMethodError on settings

When the Settings object is initialized with no root directory it cannot read the local_config. This used to not be a problem due to the fact that the `#load_config` method did not try to exit early. Since now it does it returns nil when the config is not present setting the @local_config instance variable to nil. The fix is to return an empty hash the same way the `#load_config` method would return if it encountered a problem later on.

The attached test proves that there is a problem and the fix makes the problem go away.
@m1k3 m1k3 deleted the fix-settings-no-config branch September 25, 2016 08:42
segiddins pushed a commit that referenced this pull request Sep 30, 2016
fixing NoMethodError on settings

When the Settings object is initialized with no root directory it cannot read the local_config. This used to not be a problem due to the fact that the `#load_config` method did not try to exit early. Since now it does it returns nil when the config is not present setting the @local_config instance variable to nil. The fix is to return an empty hash the same way the `#load_config` method would return if it encountered a problem later on.

The attached test proves that there is a problem and the fix makes the problem go away.
@coilysiren coilysiren modified the milestones: 1.13 - Release 1.13.2, 1.13 - Patch 1.13.2 Sep 30, 2016
ryanfox1985 pushed a commit to AirRefund/bundler that referenced this pull request Oct 4, 2016
* 'master' of github.com:bundler/bundler: (163 commits)
  remove always-failing 1.8.7 build
  Rename to force_ruby_platform
  Fail fast in the specs when running from a path with special characters
  Change changelog on rubygems#4974
  Version 1.13.2 with changelog
  Auto merge of rubygems#4990 - bundler:seg-realworld-flex, r=segiddins
  Auto merge of rubygems#4922 - JuanitoFatas:fix/4914-gemfile-engine-symbol-and-string, r=segiddins
  Auto merge of rubygems#4983 - bundler:seg-redefine-method-visibility, r=indirect
  Auto merge of rubygems#4994 - bundler:seg-definition-init-perf, r=segiddins
  Auto merge of rubygems#4971 - bundler:seg-pare-metadata-error, r=indirect
  Auto merge of rubygems#4998 - srbaker:patch-1, r=segiddins
  Auto merge of rubygems#4968 - bundler:seg-exec-load-docs, r=indirect
  Auto merge of rubygems#5002 - alepore:fix-colors, r=indirect
  Auto merge of rubygems#5015 - m1k3:fix-settings-no-config, r=segiddins
  Auto merge of rubygems#4992 - chrismo:fix_disable_shared_gems_gem_path, r=chrismo
  Auto merge of rubygems#5008 - bundler:seg-lazy-specification-materialize-platform, r=indirect
  Auto merge of rubygems#5014 - bundler:seg-auto-install-bool-key, r=indirect
  Auto merge of rubygems#4928 - bundler:seg-update-compact-index, r=segiddins
  Improve IRB behavior in generated bin/console
  Add a spec for only_ruby_platform
  ...
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants