captchah 1.0.6 → 1.1.1
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.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/captchah/encryptor.rb +3 -2
- data/lib/captchah/generators/html.rb +3 -2
- data/lib/captchah/generators/puzzle.rb +4 -4
- data/lib/captchah/version.rb +1 -1
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4aa5d76a22024f7579a41b99405e9766371aba269edcfebf1e34fc4a7bf880db
|
4
|
+
data.tar.gz: 74e1151d527a58884f3f9190c9156913a7d54c4b70ce4615963a4a1b3db20f4c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9cc0121f8f4a7004ec5873e5f4b2e2d1fc290d26ded59f325df3f91bd18aced57e69552034c8390ec2ca0b918a67d7dcec1bb3e6bc154ed7dbd8e24f030e21a
|
7
|
+
data.tar.gz: b0d3ccd6a1960e6b232b90341a76098493381458fffe804e3ce177e37ccc99b92ea36f2a00d754e5791f81a33accd1cfc5aa28ab3b6886933b80cd60df54d00c
|
data/README.md
CHANGED
@@ -7,7 +7,7 @@ A Rails captcha gem that attempts to determine whether or not a user is human.
|
|
7
7
|
Add this line to your application's Gemfile:
|
8
8
|
|
9
9
|
```
|
10
|
-
gem 'captchah', '~> 1.
|
10
|
+
gem 'captchah', '~> 1.1'
|
11
11
|
```
|
12
12
|
|
13
13
|
And execute:
|
@@ -27,7 +27,7 @@ $ convert -version
|
|
27
27
|
## Dependencies
|
28
28
|
|
29
29
|
```
|
30
|
-
gem 'rails', '~> 5
|
30
|
+
gem 'rails', '~> 5'
|
31
31
|
```
|
32
32
|
|
33
33
|
```
|
data/lib/captchah/encryptor.rb
CHANGED
@@ -14,9 +14,10 @@ module Captchah
|
|
14
14
|
private
|
15
15
|
|
16
16
|
def encryptor
|
17
|
-
|
17
|
+
secret =
|
18
|
+
Rails.application.secrets.secret_key_base.mb_chars.limit(32).to_s
|
18
19
|
|
19
|
-
ActiveSupport::MessageEncryptor.new(
|
20
|
+
ActiveSupport::MessageEncryptor.new(secret)
|
20
21
|
end
|
21
22
|
end
|
22
23
|
end
|
@@ -66,8 +66,9 @@ module Captchah
|
|
66
66
|
background-color: white;
|
67
67
|
border-radius: 2px;
|
68
68
|
border: 1px solid #c1c1c1;
|
69
|
-
font-size:
|
70
|
-
height:
|
69
|
+
font-size: 18px !important;
|
70
|
+
height: 45px;
|
71
|
+
line-height: 0;
|
71
72
|
margin: 5px 0;
|
72
73
|
max-width: #{width - 12}px;
|
73
74
|
min-width: 0;
|
@@ -47,17 +47,17 @@ module Captchah
|
|
47
47
|
c.draw("line 0,#{rand(10..20)} 400,20") if difficulty > 1
|
48
48
|
|
49
49
|
if difficulty < 3
|
50
|
-
c.fill(rgba(color2,
|
50
|
+
c.fill(rgba(color2, 0.1))
|
51
51
|
c.draw('circle 0,0 300,0')
|
52
52
|
end
|
53
53
|
|
54
54
|
if difficulty > 3
|
55
55
|
c.pointsize(20)
|
56
|
-
c.fill(rgba(
|
56
|
+
c.fill(rgba(color2, 0.6))
|
57
57
|
(difficulty == 5 ? 2 : 1).times do
|
58
58
|
c.draw("text #{rand(43..55)},#{rand(18..48)} ',./ -,_'")
|
59
59
|
end
|
60
|
-
c.fill(rgba(
|
60
|
+
c.fill(rgba(color2, 0.3))
|
61
61
|
c.draw("text #{rand(68..75)},#{rand(10..28)} '/,\ ^._ -'")
|
62
62
|
end
|
63
63
|
|
@@ -94,7 +94,7 @@ module Captchah
|
|
94
94
|
end
|
95
95
|
|
96
96
|
def opacity
|
97
|
-
@opacity ||= difficulty > 2 ?
|
97
|
+
@opacity ||= difficulty > 2 ? 0.9 : 1.2
|
98
98
|
end
|
99
99
|
|
100
100
|
def rgba(rgb, alpha)
|
data/lib/captchah/version.rb
CHANGED
metadata
CHANGED
@@ -1,43 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: captchah
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Evgeni Radev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-08-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mini_magick
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rails
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|