glebtv-simple_captcha 0.5.1 → 0.5.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5a87db77c30204006aa75677d98b5846a2831c18
4
- data.tar.gz: acddb79ffa2fee1f6ae7830071d0895eae2ce016
3
+ metadata.gz: 56b2f0ffd426ed4af21105feeef7b12d53c79c3c
4
+ data.tar.gz: f75531cc8139786aa6c8ac053414b642b5369d39
5
5
  SHA512:
6
- metadata.gz: 1e738a5d94ffa284ac7d6a275d8ac75376537ee428a7680daf783b8b3f4cd72ca728c20cd317d310bd5555dafa49c4aaf028c0a0bcb947e1436462281eab099c
7
- data.tar.gz: 36d60c331bb9438611ac27fe068af7dcca0b44bbc28cf14967f0bc19853173f431414ea0e8393eb3c2472f596db1d4391cfe186cf79f593284641df51da531d9
6
+ metadata.gz: 9f5845f8550ef7b8de8ab5ac2c15f660b4975b8a58325d8fa3ab9d289b682f41e3c0607ba3327f1735a997841580f80a4e9ca524778d8c707148de264ba63c90
7
+ data.tar.gz: 58053f230938ca6177d0b602f3049357a27c4bfd24a47249c08fcbd96fb9a596aba339151b76982ae292d327e4ef9318ca071a7025b8d8ee43d7fd47a7690f47
@@ -1,5 +1,7 @@
1
1
  =SimpleCaptcha
2
2
 
3
+ === For formtastic or simple form: put this gem AFTER THEM in Gemfile!
4
+
3
5
  This is a fork of wolcanus's fork of SimpleCaptcha to support Mongoid 3 and new formtastic.
4
6
 
5
7
  This is a fork of galetahub SimpleCaptcha to support Mongoid.
data/Rakefile CHANGED
File without changes
@@ -2,7 +2,7 @@ require 'rails/generators'
2
2
 
3
3
  class SimpleCaptchaGenerator < Rails::Generators::Base
4
4
  include Rails::Generators::Migration
5
-
5
+
6
6
  def self.source_root
7
7
  @source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'templates/'))
8
8
  end
@@ -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
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
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
File without changes
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+
2
3
  module SimpleCaptcha
3
- VERSION = "0.5.1".freeze
4
+ VERSION = "0.5.2".freeze
4
5
  end
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.1
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-06-29 00:00:00.000000000 Z
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: i@gleb.tv
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/glebtv-simple_captcha.rb
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/generators/simple_captcha_generator.rb
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/controller.rb
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/version.rb
46
+ - lib/simple_captcha/middleware.rb
47
47
  - lib/simple_captcha/model_helpers.rb
48
- - lib/simple_captcha/image.rb
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/middleware.rb
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.0.3
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: []
@@ -1,8 +0,0 @@
1
- require 'test/unit'
2
-
3
- class SimpleCaptchaTest < Test::Unit::TestCase
4
- # Replace this with your real tests.
5
- def test_this_plugin
6
- flunk
7
- end
8
- end