sinatra / mustermann

your personal string matching expert
http://sinatrarb.com/mustermann/
MIT License
664 stars 63 forks source link

Remove extension for Sinatra #116

Closed epergo closed 2 years ago

epergo commented 3 years ago

Contributes to https://github.com/sinatra/mustermann/issues/114

After the Sinatra extension has been extracted to its own gem/repository now we can remove the extension code from Mustermann itself.

zzak commented 3 years ago

I'm wondering what will be the experience if this code is simply removed, would it be better if we provided the same interface but raise an exception to the user telling them to add the extension gem?

epergo commented 3 years ago

I'm wondering what will be the experience if this code is simply removed, would it be better if we provided the same interface but raise an exception to the user telling them to add the extension gem?

Right! The joy of deleting code blinded me and I didn't think about that :smile: I can restore the extend_object method but instead of loading the removed code we can raise an exception with an explanatory message, would that work?

namusyaka commented 3 years ago

@epergo Thanks for your contribution.

I think you can simply put an exceptional message in mustermann/lib/mustermann/extension.rb, and then you can restore only extend_object without register Extension. At least you should consider a case that requires mustermann/extension

epergo commented 3 years ago

@epergo Thanks for your contribution.

I think you can simply put an exceptional message in mustermann/lib/mustermann/extension.rb, and then you can restore only extend_object without register Extension. At least you should consider a case that requires mustermann/extension

Updated in https://github.com/sinatra/mustermann/pull/116/commits/dcbf027f089dd07eaa546fcf66736100357c14b0 WDYT?

olleolleolle commented 3 years ago

@epergo Hi 👋 ! This is awesome, and shows a way forward for mustermann + 3.0. Does it still work? (GitHub Actions' logs are purged, swept away.)

epergo commented 3 years ago

@epergo Hi 👋 ! This is awesome, and shows a way forward for mustermann + 3.0. Does it still work? (GitHub Actions' logs are purged, swept away.)

I've updated the PR with master, ruby 3.0 job still fails because of 1 test and the coverage report