easy_captcha 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +2 -2
- data/VERSION +1 -1
- data/easy_captcha.gemspec +1 -1
- data/lib/easy_captcha/controller_helpers.rb +3 -3
- data/lib/easy_captcha.rb +1 -1
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -20,8 +20,8 @@ You can write this in "config/initializers/easy_captcha.rb", if you want to cust
|
|
20
20
|
|
21
21
|
# Cache
|
22
22
|
# config.cache = true
|
23
|
-
# Cache temp dir
|
24
|
-
# config.temp_dir =
|
23
|
+
# Cache temp dir from Rails.root
|
24
|
+
# config.temp_dir = 'tmp/captcha'
|
25
25
|
# Cache size
|
26
26
|
# config.cache_size = 500
|
27
27
|
# Cache expire
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1
|
data/easy_captcha.gemspec
CHANGED
@@ -11,8 +11,8 @@ module EasyCaptcha
|
|
11
11
|
# generate captcha image and return it as blob
|
12
12
|
def generate_captcha
|
13
13
|
if EasyCaptcha.cache
|
14
|
-
FileUtils.mkdir_p(EasyCaptcha.cache_temp_dir)
|
15
|
-
files = Dir.glob(EasyCaptcha.cache_temp_dir + "*")
|
14
|
+
FileUtils.mkdir_p(Rails.root + EasyCaptcha.cache_temp_dir)
|
15
|
+
files = Dir.glob(Rails.root + EasyCaptcha.cache_temp_dir + "*")
|
16
16
|
unless files.size < EasyCaptcha.cache_size
|
17
17
|
file = File.open(files.at(Kernel.rand(files.size)))
|
18
18
|
|
@@ -23,7 +23,7 @@ module EasyCaptcha
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
generated_code = generate_captcha_code
|
26
|
-
Captcha.new(generated_code, EasyCaptcha.cache_temp_dir + "#{generated_code}").image
|
26
|
+
Captcha.new(generated_code, Rails.root + EasyCaptcha.cache_temp_dir + "#{generated_code}").image
|
27
27
|
else
|
28
28
|
Captcha.new(generate_captcha_code).image
|
29
29
|
end
|
data/lib/easy_captcha.rb
CHANGED