0.0
No release in over a year
A simple interface for verifying Google reCAPTCHA responses in Ruby web apps.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

~> 0.20, >= 0.20.0
 Project Readme

recaptcha_check (reCAPTCHA verification)

A simple interface for verifying Google reCAPTCHA responses.

You can find the gem here: RubyGems.org

Installation

gem install recaptcha_check

Methods

RecaptchaCheck#register: sets the reCAPTCHA private key to be used during verification.

RecaptchaCheck#verify: returns true if the reCAPTCHA response passes verification.

Configuration

You must call RecaptchaCheck#register once early in your application to set the reCAPTCHA private key before using RecaptchaCheck#verify in other parts of your application.

RecaptchaCheck.register ENV['var_containing_your_reCAPTCHA_PrivateKey']

Usage in Sinatra app

post '/contact' do
    require 'recaptcha_check'

    if RecaptchaCheck.verify(params)
        # mailer.send params
        redirect '/contact/sent'
    else
        redirect back
    end
end