acts_as_textcaptcha 2.1.2 → 2.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +12 -0
- data/lib/acts_as_textcaptcha/textcaptcha.rb +2 -2
- metadata +3 -3
data/README.rdoc
CHANGED
@@ -32,6 +32,18 @@ Install the gem
|
|
32
32
|
|
33
33
|
gem install acts_as_textcaptcha
|
34
34
|
|
35
|
+
Or install as a plugin with
|
36
|
+
|
37
|
+
rails plugin install git@github.com:matthutchinson/acts_as_textcaptcha.git
|
38
|
+
OR
|
39
|
+
script/plugin install git@github.com:matthutchinson/acts_as_textcaptcha.git
|
40
|
+
|
41
|
+
If you do decide to install this as a Rails plugin, you'll have to manually include the bcrypt-ruby gem in your Gemfile or environment config. Like so;
|
42
|
+
|
43
|
+
gem 'bcrypt-ruby', :require => 'bcrypt'
|
44
|
+
OR
|
45
|
+
config.gem 'bcrypt-ruby', :lib => 'bcrypt'
|
46
|
+
|
35
47
|
== Using
|
36
48
|
|
37
49
|
First add the gem to your Gemfile
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'yaml'
|
2
2
|
require 'net/http'
|
3
|
-
require 'md5'
|
3
|
+
require 'digest/md5'
|
4
4
|
require 'logger'
|
5
5
|
|
6
6
|
# compatiblity with < Rails 3.0.0
|
@@ -70,7 +70,7 @@ module ActsAsTextcaptcha
|
|
70
70
|
|
71
71
|
def encrypt_answer(answer)
|
72
72
|
return answer unless(textcaptcha_config['bcrypt_salt'])
|
73
|
-
BCrypt::Engine.hash_secret(answer, textcaptcha_config['bcrypt_salt'], (textcaptcha_config['bcrypt_cost'] || 10))
|
73
|
+
BCrypt::Engine.hash_secret(answer, textcaptcha_config['bcrypt_salt'], (textcaptcha_config['bcrypt_cost'].to_i || 10))
|
74
74
|
end
|
75
75
|
|
76
76
|
def generate_spam_question(use_textcaptcha = true)
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acts_as_textcaptcha
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 13
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 2.1.
|
9
|
+
- 3
|
10
|
+
version: 2.1.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Matthew Hutchinson
|