traptcha 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/traptcha/image.rb +2 -2
- data/lib/traptcha/version.rb +1 -1
- data/lib/traptcha.rb +6 -0
- metadata +3 -3
data/lib/traptcha/image.rb
CHANGED
@@ -4,7 +4,7 @@ module Traptcha
|
|
4
4
|
|
5
5
|
def initialize(text, options = {})
|
6
6
|
@text = text
|
7
|
-
@canvas = ::Magick::Image.new(
|
7
|
+
@canvas = ::Magick::Image.new(Traptcha.default_width, Traptcha.default_height)
|
8
8
|
@canvas.format = "PNG"
|
9
9
|
@options = options
|
10
10
|
end
|
@@ -29,7 +29,7 @@ module Traptcha
|
|
29
29
|
|
30
30
|
image.font_family = "Thonburi"
|
31
31
|
image.font_weight = ::Magick::BoldWeight
|
32
|
-
|
32
|
+
|
33
33
|
position = 0
|
34
34
|
|
35
35
|
@text.chars.each do |letter|
|
data/lib/traptcha/version.rb
CHANGED
data/lib/traptcha.rb
CHANGED
@@ -20,6 +20,12 @@ module Traptcha
|
|
20
20
|
mattr_accessor :default_length
|
21
21
|
@@default_length = 3
|
22
22
|
|
23
|
+
mattr_accessor :default_width
|
24
|
+
@@default_width = 200
|
25
|
+
|
26
|
+
mattr_accessor :default_height
|
27
|
+
@@default_height = 100
|
28
|
+
|
23
29
|
mattr_accessor :valid_chars
|
24
30
|
@@valid_chars = ('a'..'z').to_a + (0..9).map(&:to_s).to_a
|
25
31
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: traptcha
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 13
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 9
|
10
|
+
version: 0.0.9
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Rodrigo Navarro
|