winton-captcha 1.0.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.
- data/README.markdown +27 -0
- data/init.rb +14 -0
- metadata +57 -0
data/README.markdown
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
captcha
|
2
|
+
=======
|
3
|
+
|
4
|
+
A simple captcha generator for Rails.
|
5
|
+
|
6
|
+
|
7
|
+
How it works
|
8
|
+
------------
|
9
|
+
|
10
|
+
If **public/images/captchas** does not exist, 100 captchas will be generated there when the application starts.
|
11
|
+
|
12
|
+
|
13
|
+
Install
|
14
|
+
-------
|
15
|
+
|
16
|
+
gem install winton-captcha
|
17
|
+
|
18
|
+
### Add to environment.rb
|
19
|
+
|
20
|
+
config.gem 'winton-captcha', :lib => 'captcha', :source => 'http://gems.github.com'
|
21
|
+
|
22
|
+
### Add to .gitignore
|
23
|
+
|
24
|
+
public/images/captchas
|
25
|
+
|
26
|
+
|
27
|
+
##### Copyright © 2008 [Winton Welsh](mailto:mail@wintoni.us)
|
data/init.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'captcha'
|
2
|
+
|
3
|
+
ActionController::Base.send :include, CaptchaActions
|
4
|
+
|
5
|
+
to = "public/images/captchas"
|
6
|
+
unless File.exists?(to)
|
7
|
+
FileUtils.mkdir_p to
|
8
|
+
(0..99).each do |x|
|
9
|
+
c = Captcha.new(6)
|
10
|
+
File.open("#{to}/#{c.code}.jpg", 'w') do |f|
|
11
|
+
f << c.code_image
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
metadata
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: winton-captcha
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Winton Welsh
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2008-08-16 00:00:00 -07:00
|
13
|
+
default_executable:
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description: A simple captcha generator for Rails
|
17
|
+
email: mail@wintoni.us
|
18
|
+
executables: []
|
19
|
+
|
20
|
+
extensions: []
|
21
|
+
|
22
|
+
extra_rdoc_files: []
|
23
|
+
|
24
|
+
files:
|
25
|
+
- init.rb
|
26
|
+
- lib/*
|
27
|
+
- lib/**/*
|
28
|
+
- README.markdown
|
29
|
+
- resources/*
|
30
|
+
has_rdoc: false
|
31
|
+
homepage: http://github.com/winton/captcha
|
32
|
+
post_install_message:
|
33
|
+
rdoc_options: []
|
34
|
+
|
35
|
+
require_paths:
|
36
|
+
- lib
|
37
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: "0"
|
42
|
+
version:
|
43
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: "0"
|
48
|
+
version:
|
49
|
+
requirements: []
|
50
|
+
|
51
|
+
rubyforge_project:
|
52
|
+
rubygems_version: 1.2.0
|
53
|
+
signing_key:
|
54
|
+
specification_version: 2
|
55
|
+
summary: A simple captcha generator for Rails
|
56
|
+
test_files: []
|
57
|
+
|