Have I Been Pwned is a service that lets you check if your accounts have been included in data breaches. You can enter your email address to subscribe to notifications if (or when) your personal details are compromised.
HIBP also offers an API that lets site operators check their users’ passwords haven’t been previously compromised. It does this using a clever k-Anonymity model which allows this check to happen without revealing the user’s chosen password to HIBP or any other third party. You can read up on the precise method in the HIBP API documentation.
My pull request to add Have I Been Pwned support to RubyGems.org was recently (well, a month ago) merged and deployed to production.