-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
change WebValve.register to accept a class name instead of class #35
Conversation
rails 6 autoloading emits a deprecation warning for class loading during app initialization. webvalve's register call is a culprit here, but it doesn't have to be. this changeset makes it so that webvalve accepts a stringified class name instead of a class and makes that all work properly with the internals.
@@ -1,6 +1,4 @@ | |||
class FakeTwitter < WebValve::FakeService | |||
URL = 'http://faketwitter.test'.freeze |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can't do this sorta thing anymore. we'd have to put this URL into lib or some other non autoloaded path. i was never a huge fan of this approach, so i'm not worried about it.
CHANGELOG.md
Outdated
@@ -9,9 +9,13 @@ and this project aims to adhere to [Semantic Versioning](http://semver.org/spec/ | |||
### Added | |||
### Removed | |||
|
|||
## [0.9.11] - 2019-09-23 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should go in version.rb too, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea I'm gonna update before merge.
@@ -2,6 +2,7 @@ language: ruby | |||
rvm: | |||
- 2.3.1 | |||
- 2.4.2 | |||
- 2.5.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should 2.6.1 go in this list?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea might as well. I gotta fix the rails 6 thing to make sure we exclude < 2.5 in ci
<< domain LGTM 👍 |
Approved! 😻 👯 🎇 |
Configure one by setting the ENV variable "#{service_name.to_s.upcase}_API_URL" | ||
or by using WebValve.register #{service.name}, url: "http://something.dev" | ||
or by using WebValve.register "#{service_class_name}", url: "http://something.dev" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
im a little late to the party with this nit but should this message have the evaluated service_class_name in quotes so no one gets confused and uses the now deprecated way of registering a service?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess that's handled globally in the manager class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's in quotes here, no? since this string is inside a heredoc the quotes are literals
* origin/master: change WebValve.register to accept a class name instead of class (#35)
rails 6 autoloading emits a deprecation warning for class loading during
app initialization. webvalve's register call is a culprit here, but it
doesn't have to be. this changeset makes it so that webvalve accepts a
stringified class name instead of a class and makes that all work
properly with the internals.
/domain @smudge @jmileham @effron @aburgel
/no-platform
more info on this change can be found here rails/rails#36363
the tl;dr for us is that we could remove webvalve things from the autoload paths, but that would make local dev more tedious. so, instead, we just don't load the class until after initialization.