Skip to content

Refactor string helpers to have less monkey patching#227

Open
mvz wants to merge 8 commits into
masterfrom
refactor-string-helpers
Open

Refactor string helpers to have less monkey patching#227
mvz wants to merge 8 commits into
masterfrom
refactor-string-helpers

Conversation

@mvz
Copy link
Copy Markdown
Member

@mvz mvz commented May 16, 2026

  • Copy string transform helpers to new TextTransformer module
  • Delegate string extension methods to PublifyCore::TextTransformer
  • Deprecate String#to_permalink monkeypatch and replace calls to it
  • Make deprecation message about PublifyCore instead of about Rails
  • Deprecate String#to_url monkeypatch and replace calls to it
  • Store the deprecator in the PublifyCore module
  • Spec that String#to_url and String#to_permalink are really deprecated
  • Deprecate String#strip_html monkey-patch and replace calls to it

string = string.tr(key.join, value)
end
string = string.tr("'", "-")
to_url(string.gsub(/<[^>]*>/, ""))
string = string.tr(key.join, value)
end
string = string.tr("'", "-")
to_url(string.gsub(/<[^>]*>/, ""))
@mvz
Copy link
Copy Markdown
Member Author

mvz commented May 16, 2026

Rails has its own methods that provide this functionality. Those methods will be more hardened and we should use them instead.

@mvz mvz added the on hold label May 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants