urbanairship / ruby-library

A Ruby wrapper for the Urban Airship API.
Other
200 stars 117 forks source link

Change targeted Airship server on a request basis #125

Closed romainsalles closed 3 years ago

romainsalles commented 3 years ago

What does this do and why?

Users having to deal with multiple Airship servers (EU/US) on the same machine can't use this gem since you can only configure the server globally, not on a request-basis.

This PR adds this functionality by adding a new optional server parameter to the Client initializer.

Additional notes for reviewers

Here is a description of the commits to help you review the PR:

  1. I've added some specs on Client and PageIterator to prepare my refactoring
  2. To prepare my next change, I've refactored PageIterator to improve readability
  3. I've added a new next_page_path attribute to PageIterator which permits initialising the iteration with a "path" instead of an "url" (preparation for the next commits)
  4. I've changed all the xxx_url methods into xxx_path
  5. Small refactoring on a misleading method name
  6. Finally, add the optional server parameter to the Client initializer ✌️
  7. Bonus: fixed highlights of the README

Testing

Airship Contribution Agreement