Skip to content

Improve configuration support#64

Merged
jonallured merged 1 commit intomainfrom
improve-configuration-support
Oct 25, 2024
Merged

Improve configuration support#64
jonallured merged 1 commit intomainfrom
improve-configuration-support

Conversation

@jonallured
Copy link
Owner

This PR is heavily inspired by #51 and #59 to arrive at something I think both PR authors would like. The ultimate goal is to provide better support for configuring the gem in whichever way is more desired. I updated the README to illustrate how either instance-level configuration settings could be used or global ones instead. Then I updated the BrazeRuby::API.new method signature to not require any arguments.

From there I blended those PR approaches to arrive at a simple solution:

  • prefer instance level settings
  • use global settings when instance settings are not provided
  • finally fallback options to an empty hash

Then I added specs which caused me to have to add a BrazeRuby.reset method so that test state did not leak between runs.

That's it! Thanks so much to @gerbal and @hugolepetit for their ideas that lead me here and sorry it took literal years. 😬

@jonallured jonallured self-assigned this Oct 25, 2024
@jonallured jonallured merged commit d534653 into main Oct 25, 2024
@jonallured jonallured deleted the improve-configuration-support branch October 25, 2024 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant