Sha256: dc43714fab1891d928d8e95beaa1a7583a764c3dd61717da69614fe862b0f266

Contents?: true

Size: 841 Bytes

Versions: 3

Compression:

Stored size: 841 Bytes

Contents

require 'yandex_captcha/configuration'
require 'yandex_captcha/verify'

module YandexCaptcha
  class NoApiKeyException < Exception; end
  class BadResponseException < Exception; end
  class YandexCaptchaError < StandardError; end

  API_URL = 'http://cleanweb-api.yandex.ru/1.0'
  CAPTCHA_TYPE = 'std'
  HANDLE_TIMEOUTS_GRACEFULLY      = true
  SKIP_VERIFY_ENV = ['test', 'cucumber']

  # Allows easy setting of multiple configuration options. See Configuration
  # for all available options.
  def self.configure
    config = configuration
    yield(config)
  end

  # Gives access to the current Configuration.
  def self.configuration
    @configuration ||= Configuration.new
  end
end

if defined?(Rails)
  require 'yandex_captcha/rails'
end

if defined?(Sinatra) and Sinatra.respond_to? :register
  require 'yandex_captcha/sinatra'
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
yandex_captcha-0.4.3.1 lib/yandex_captcha.rb
yandex_captcha-0.4.3 lib/yandex_captcha.rb
yandex_captcha-0.4.1 lib/yandex_captcha.rb