glebtv-simple_captcha 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +2 -0
- data/Rakefile +0 -0
- data/lib/generators/simple_captcha_generator.rb +1 -1
- data/lib/generators/templates/migration.rb +14 -14
- data/lib/generators/templates/partial.erb +0 -24
- data/lib/glebtv-simple_captcha.rb +0 -0
- data/lib/simple_captcha.rb +0 -0
- data/lib/simple_captcha/engine.rb +0 -0
- data/lib/simple_captcha/hooks/form_builder.rb +0 -0
- data/lib/simple_captcha/hooks/formtastic.rb +0 -0
- data/lib/simple_captcha/hooks/simple_form.rb +11 -11
- data/lib/simple_captcha/image.rb +0 -0
- data/lib/simple_captcha/model_helpers.rb +0 -0
- data/lib/simple_captcha/storage/active_record.rb +22 -22
- data/lib/simple_captcha/storage/mongoid.rb +0 -0
- data/lib/simple_captcha/utils.rb +0 -0
- data/lib/simple_captcha/version.rb +2 -1
- metadata +14 -16
- data/test/simple_captcha_test.rb +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 56b2f0ffd426ed4af21105feeef7b12d53c79c3c
|
4
|
+
data.tar.gz: f75531cc8139786aa6c8ac053414b642b5369d39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f5845f8550ef7b8de8ab5ac2c15f660b4975b8a58325d8fa3ab9d289b682f41e3c0607ba3327f1735a997841580f80a4e9ca524778d8c707148de264ba63c90
|
7
|
+
data.tar.gz: 58053f230938ca6177d0b602f3049357a27c4bfd24a47249c08fcbd96fb9a596aba339151b76982ae292d327e4ef9318ca071a7025b8d8ee43d7fd47a7690f47
|
data/README.rdoc
CHANGED
data/Rakefile
CHANGED
File without changes
|
@@ -1,15 +1,15 @@
|
|
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
|
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
15
|
end
|
@@ -1,27 +1,3 @@
|
|
1
|
-
<style type="text/CSS">
|
2
|
-
.simple_captcha{border: 1px solid #ccc; padding: 5px !important;}
|
3
|
-
.simple_captcha,
|
4
|
-
.simple_captcha div{display: table;}
|
5
|
-
.simple_captcha .simple_captcha_field,
|
6
|
-
.simple_captcha .simple_captcha_image{
|
7
|
-
border: 1px solid #ccc;
|
8
|
-
margin: 0px 0px 2px 0px !important;
|
9
|
-
padding: 0px !important;
|
10
|
-
}
|
11
|
-
.simple_captcha .simple_captcha_image img{
|
12
|
-
margin: 0px !important;
|
13
|
-
padding: 0px !important;
|
14
|
-
width: 110px !important;
|
15
|
-
}
|
16
|
-
.simple_captcha .simple_captcha_label{font-size: 12px;}
|
17
|
-
.simple_captcha .simple_captcha_field input{
|
18
|
-
width: 150px !important;
|
19
|
-
font-size: 16px;
|
20
|
-
border: none;
|
21
|
-
background-color: #efefef;
|
22
|
-
}
|
23
|
-
</style>
|
24
|
-
|
25
1
|
<div class='simple_captcha'>
|
26
2
|
<div class='simple_captcha_image'>
|
27
3
|
<%%= simple_captcha_options[:image] %>
|
File without changes
|
data/lib/simple_captcha.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,11 +1,11 @@
|
|
1
|
-
require 'simple_form'
|
2
|
-
|
3
|
-
module SimpleCaptcha::SimpleForm
|
4
|
-
class CkeditorInput < ::SimpleForm::Inputs::Base
|
5
|
-
def input
|
6
|
-
@builder.simple_captcha(input_html_options)
|
7
|
-
end
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
::SimpleForm::FormBuilder.map_type :simple_captcha, :to => SimpleCaptcha::SimpleForm::CkeditorInput
|
1
|
+
require 'simple_form'
|
2
|
+
|
3
|
+
module SimpleCaptcha::SimpleForm
|
4
|
+
class CkeditorInput < ::SimpleForm::Inputs::Base
|
5
|
+
def input
|
6
|
+
@builder.simple_captcha(input_html_options)
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
::SimpleForm::FormBuilder.map_type :simple_captcha, :to => SimpleCaptcha::SimpleForm::CkeditorInput
|
data/lib/simple_captcha/image.rb
CHANGED
File without changes
|
File without changes
|
@@ -1,23 +1,23 @@
|
|
1
|
-
module SimpleCaptcha
|
2
|
-
class SimpleCaptchaData < ::ActiveRecord::Base
|
3
|
-
self.table_name = "simple_captcha_data"
|
4
|
-
|
5
|
-
attr_accessible :key, :value
|
6
|
-
|
7
|
-
class << self
|
8
|
-
def get_data(key)
|
9
|
-
data = find_by_key(key) || new(:key => key)
|
10
|
-
end
|
11
|
-
|
12
|
-
def remove_data(key)
|
13
|
-
delete_all(["#{connection.quote_column_name(:key)} = ?", key])
|
14
|
-
clear_old_data(1.hour.ago)
|
15
|
-
end
|
16
|
-
|
17
|
-
def clear_old_data(time = 1.hour.ago)
|
18
|
-
return unless Time === time
|
19
|
-
delete_all(["#{connection.quote_column_name(:updated_at)} < ?", time])
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
1
|
+
module SimpleCaptcha
|
2
|
+
class SimpleCaptchaData < ::ActiveRecord::Base
|
3
|
+
self.table_name = "simple_captcha_data"
|
4
|
+
|
5
|
+
attr_accessible :key, :value
|
6
|
+
|
7
|
+
class << self
|
8
|
+
def get_data(key)
|
9
|
+
data = find_by_key(key) || new(:key => key)
|
10
|
+
end
|
11
|
+
|
12
|
+
def remove_data(key)
|
13
|
+
delete_all(["#{connection.quote_column_name(:key)} = ?", key])
|
14
|
+
clear_old_data(1.hour.ago)
|
15
|
+
end
|
16
|
+
|
17
|
+
def clear_old_data(time = 1.hour.ago)
|
18
|
+
return unless Time === time
|
19
|
+
delete_all(["#{connection.quote_column_name(:updated_at)} < ?", time])
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
23
|
end
|
File without changes
|
data/lib/simple_captcha/utils.rb
CHANGED
File without changes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glebtv-simple_captcha
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GlebTv
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-11-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -25,34 +25,33 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '3.2'
|
27
27
|
description: .
|
28
|
-
email:
|
28
|
+
email: glebtv@gmail.com
|
29
29
|
executables: []
|
30
30
|
extensions: []
|
31
31
|
extra_rdoc_files:
|
32
32
|
- README.rdoc
|
33
33
|
files:
|
34
34
|
- lib/simple_captcha.rb
|
35
|
-
- lib/
|
35
|
+
- lib/generators/simple_captcha_generator.rb
|
36
36
|
- lib/generators/USAGE
|
37
37
|
- lib/generators/templates/migration.rb
|
38
38
|
- lib/generators/templates/partial.erb
|
39
|
-
- lib/
|
39
|
+
- lib/simple_captcha/version.rb
|
40
|
+
- lib/simple_captcha/engine.rb
|
41
|
+
- lib/simple_captcha/utils.rb
|
40
42
|
- lib/simple_captcha/storage/active_record.rb
|
41
43
|
- lib/simple_captcha/storage/mongoid.rb
|
42
|
-
- lib/simple_captcha/
|
43
|
-
- lib/simple_captcha/utils.rb
|
44
|
-
- lib/simple_captcha/engine.rb
|
44
|
+
- lib/simple_captcha/image.rb
|
45
45
|
- lib/simple_captcha/view.rb
|
46
|
-
- lib/simple_captcha/
|
46
|
+
- lib/simple_captcha/middleware.rb
|
47
47
|
- lib/simple_captcha/model_helpers.rb
|
48
|
-
- lib/simple_captcha/
|
49
|
-
- lib/simple_captcha/hooks/formtastic.rb
|
48
|
+
- lib/simple_captcha/controller.rb
|
50
49
|
- lib/simple_captcha/hooks/simple_form.rb
|
51
50
|
- lib/simple_captcha/hooks/form_builder.rb
|
52
|
-
- lib/simple_captcha/
|
51
|
+
- lib/simple_captcha/hooks/formtastic.rb
|
52
|
+
- lib/glebtv-simple_captcha.rb
|
53
53
|
- Rakefile
|
54
54
|
- README.rdoc
|
55
|
-
- test/simple_captcha_test.rb
|
56
55
|
homepage: http://github.com/glebtv/simple-captcha
|
57
56
|
licenses: []
|
58
57
|
metadata: {}
|
@@ -72,9 +71,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
72
71
|
version: '0'
|
73
72
|
requirements: []
|
74
73
|
rubyforge_project:
|
75
|
-
rubygems_version: 2.
|
74
|
+
rubygems_version: 2.1.10
|
76
75
|
signing_key:
|
77
76
|
specification_version: 4
|
78
77
|
summary: A fork of a fork of a fork of simple_captcha.
|
79
|
-
test_files:
|
80
|
-
- test/simple_captcha_test.rb
|
78
|
+
test_files: []
|