rucaptcha 2.3.1 → 2.3.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5e75b6f9248a3ffcf3bc92b4a20fc0f670e4eb25f7188ca6ee4643534b8c34a8
4
- data.tar.gz: 91d369ae82e6be6a75f7ab6bcf6bafe0aabe853a54efbf7069f46037b7cc3a75
3
+ metadata.gz: 2a8c1de1ba0dfa866fb32ad0a56fe9a07a74986f6d849620b456b94d43031469
4
+ data.tar.gz: 5089e1997cf65943e217b4a9926da4788d463f1eda3406c3b092039fe93697d1
5
5
  SHA512:
6
- metadata.gz: 4a73d887b71280cc2054eb4a36284233a578f6d7a50ec104f68512603e4f5cb7b5fb0d1a156d78956e8eeb807c1ccc676942a395920765f68b12b166d96a6738
7
- data.tar.gz: d769ec8e35652ce15f7d9630df8e0475f8a01c388af212fe534dc47a2e41877b24315b5e5ba253f8f848c601b988673534f9cff9c190401d5a2c84bbd5dad54f
6
+ metadata.gz: d83740e79db780c3d2c08ebe48da44795e60b946810c5afd9e0943d1889ab8dff7619f0fdbf4125293e688e9941fb1bf61c02b49e25d55927ce528e25843044b
7
+ data.tar.gz: 87e905b2138f4fe1f1a11375de13e7901801364b4551403953768e8e8ca0d48351cc628fa59d4deaedb6695d227fcf07bb0fd44aa1b2d3963463d1af4cd89fb1
@@ -1,3 +1,8 @@
1
+ 2.3.2
2
+ -------
3
+
4
+ - Change Yellow and Green colors to Pink and Deep Purple to pass WCAG 2.0's contrast test
5
+
1
6
  2.3.1
2
7
  -------
3
8
 
data/README.md CHANGED
@@ -9,7 +9,7 @@ This is a Captcha gem for Rails Applications which generates captcha image by C
9
9
 
10
10
  ## Example
11
11
 
12
- <img src="https://user-images.githubusercontent.com/5518/45155117-78276700-b20c-11e8-81ea-d18d9d30f90b.png" width="800px" />
12
+ <img src="https://user-images.githubusercontent.com/5518/49985459-f8492f80-ffa6-11e8-9ef5-8f8f522e4707.png" width="579px" />
13
13
 
14
14
  ## Feature
15
15
 
