Sha256: 9510f9cc710c3bb822c880120faee97bfe208022644281fb13d70d6cfc144efa

Contents?: true

Size: 596 Bytes

Versions: 4

Compression:

Stored size: 596 Bytes

Contents

require 'sinatra/base'
require 'yandex_captcha/helpers/sinatra'

module YandexCaptcha
  module Sinatra
    def self.registered(app)
      app.set :captcha_ajax_template, "yandex_captcha/captcha_ajax" unless app.settings.captcha_ajax_template
      app.set :captcha_template, "yandex_captcha/captcha" unless app.settings.captcha_template
      app.set :captcha_url, "/get_captcha" unless app.settings.captcha_url

      app.get app.settings.captcha_url do
        content_type :json
        YandexCaptcha::Verify.get_captcha.to_json
      end

      app.helpers Helpers::Sinatra
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

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