wolcanus-simple_captcha 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
=SimpleCaptcha
|
2
2
|
|
3
|
-
|
3
|
+
This is a fork of galetahub SimpleCaptcha to support Mongoid.
|
4
|
+
Its implementation requires
|
4
5
|
adding up a single line in views and in controllers/models.
|
5
6
|
SimpleCaptcha is available to be used with Rails 3 or above and also it provides the
|
6
7
|
backward compatibility with previous versions of Rails.
|
@@ -24,11 +25,11 @@ backward compatibility with previous versions of Rails.
|
|
24
25
|
|
25
26
|
==Installation
|
26
27
|
|
27
|
-
gem "
|
28
|
+
gem "wolcanus-simple_captcha", :require => "simple_captcha"
|
28
29
|
|
29
30
|
or
|
30
31
|
|
31
|
-
gem '
|
32
|
+
gem 'wolcanus-simple_captcha', :require => 'simple_captcha', :git => 'git://github.com/wolcanus/simple-captcha.git'
|
32
33
|
|
33
34
|
==Setup
|
34
35
|
|
@@ -37,8 +38,6 @@ on the version of rails your application is using.
|
|
37
38
|
|
38
39
|
rails generate simple_captcha
|
39
40
|
|
40
|
-
rake db:migrate
|
41
|
-
|
42
41
|
==Usage
|
43
42
|
|
44
43
|
===Controller Based
|
@@ -205,7 +204,7 @@ You can change the CSS of the SimpleCaptcha DOM elements as per your need in thi
|
|
205
204
|
default: "Secret Code did not match with the Image"
|
206
205
|
user: "The secret Image and code were different"
|
207
206
|
|
208
|
-
==
|
207
|
+
==The Original Author
|
209
208
|
|
210
209
|
Enjoy the simplest captcha implementation.
|
211
210
|
|
@@ -219,4 +218,4 @@ Plugin Homepage: http://expressica.com/simple_captcha
|
|
219
218
|
|
220
219
|
Plugin update for rails 3: http://github.com/galetahub
|
221
220
|
|
222
|
-
Any feedback/comment/issue/donation is welcome!
|
221
|
+
Any feedback/comment/issue/donation is welcome!
|
data/lib/generators/USAGE
CHANGED
@@ -6,16 +6,9 @@ class SimpleCaptchaGenerator < Rails::Generators::Base
|
|
6
6
|
def self.source_root
|
7
7
|
@source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'templates/'))
|
8
8
|
end
|
9
|
-
|
10
|
-
def self.next_migration_number(dirname)
|
11
|
-
Time.now.strftime("%Y%m%d%H%M%S")
|
12
|
-
end
|
13
9
|
|
14
10
|
def create_partial
|
15
11
|
template "partial.erb", File.join('app/views', 'simple_captcha', "_simple_captcha.erb")
|
16
12
|
end
|
17
|
-
|
18
|
-
def create_migration
|
19
|
-
migration_template "migration.rb", File.join('db/migrate', "create_simple_captcha_data.rb")
|
20
|
-
end
|
13
|
+
|
21
14
|
end
|
@@ -11,13 +11,13 @@ module SimpleCaptcha
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def remove_data(key)
|
14
|
-
|
14
|
+
SimpleCaptchaData.where(:key => key).first.delete
|
15
15
|
clear_old_data(1.hour.ago)
|
16
16
|
end
|
17
17
|
|
18
18
|
def clear_old_data(time = 1.hour.ago)
|
19
19
|
return unless Time === time
|
20
|
-
|
20
|
+
SimpleCaptchaData.where(:updated_at.lt => time).delete_all
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
metadata
CHANGED
@@ -1,26 +1,46 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: wolcanus-simple_captcha
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 1
|
8
|
+
- 4
|
9
|
+
version: 0.1.4
|
6
10
|
platform: ruby
|
7
|
-
authors:
|
11
|
+
authors:
|
8
12
|
- Weverton do Couto Timoteo
|
9
13
|
autorequire:
|
10
14
|
bindir: bin
|
11
15
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
+
|
17
|
+
date: 2012-01-18 00:00:00 -02:00
|
18
|
+
default_executable:
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: mongoid
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ~>
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 2
|
29
|
+
- 3
|
30
|
+
- 4
|
31
|
+
version: 2.3.4
|
32
|
+
type: :runtime
|
33
|
+
version_requirements: *id001
|
34
|
+
description: SimpleCaptcha is available to be used with Rails 3 or above and also it provides the backward compatibility with previous versions of Rails.
|
16
35
|
email: weverton@wolcan.us
|
17
36
|
executables: []
|
37
|
+
|
18
38
|
extensions: []
|
19
|
-
|
39
|
+
|
40
|
+
extra_rdoc_files:
|
20
41
|
- README.rdoc
|
21
|
-
files:
|
42
|
+
files:
|
22
43
|
- lib/generators/simple_captcha_generator.rb
|
23
|
-
- lib/generators/templates/migration.rb
|
24
44
|
- lib/generators/templates/partial.erb
|
25
45
|
- lib/generators/USAGE
|
26
46
|
- lib/simple_captcha/active_record.rb
|
@@ -37,30 +57,35 @@ files:
|
|
37
57
|
- lib/simple_captcha.rb
|
38
58
|
- Rakefile
|
39
59
|
- README.rdoc
|
40
|
-
|
60
|
+
has_rdoc: true
|
41
61
|
homepage: http://github.com/wolcanus/simple-captcha
|
42
62
|
licenses: []
|
63
|
+
|
43
64
|
post_install_message:
|
44
65
|
rdoc_options: []
|
45
|
-
|
66
|
+
|
67
|
+
require_paths:
|
46
68
|
- lib
|
47
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
requirements:
|
56
|
-
- -
|
57
|
-
- !ruby/object:Gem::Version
|
58
|
-
|
69
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - ">="
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
segments:
|
74
|
+
- 0
|
75
|
+
version: "0"
|
76
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
77
|
+
requirements:
|
78
|
+
- - ">="
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
segments:
|
81
|
+
- 0
|
82
|
+
version: "0"
|
59
83
|
requirements: []
|
84
|
+
|
60
85
|
rubyforge_project:
|
61
|
-
rubygems_version: 1.
|
86
|
+
rubygems_version: 1.3.6
|
62
87
|
signing_key:
|
63
88
|
specification_version: 3
|
64
89
|
summary: A fork of galetahub SimpleCaptcha for mongoid support.
|
65
|
-
test_files:
|
90
|
+
test_files:
|
66
91
|
- test/simple_captcha_test.rb
|
@@ -1,15 +0,0 @@
|
|
1
|
-
class CreateSimpleCaptchaData < ActiveRecord::Migration
|
2
|
-
def self.up
|
3
|
-
create_table :simple_captcha_data do |t|
|
4
|
-
t.string :key, :limit => 40
|
5
|
-
t.string :value, :limit => 6
|
6
|
-
t.timestamps
|
7
|
-
end
|
8
|
-
|
9
|
-
add_index :simple_captcha_data, :key, :name => "idx_key"
|
10
|
-
end
|
11
|
-
|
12
|
-
def self.down
|
13
|
-
drop_table :simple_captcha_data
|
14
|
-
end
|
15
|
-
end
|