@@ -78,41 +78,41 @@ static char *colors[] = {
78
78
  "\x29\x62\xFF"
79
79
  "\xff\xff\xff" "," "\0\0\0\0" "\xc8\0\x46\0" "\0" "\x04",
80
80
 
81
- // Green A700 #00C853
81
+ // Pink A700 #C51162
82
82
  "GIF89a" "\xc8\0\x46\0" "\x83" "\0\0"
83
- "\x00\xC8\x53"
84
- "\x00\xC8\x53"
85
- "\x00\xC8\x53"
86
- "\x00\xC8\x53"
87
- "\x00\xC8\x53"
88
- "\x00\xC8\x53"
89
- "\x00\xC8\x53"
90
- "\x00\xC8\x53"
91
- "\x00\xC8\x53"
92
- "\x00\xC8\x53"
93
- "\x00\xC8\x53"
94
- "\x00\xC8\x53"
95
- "\x00\xC8\x53"
96
- "\x00\xC8\x53"
97
- "\x00\xC8\x53"
83
+ "\xC5\x11\x62"
84
+ "\xC5\x11\x62"
85
+ "\xC5\x11\x62"
86
+ "\xC5\x11\x62"
87
+ "\xC5\x11\x62"
88
+ "\xC5\x11\x62"
89
+ "\xC5\x11\x62"
90
+ "\xC5\x11\x62"
91
+ "\xC5\x11\x62"
92
+ "\xC5\x11\x62"
93
+ "\xC5\x11\x62"
94
+ "\xC5\x11\x62"
95
+ "\xC5\x11\x62"
96
+ "\xC5\x11\x62"
97
+ "\xC5\x11\x62"
98
98
  "\xff\xff\xff" "," "\0\0\0\0" "\xc8\0\x46\0" "\0" "\x04",
99
99
 
100
- // Yellow A700 #FFD600
100
+ // Deep Purple A700 #6200EA
101
101
  "GIF89a" "\xc8\0\x46\0" "\x83" "\0\0"
102
- "\xFF\xD6\x00"
103
- "\xFF\xD6\x00"
104
- "\xFF\xD6\x00"
105
- "\xFF\xD6\x00"
106
- "\xFF\xD6\x00"
107
- "\xFF\xD6\x00"
108
- "\xFF\xD6\x00"
109
- "\xFF\xD6\x00"
110
- "\xFF\xD6\x00"
111
- "\xFF\xD6\x00"
112
- "\xFF\xD6\x00"
113
- "\xFF\xD6\x00"
114
- "\xFF\xD6\x00"
115
- "\xFF\xD6\x00"
116
- "\xFF\xD6\x00"
102
+ "\x62\x00\xEA"
103
+ "\x62\x00\xEA"
104
+ "\x62\x00\xEA"
105
+ "\x62\x00\xEA"
106
+ "\x62\x00\xEA"
107
+ "\x62\x00\xEA"
108
+ "\x62\x00\xEA"
109
+ "\x62\x00\xEA"
110
+ "\x62\x00\xEA"
111
+ "\x62\x00\xEA"
112
+ "\x62\x00\xEA"
113
+ "\x62\x00\xEA"
114
+ "\x62\x00\xEA"
115
+ "\x62\x00\xEA"
116
+ "\x62\x00\xEA"
117
117
  "\xff\xff\xff" "," "\0\0\0\0" "\xc8\0\x46\0" "\0" "\x04"
118
118
  };
@@ -29,12 +29,15 @@ module RuCaptcha
29
29
  # params:
30
30
  # resource - [optional] a ActiveModel object, if given will add validation error message to object.
31
31
  # :keep_session - if true, RuCaptcha will not delete the captcha code session.
32
+ # :captcha - if given, the value of it will be used to verify the captcha,
33
+ # if do not give or blank, the value of params[:_rucaptcha] will be used to verify the captcha
32
34
  #
33
35
  # exmaples:
34
36
  #
35
37
  # verify_rucaptcha?
36
38
  # verify_rucaptcha?(user, keep_session: true)
37
39
  # verify_rucaptcha?(nil, keep_session: true)
40
+ # verify_rucaptcha?(nil, captcha: params[:user][:captcha])
38
41
  #
39
42
  def verify_rucaptcha?(resource = nil, opts = {})
40
43
  opts ||= {}
@@ -54,7 +57,7 @@ module RuCaptcha
54
57
  end
55
58
 
56
59
  # Make sure parama have captcha
57
- captcha = (params[:_rucaptcha] || '').downcase.strip
60
+ captcha = (opts[:captcha] || params[:_rucaptcha] || '').downcase.strip
58
61
  if captcha.blank?
59
62
  return add_rucaptcha_validation_error
60
63
  end
@@ -1,3 +1,3 @@
1
1
  module RuCaptcha
2
- VERSION = '2.3.1'
2
+ VERSION = '2.3.2'
3
3
  end
@@ -6,8 +6,8 @@ module RuCaptcha
6
6
  opts[:autocorrect] = 'off'
7
7
  opts[:autocapitalize] = 'off'
8
8
  opts[:pattern] = '[a-zA-Z]*'
9
- opts[:maxlength] = 5
10
9
  opts[:autocomplete] = 'off'
10
+ opts[:maxlength] ||= 5
11
11
  tag(:input, opts)
12
12
  end
13
13
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rucaptcha
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.1
4
+ version: 2.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Lee
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-17 00:00:00.000000000 Z
11
+ date: 2018-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -85,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
85
85
  version: '0'
86
86
  requirements: []
87
87
  rubyforge_project:
88
- rubygems_version: 2.7.6
88
+ rubygems_version: 2.7.8
89
89
  signing_key:
90
90
  specification_version: 4
91
91
  summary: This is a Captcha gem for Rails Applications. It drawing captcha image with