yandex_captcha 0.4.1 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dbf52c20e538f32b0b7223f10a62ca0d23a6621c
4
- data.tar.gz: dadcd9fcd4b42b5f289a634ccfc011b4c34b89f2
3
+ metadata.gz: 81fe4ac018adcdad7ad4a6af3c810b6fe0fe7b1c
4
+ data.tar.gz: 1a066cb0d9643a30f86b0f37984667f3f344b972
5
5
  SHA512:
6
- metadata.gz: a8a503a4804153bbfe0ac3ee99ea0a5605217764d1b14c0f5a5b7b6c53e94a8dc07f5aaaa9263ce0dc23b1705c540ac152ad1f655e700b0f4b4ffc35dd7192dd
7
- data.tar.gz: 8b98b751edf120ff142ccb28abd84993fd73978d4f05cd85a1f5382e0dc0d65e97dc627a1dcd3439dff9f3fed2077b23c73d324a35ef76cd5d3ad53ede6533d0
6
+ metadata.gz: 2e62ea594139cd88c8f10497c0d1385fd4fba11120322b04edc743a5cda150ef1d657ce3d591f0a1ba692b128d21719c69395588d3987ea202d03eae415419f6
7
+ data.tar.gz: 6105150031f7f391ed9d9c850c171175264c82870e94a7089d4ab2d5aaf25883114398735f366f696aabcc0a7134c3e7eea1f79e449f3d2b015b8dbb3df80c66
data/README.md CHANGED
@@ -11,7 +11,7 @@ Unfortunatelly, this gem *is not capable with MRI 1.8.7* because of MRI 1.8.7 do
11
11
 
12
12
  Add this line to your application's Gemfile:
13
13
 
14
- gem 'yandex_captcha', '~> 0.4.1'
14
+ gem 'yandex_captcha', '~> 0.4.2'
15
15
 
16
16
  Or:
17
17
 
@@ -25,10 +25,23 @@ Or install it yourself as:
25
25
 
26
26
  $ gem install yandex_captcha
27
27
 
28
+ This gem can be used as Rails Engine or Sinatra Extension.
29
+
30
+ Tested:
31
+ - Rails 3.2+ (Rails 4 also checked)
32
+ - Sinatra 1.4+
33
+
28
34
  ## Usage
29
35
 
30
36
  Get the api key: [http://api.yandex.ru/cleanweb/getkey.xml](http://api.yandex.ru/cleanweb/getkey.xml)
31
37
 
38
+ ### Options
39
+
40
+ - `ajax` = `true/false`
41
+ - `noscript` = `true/false` Only for non ajax version.
42
+
43
+ ### Code
44
+
32
45
  ```ruby
33
46
  # Rails routes
34
47
  mount YandexCaptcha::Engine, at: '/yandex_captcha/'
data/config/routes.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  YandexCaptcha::Engine.routes.draw do
2
- match 'captcha' => 'captcha#show'
2
+ get 'captcha' => 'captcha#show'
3
3
  end
@@ -6,10 +6,10 @@ module YandexCaptcha
6
6
 
7
7
  error = options[:error] ||= ((defined? flash) ? flash[:captcha_error] : "")
8
8
  if options[:ajax]
9
- render "yandex_captcha/captcha_ajax"
9
+ render partial: "yandex_captcha/captcha_ajax"
10
10
  else
11
11
  captcha = YandexCaptcha::Verify.get_captcha
12
- render "yandex_captcha/captcha", locals: { captcha: captcha, error: error, noscript: options[:noscript] } if captcha
12
+ render partial: "yandex_captcha/captcha", locals: { captcha: captcha, error: error, noscript: options[:noscript] } if captcha
13
13
  end
14
14
  end
15
15
 
@@ -1,3 +1,3 @@
1
1
  module YandexCaptcha
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yandex_captcha
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Merkulov