rucaptcha 3.0.0.beta1-arm64-darwin → 3.0.1-arm64-darwin

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1bb669f6c9742142d809d1e88fd21f9281e3d05e33c5ff0987c648f48408a4ed
4
- data.tar.gz: 306b98fa6a56802657185bd1008a44cec0a087540b27ec318ecf162e053f1ac7
3
+ metadata.gz: 7018a3c74f076e4023ba6c1138fbd521d2a9a2a7d6aac74504cb923b6c736a98
4
+ data.tar.gz: 0664beca6454cc524712dc15c0600927dbb0d3f033d02efd0dccd4ded4f861ed
5
5
  SHA512:
6
- metadata.gz: 49391ef1edf9cf6daac8a21ddf2dfbc17d6c16cb90461723109fc7cedd327bb00c51b4df92e265e2bb525963099b00506cf7cbee812063f6952387d80158cd58
7
- data.tar.gz: 9d7896c26762c4383ef19e8c10a00099c6beda32387faa9046c30263e3c87a87b4e6fc9b7936da86107c3da729ea754ac7a0401cd43137c3a1f974b4d4724ccd
6
+ metadata.gz: 7d5c2c5dafe60f948a84c1c1e58164444806830c96ead5984ce5ff28eeb2d0a85a0ed3e713e3f418c6ec672f528bed596b4f3e862c1a139977e4beb794eb0c90
7
+ data.tar.gz: 6440ab15ab2388e6c8aafeaa411ec31999f022e31699c59aee63aab33a66b88438814c3943dc664fc8f4897672fe8ff2741c9f5270e1f0405986f932dfd33aff
@@ -0,0 +1,14 @@
1
+ module RuCaptcha
2
+ class CaptchaController < ActionController::Base
3
+ def index
4
+ return head :ok if request.head?
5
+
6
+ headers["Cache-Control"] = "no-cache, no-store, max-age=0, must-revalidate"
7
+ headers["Pragma"] = "no-cache"
8
+ data = generate_rucaptcha
9
+
10
+ opts = { disposition: "inline", type: "image/png" }
11
+ send_data data, opts
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,3 @@
1
+ en:
2
+ rucaptcha:
3
+ invalid: "The captcha code is incorrect (if you can't read, you can click image to refresh it)"
@@ -0,0 +1,3 @@
1
+ 'pt-BR':
2
+ rucaptcha:
3
+ invalid: "Código inválido!"
@@ -0,0 +1,3 @@
1
+ 'zh-CN':
2
+ rucaptcha:
3
+ invalid: "验证码不正确(如无法识别,可以点击刷新验证码)"
@@ -0,0 +1,3 @@
1
+ 'zh-TW':
2
+ rucaptcha:
3
+ invalid: "驗證碼不正確(如無法識別,可以點擊刷新驗證碼)"
data/config/routes.rb ADDED
@@ -0,0 +1,3 @@
1
+ RuCaptcha::Engine.routes.draw do
2
+ root to: "captcha#index"
3
+ end
@@ -105,8 +105,8 @@ fn cyclic_write_character(res: &[String], image: &mut ImageBuffer<Rgb<u8>, Vec<u
105
105
  let font = get_font();
106
106
  let line_color = colors[rand_num(colors.len() - 1)];
107
107
 
108
- for j in 0..(rand_num(2) + 1) as i32 {
109
- let offset = j * (rand_num(3) as i32 + 1);
108
+ for j in 0..(rand_num(3) + 1) as i32 {
109
+ let offset = j * (rand_num(2) as i32 + 1);
110
110
  draw_text_mut(
111
111
  image,
112
112
  color,
@@ -182,8 +182,8 @@ impl CaptchaBuilder {
182
182
  pub fn new() -> Self {
183
183
  CaptchaBuilder {
184
184
  length: 4,
185
- width: 240,
186
- height: 64,
185
+ width: 300,
186
+ height: 100,
187
187
  complexity: 5,
188
188
  }
189
189
  }
Binary file
Binary file
Binary file
@@ -1,3 +1,3 @@
1
1
  module RuCaptcha
2
- VERSION = "3.0.0.beta1"
2
+ VERSION = "3.0.1"
3
3
  end
data/lib/rucaptcha.rb CHANGED
@@ -48,7 +48,7 @@ module RuCaptcha
48
48
  raise RuCaptcha::Errors::Configuration, "length config error, value must in 3..7" unless length.in?(3..7)
49
49
 
50
50
  result = RuCaptchaCore.create(length, config.difficulty || 5)
51
- [result[0], result[1].pack("c*")]
51
+ [result[0].downcase, result[1].pack("c*")]
52
52
  end
53
53
 
54
54
  def check_cache_store!
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: 3.0.0.beta1
4
+ version: 3.0.1
5
5
  platform: arm64-darwin
6
6
  authors:
7
7
  - Jason Lee
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-13 00:00:00.000000000 Z
11
+ date: 2022-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -46,9 +46,17 @@ extra_rdoc_files: []
46
46
  files:
47
47
  - README.md
48
48
  - Rakefile
49
+ - app/controllers/ru_captcha/captcha_controller.rb
50
+ - config/locales/rucaptcha.en.yml
51
+ - config/locales/rucaptcha.pt-BR.yml
52
+ - config/locales/rucaptcha.zh-CN.yml
53
+ - config/locales/rucaptcha.zh-TW.yml
54
+ - config/routes.rb
49
55
  - ext/rucaptcha/Cargo.lock
50
56
  - ext/rucaptcha/Cargo.toml
51
57
  - ext/rucaptcha/extconf.rb
58
+ - ext/rucaptcha/fonts/FuzzyBubbles-Regular.ttf
59
+ - ext/rucaptcha/fonts/Handlee-Regular.ttf
52
60
  - ext/rucaptcha/src/captcha.rs
53
61
  - ext/rucaptcha/src/lib.rs
54
62
  - lib/rucaptcha.rb
@@ -80,9 +88,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
80
88
  version: 3.2.dev
81
89
  required_rubygems_version: !ruby/object:Gem::Requirement
82
90
  requirements:
83
- - - ">"
91
+ - - ">="
84
92
  - !ruby/object:Gem::Version
85
- version: 1.3.1
93
+ version: '0'
86
94
  requirements: []
87
95
  rubygems_version: 3.4.0.dev
88
96
  signing_key: