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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e2076481ad872bebe8897ad532f1dd4a97f289ca
4
- data.tar.gz: f52cbbd32f75ab5d7bc05015dfb96ab75ae4adde
3
+ metadata.gz: 1f0cc9313a7e585becadbdbdbbce6dd4a86a4b91
4
+ data.tar.gz: 6b537ed32d98b0d1b1a448881aac4537049e2aef
5
5
  SHA512:
6
- metadata.gz: 63b9cab29fe5bb70e27bacd184465f82b69015f40c074841043ac08d9f80386d304333e5664ba7ecfa29f4ced35cfbb7e8063a6acca081c6a6df3125485f1bd4
7
- data.tar.gz: d66ce44537e1f74645da137d889aebf052bf599b509aff43abc3820cbb488515a663f7dac258c8a21718c330972edcf406af174e9f65484d6e344e05128354df
6
+ metadata.gz: 6c9cdbfc66f3fd75e0320b4938e0d7d24841a68e73d6959dd85b1e51f0f16c006b72694cd4903a7245aef8581b63478b186af8eb4ea8675772d4e77ba57e4ca1
7
+ data.tar.gz: f752c3f845c5d788b5bbb425c4260cac64c6aaaaeaa1ec9a0cdbf0ce0aea9a748452150f6de1d41078a86b655cb30c575083a4f0725a5351eb1bff18c84bc655
@@ -1 +1 @@
1
- 2.1.2
1
+ 2.2.3
@@ -3,6 +3,7 @@ rvm:
3
3
  - 1.9.3
4
4
  - 2.0.0
5
5
  - 2.1.1
6
+ - 2.2.3
6
7
  notifications:
7
8
  email:
8
9
  - api@mrcr.ru
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+ (Rails 4 also checked)
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)
@@ -1,3 +1,3 @@
1
1
  module YandexCaptcha
2
- VERSION = "0.4.3.7"
2
+ VERSION = "0.4.3.8"
3
3
  end
@@ -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: "80.80.40.3").must_equal false
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.7
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: 2014-06-06 00:00:00.000000000 Z
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.2.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