You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’d encourage you to reconsider the necessity of the existence of the shorteners class method. It will be a maintenance nightmare.
It still seems valuable to provide a default list of shorteners but to encourage users to supply their own.
The current implementation interrogates Configuration.shorteners with any? and expects to be yielded a series of domains that respond to to_s.
If the interface between Embiggen::URI and Configuration.shorteners was simplified to include? (or something similar) then it would be possible to replace a static list of shorteners with much more powerful options, e.g.
GitHub: #2
Allow users to supply their own object for
Embiggen::Configuration.shorteners that only responds to include? to
determine whether a URI is shortened or not.
This replaces the current Set implementation with a ShortenerList class
that has the same API (to keep testing simple) but exposes a custom
include? method.
As raised by @sferik on Twitter:
It still seems valuable to provide a default list of shorteners but to encourage users to supply their own.
The current implementation interrogates
Configuration.shorteners
withany?
and expects to be yielded a series of domains that respond toto_s
.If the interface between
Embiggen::URI
andConfiguration.shorteners
was simplified toinclude?
(or something similar) then it would be possible to replace a static list of shorteners with much more powerful options, e.g.The text was updated successfully, but these errors were encountered: