Deprecate Faker::Placeholdit in favor of Faker::LoremFlickr.image#3274
Open
augustocbx wants to merge 1 commit into
Open
Deprecate Faker::Placeholdit in favor of Faker::LoremFlickr.image#3274augustocbx wants to merge 1 commit into
augustocbx wants to merge 1 commit into
Conversation
The via.placeholder.com service no longer resolves, so the URLs generated by Faker::Placeholdit are broken. Per maintainer guidance in the issue and the project's decision to move away from generators that rely on external services (faker-ruby#2852), deprecate the generator instead of pointing it at another third-party host, so it can be removed in a future release. Faker::Placeholdit.image keeps working and returns the same values; it now emits a deprecation warning recommending Faker::LoremFlickr.image. [Fix faker-ruby#3055]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation / Background
Fixes #3055
The
via.placeholder.comservice no longer resolves (ERR_NAME_NOT_RESOLVED), so every URL generated byFaker::Placeholditis broken. In the issue discussion, @stefannibrasil asked for this generator to be deprecated — consistent with the project's decision to move away from generators that rely on external services (#2852) — rather than repointing it at another third-party host.This PR deprecates
Faker::Placeholdit#imageusingGem::Deprecate, following the process documented in CONTRIBUTING.md and the precedent from #2733 (free_email/safe_email). The generator keeps working and returns the same values, so this is fully backward compatible — it just warns and recommendsFaker::LoremFlickr.image, the maintained replacement.Additional information
Console output after the change:
Changes:
lib/faker/default/placeholdit.rb:extend Gem::Deprecate+deprecate :image, 'Faker::LoremFlickr.image', 2026, 12(date mirrors the ~6-month horizon used in Generate safeemailanddomain_nameby default (RFC 2606) #2733; happy to adjust it to match your release plans)test/faker/default/test_placeholdit.rb: regression test asserting the deprecation warning is emitted (verified it fails without thedeprecatecall); existing tests silence the warning viaGem::Deprecate.skipinsetup/teardownto keep test output cleandoc/default/placeholdit.md: deprecation notice pointing toFaker::LoremFlickrTest results:
bundle exec rake→ 2180 tests, 297308 assertions, 0 failures, 0 errors; RuboCop: 576 files inspected, no offenses detected.Checklist
Before submitting the PR make sure the following are checked:
[Fix #issue-number]🤖 Generated with Claude Code