yandex_captcha 0.4.3.7 → 0.4.3.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/.travis.yml +1 -0
- data/README.md +3 -2
- data/lib/yandex_captcha/verify.rb +1 -1
- data/lib/yandex_captcha/version.rb +1 -1
- data/test/yandex_captcha_test.rb +5 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f0cc9313a7e585becadbdbdbbce6dd4a86a4b91
|
4
|
+
data.tar.gz: 6b537ed32d98b0d1b1a448881aac4537049e2aef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c9cdbfc66f3fd75e0320b4938e0d7d24841a68e73d6959dd85b1e51f0f16c006b72694cd4903a7245aef8581b63478b186af8eb4ea8675772d4e77ba57e4ca1
|
7
|
+
data.tar.gz: f752c3f845c5d788b5bbb425c4260cac64c6aaaaeaa1ec9a0cdbf0ce0aea9a748452150f6de1d41078a86b655cb30c575083a4f0725a5351eb1bff18c84bc655
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.2.3
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
[![Inline docs](http://inch-ci.org/github/merqlove/yandex-captcha.svg)](http://inch-ci.org/github/merqlove/yandex-captcha)
|
6
6
|
[![Dependency Status](https://gemnasium.com/merqlove/yandex-captcha.svg)](https://gemnasium.com/merqlove/yandex-captcha)
|
7
7
|
|
8
|
-
Ruby wrapper for [Yandex Cleanweb](http://api.yandex.ru/cleanweb/) spam detector.
|
8
|
+
Ruby wrapper for [Yandex Cleanweb](http://api.yandex.ru/cleanweb/) with Rails and Sinatra support, spam detector.
|
9
9
|
|
10
10
|
Unfortunatelly, this gem *is not capable with MRI 1.8.7* because of MRI 1.8.7 doesn't have `URI.encode_www_form` method.
|
11
11
|
|
@@ -30,7 +30,8 @@ Or install it yourself as:
|
|
30
30
|
This gem can be used as Rails Engine or Sinatra Extension.
|
31
31
|
|
32
32
|
Tested:
|
33
|
-
- Rails 3.2+
|
33
|
+
- Rails 3.2+
|
34
|
+
- Rails 4.1
|
34
35
|
- Sinatra 1.4+
|
35
36
|
|
36
37
|
## Usage
|
@@ -36,7 +36,7 @@ module YandexCaptcha
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def valid_captcha?(captcha_id=nil, value=nil, request_id=nil)
|
39
|
-
true if YandexCaptcha.skip_env
|
39
|
+
return true if YandexCaptcha.skip_env
|
40
40
|
|
41
41
|
response = api_check_captcha(request_id, captcha_id, value)
|
42
42
|
doc = Nokogiri::XML(response)
|
data/test/yandex_captcha_test.rb
CHANGED
@@ -34,6 +34,7 @@ describe YandexCaptcha do
|
|
34
34
|
before do
|
35
35
|
YandexCaptcha.configure do |config|
|
36
36
|
config.api_key = nil
|
37
|
+
config.current_env = "development"
|
37
38
|
end
|
38
39
|
end
|
39
40
|
|
@@ -82,21 +83,22 @@ describe YandexCaptcha do
|
|
82
83
|
before do
|
83
84
|
YandexCaptcha.configure do |config|
|
84
85
|
config.api_key = "cw.1.1.20121227T080449Z.51de1ee126e5ced6.f4f417fb55727520d7e39b00cf5393d4b1ca5e78"
|
86
|
+
config.current_env = "development"
|
85
87
|
end
|
86
88
|
end
|
87
89
|
|
88
90
|
describe "#spam?" do
|
89
91
|
|
90
92
|
describe "simple check" do
|
91
|
-
it "works" do
|
93
|
+
it "works simple" do
|
92
94
|
YandexCaptcha::Verify.spam?("фраза").must_equal false
|
93
95
|
YandexCaptcha::Verify.spam?("недорого увеличение пениса проститутки").must_equal false
|
94
96
|
end
|
95
97
|
end
|
96
98
|
|
97
99
|
describe "advanced mode" do
|
98
|
-
it "works" do
|
99
|
-
YandexCaptcha::Verify.spam?(body_plain: "my text", ip: "
|
100
|
+
it "works advanced" do
|
101
|
+
YandexCaptcha::Verify.spam?(body_plain: "my text", ip: "127.0.0.1").must_equal false
|
100
102
|
end
|
101
103
|
|
102
104
|
it "with some html" do
|
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.3.
|
4
|
+
version: 0.4.3.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Merkulov
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2015-10-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|
@@ -136,7 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
136
136
|
version: '0'
|
137
137
|
requirements: []
|
138
138
|
rubyforge_project:
|
139
|
-
rubygems_version: 2.
|
139
|
+
rubygems_version: 2.4.5.1
|
140
140
|
signing_key:
|
141
141
|
specification_version: 4
|
142
142
|
summary: Ruby wrapper for Yandex.Cleanweb spam detector
|