simple_captcha2 0.4.2 → 0.4.3

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
  SHA1:
3
- metadata.gz: f8f865e98ebd2b44687dd85cba7e5dec3d5eaeae
4
- data.tar.gz: cc24a8eb5fc210777e4633df42ad7c00a705c305
3
+ metadata.gz: c89e2fec1c40f57893d53697a221bf6ba4a9c3e6
4
+ data.tar.gz: 0d55c4ba052d020f19877571feac77daaf8c9231
5
5
  SHA512:
6
- metadata.gz: adac76147dd7b88e82f4761b338e8a7b83235ed2d8fcfc288e00dd50376c05231439d7ce29518d550cf02ccaaba6279d76ff1b860372b9fa5b945ca518f1d24d
7
- data.tar.gz: 12b6d66de5ff5e9a2ac83a981c5ce12655748828bce13e9b96327fa2516d50446f4dbf3c41d040c070b3a8dfe3eff3b820135c4e6050e1a7265596e35fc2477b
6
+ metadata.gz: 7b6168a217a5d62ede49d7ee0f9e9a5d6b43ad3e6be5cac54024ac760164a6a04f2667cee33f29d2e3a459143b344760c7f95e3e5d077af4b25e662371f807ad
7
+ data.tar.gz: a82a14b079d107788853cdc8caabfa94f218f1d84ba2c7daa88280eccb905af70365750f152924690f3f6bf0fd5368a3683d28ac187f8c9b04facda3e361f867
data/README.md CHANGED
@@ -256,6 +256,13 @@ SimpleCaptcha.setup do |sc|
256
256
  end
257
257
  ```
258
258
 
259
+ If needed, you can explicitly state the font used for generating the captcha:
260
+
261
+ ```ruby
262
+ SimpleCaptcha.setup do |sc|
263
+ sc.font = "DejaVu-Sans"
264
+ end
265
+ ```
259
266
 
260
267
  ### How to change the CSS for SimpleCaptcha DOM elements?
261
268
 
@@ -67,6 +67,10 @@ module SimpleCaptcha
67
67
  mattr_accessor :noise
68
68
  @@noise = 0
69
69
 
70
+ # used font
71
+ mattr_accessor :font
72
+ @@font = ''
73
+
70
74
  mattr_accessor :extra_response_headers
71
75
  @@extra_response_headers = {}
72
76
 
@@ -75,6 +75,9 @@ module SimpleCaptcha #:nodoc
75
75
  params << "-pointsize 22"
76
76
  params << "-implode #{ImageHelpers.implode}"
77
77
  params << "label:#{text}"
78
+ unless SimpleCaptcha.font.empty?
79
+ params << "-font #{SimpleCaptcha.font}"
80
+ end
78
81
  if SimpleCaptcha.noise and SimpleCaptcha.noise > 0
79
82
  params << "-evaluate Uniform-noise #{SimpleCaptcha.noise}"
80
83
  end
@@ -1,3 +1,3 @@
1
1
  module SimpleCaptcha
2
- VERSION = "0.4.2".freeze
2
+ VERSION = "0.4.3".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_captcha2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavlo Galeta
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2017-02-03 00:00:00.000000000 Z
14
+ date: 2017-02-20 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rails