Fix last version yellow color missing bug. version 0.4.4

This commit is contained in:
Jason Lee 2016-05-20 17:45:40 +08:00
parent d42bf4c8e2
commit 6232717898
4 changed files with 9 additions and 6 deletions

View File

@ -1,4 +1,4 @@
0.4.3
0.4.4
- Remove deprecated `width`, `height` config.
- Delete session key after verify (#23).

View File

@ -1,7 +1,7 @@
PATH
remote: .
specs:
rucaptcha (0.4.3)
rucaptcha (0.4.4)
posix-spawn (>= 0.3.0)
GEM

View File

@ -5,9 +5,8 @@ module RuCaptcha
class << self
def random_color
if RuCaptcha.config.style == :colorful
color_seed = (rand(150) + 40).to_s(8)
color = [0.to_s(8), 0.to_s(8), 0.to_s(8)]
color[rand(3)] = color_seed
color = [random_color_seed, random_color_seed, random_color_seed]
color[rand(3)] = 0.to_s(8)
color
else
color_seed = rand(50).to_s(8)
@ -15,6 +14,10 @@ module RuCaptcha
end
end
def random_color_seed
(rand(150) + 10).to_s(8)
end
def random_chars
chars = SecureRandom.hex(RuCaptcha.config.len / 2).downcase
chars.gsub!(/[0ol1]/i, (rand(8) + 2).to_s)

View File

@ -1,3 +1,3 @@
module RuCaptcha
VERSION = '0.4.3'
VERSION = '0.4.4'
end