dalli_captcha 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.md +127 -0
  3. data/Rakefile +40 -0
  4. data/app/assets/javascripts/dalli_captcha/application.js +15 -0
  5. data/app/assets/stylesheets/dalli_captcha/application.css +13 -0
  6. data/app/controllers/dalli_captcha/application_controller.rb +4 -0
  7. data/app/controllers/dalli_captcha/captcha_controller.rb +13 -0
  8. data/app/helpers/dalli_captcha/application_helper.rb +4 -0
  9. data/app/views/layouts/dalli_captcha/application.html.erb +14 -0
  10. data/config/routes.rb +3 -0
  11. data/lib/dalli_captcha/controller.rb +14 -0
  12. data/lib/dalli_captcha/engine.rb +5 -0
  13. data/lib/dalli_captcha/image.rb +94 -0
  14. data/lib/dalli_captcha/key_handler.rb +41 -0
  15. data/lib/dalli_captcha/model.rb +45 -0
  16. data/lib/dalli_captcha/version.rb +3 -0
  17. data/lib/dalli_captcha.rb +120 -0
  18. data/lib/generators/install_generator.rb +21 -0
  19. data/lib/generators/templates/README +29 -0
  20. data/lib/generators/templates/dalli_captcha.rb +73 -0
  21. data/lib/tasks/dalli_captcha_tasks.rake +4 -0
  22. data/test/dalli_captcha_test.rb +7 -0
  23. data/test/dummy/README.rdoc +261 -0
  24. data/test/dummy/Rakefile +7 -0
  25. data/test/dummy/app/assets/javascripts/application.js +15 -0
  26. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  27. data/test/dummy/app/controllers/application_controller.rb +3 -0
  28. data/test/dummy/app/helpers/application_helper.rb +2 -0
  29. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  30. data/test/dummy/config/application.rb +64 -0
  31. data/test/dummy/config/boot.rb +10 -0
  32. data/test/dummy/config/database.yml +25 -0
  33. data/test/dummy/config/environment.rb +5 -0
  34. data/test/dummy/config/environments/development.rb +37 -0
  35. data/test/dummy/config/environments/production.rb +67 -0
  36. data/test/dummy/config/environments/test.rb +37 -0
  37. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  38. data/test/dummy/config/initializers/inflections.rb +15 -0
  39. data/test/dummy/config/initializers/mime_types.rb +5 -0
  40. data/test/dummy/config/initializers/secret_token.rb +7 -0
  41. data/test/dummy/config/initializers/session_store.rb +8 -0
  42. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  43. data/test/dummy/config/locales/en.yml +5 -0
  44. data/test/dummy/config/routes.rb +4 -0
  45. data/test/dummy/config.ru +4 -0
  46. data/test/dummy/public/404.html +26 -0
  47. data/test/dummy/public/422.html +26 -0
  48. data/test/dummy/public/500.html +25 -0
  49. data/test/dummy/public/favicon.ico +0 -0
  50. data/test/dummy/script/rails +6 -0
  51. data/test/integration/navigation_test.rb +10 -0
  52. data/test/test_helper.rb +15 -0
  53. metadata +192 -0
@@ -0,0 +1,15 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format
4
+ # (all these examples are active by default):
5
+ # ActiveSupport::Inflector.inflections do |inflect|
6
+ # inflect.plural /^(ox)$/i, '\1en'
7
+ # inflect.singular /^(ox)en/i, '\1'
8
+ # inflect.irregular 'person', 'people'
9
+ # inflect.uncountable %w( fish sheep )
10
+ # end
11
+ #
12
+ # These inflection rules are supported but not enabled by default:
13
+ # ActiveSupport::Inflector.inflections do |inflect|
14
+ # inflect.acronym 'RESTful'
15
+ # end
@@ -0,0 +1,5 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
5
+ # Mime::Type.register_alias "text/html", :iphone
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+ # Make sure the secret is at least 30 characters and all random,
6
+ # no regular words or you'll be exposed to dictionary attacks.
7
+ Dummy::Application.config.secret_token = '9b76e524eec64b886ea6197529db93d0ae10451004d8c344d67394826cbf0282fd6b15f30e719fbe7e2166e6441ed421ed3d78767ffddd3b545622a946a7cc68'
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Dummy::Application.config.session_store :cookie_store, :key => '_dummy_session'
4
+
5
+ # Use the database for sessions instead of the cookie-based default,
6
+ # which shouldn't be used to store highly confidential information
7
+ # (create the session table with "rails generate session_migration")
8
+ # Dummy::Application.config.session_store :active_record_store
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+ #
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters :format => [:json]
9
+ end
10
+
11
+ # Disable root element in JSON by default.
12
+ ActiveSupport.on_load(:active_record) do
13
+ self.include_root_in_json = false
14
+ end
@@ -0,0 +1,5 @@
1
+ # Sample localization file for English. Add more files in this directory for other locales.
2
+ # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
+
4
+ en:
5
+ hello: "Hello world"
@@ -0,0 +1,4 @@
1
+ Rails.application.routes.draw do
2
+
3
+ mount DalliCaptcha::Engine => "/dalli_captcha"
4
+ end
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Dummy::Application
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/404.html -->
21
+ <div class="dialog">
22
+ <h1>The page you were looking for doesn't exist.</h1>
23
+ <p>You may have mistyped the address or the page may have moved.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/422.html -->
21
+ <div class="dialog">
22
+ <h1>The change you wanted was rejected.</h1>
23
+ <p>Maybe you tried to change something you didn't have access to.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,25 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/500.html -->
21
+ <div class="dialog">
22
+ <h1>We're sorry, but something went wrong.</h1>
23
+ </div>
24
+ </body>
25
+ </html>
File without changes
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
+
4
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
5
+ require File.expand_path('../../config/boot', __FILE__)
6
+ require 'rails/commands'
@@ -0,0 +1,10 @@
1
+ require 'test_helper'
2
+
3
+ class NavigationTest < ActionDispatch::IntegrationTest
4
+ fixtures :all
5
+
6
+ # test "the truth" do
7
+ # assert true
8
+ # end
9
+ end
10
+
@@ -0,0 +1,15 @@
1
+ # Configure Rails Environment
2
+ ENV["RAILS_ENV"] = "test"
3
+
4
+ require File.expand_path("../dummy/config/environment.rb", __FILE__)
5
+ require "rails/test_help"
6
+
7
+ Rails.backtrace_cleaner.remove_silencers!
8
+
9
+ # Load support files
10
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
11
+
12
+ # Load fixtures from the engine
13
+ if ActiveSupport::TestCase.method_defined?(:fixture_path=)
14
+ ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
15
+ end
metadata ADDED
@@ -0,0 +1,192 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: dalli_captcha
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - javy_liu
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2013-11-25 00:00:00 +08:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: rails
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ hash: 3
30
+ segments:
31
+ - 3
32
+ - 2
33
+ - 6
34
+ version: 3.2.6
35
+ type: :runtime
36
+ version_requirements: *id001
37
+ - !ruby/object:Gem::Dependency
38
+ name: dalli
39
+ prerelease: false
40
+ requirement: &id002 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ hash: 3
46
+ segments:
47
+ - 0
48
+ version: "0"
49
+ type: :runtime
50
+ version_requirements: *id002
51
+ - !ruby/object:Gem::Dependency
52
+ name: uuid
53
+ prerelease: false
54
+ requirement: &id003 !ruby/object:Gem::Requirement
55
+ none: false
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ hash: 3
60
+ segments:
61
+ - 0
62
+ version: "0"
63
+ type: :runtime
64
+ version_requirements: *id003
65
+ description: generate captcha by dalli,use the memcache
66
+ email:
67
+ - javy_liu@163.com
68
+ executables: []
69
+
70
+ extensions: []
71
+
72
+ extra_rdoc_files: []
73
+
74
+ files:
75
+ - app/views/layouts/dalli_captcha/application.html.erb
76
+ - app/assets/javascripts/dalli_captcha/application.js
77
+ - app/assets/stylesheets/dalli_captcha/application.css
78
+ - app/controllers/dalli_captcha/captcha_controller.rb
79
+ - app/controllers/dalli_captcha/application_controller.rb
80
+ - app/helpers/dalli_captcha/application_helper.rb
81
+ - config/routes.rb
82
+ - lib/dalli_captcha.rb
83
+ - lib/generators/templates/README
84
+ - lib/generators/templates/dalli_captcha.rb
85
+ - lib/generators/install_generator.rb
86
+ - lib/dalli_captcha/model.rb
87
+ - lib/dalli_captcha/engine.rb
88
+ - lib/dalli_captcha/key_handler.rb
89
+ - lib/dalli_captcha/image.rb
90
+ - lib/dalli_captcha/version.rb
91
+ - lib/dalli_captcha/controller.rb
92
+ - lib/tasks/dalli_captcha_tasks.rake
93
+ - MIT-LICENSE
94
+ - Rakefile
95
+ - README.md
96
+ - test/test_helper.rb
97
+ - test/dummy/app/views/layouts/application.html.erb
98
+ - test/dummy/app/assets/javascripts/application.js
99
+ - test/dummy/app/assets/stylesheets/application.css
100
+ - test/dummy/app/controllers/application_controller.rb
101
+ - test/dummy/app/helpers/application_helper.rb
102
+ - test/dummy/public/favicon.ico
103
+ - test/dummy/public/404.html
104
+ - test/dummy/public/422.html
105
+ - test/dummy/public/500.html
106
+ - test/dummy/README.rdoc
107
+ - test/dummy/Rakefile
108
+ - test/dummy/config/environments/development.rb
109
+ - test/dummy/config/environments/test.rb
110
+ - test/dummy/config/environments/production.rb
111
+ - test/dummy/config/initializers/wrap_parameters.rb
112
+ - test/dummy/config/initializers/inflections.rb
113
+ - test/dummy/config/initializers/secret_token.rb
114
+ - test/dummy/config/initializers/mime_types.rb
115
+ - test/dummy/config/initializers/session_store.rb
116
+ - test/dummy/config/initializers/backtrace_silencers.rb
117
+ - test/dummy/config/application.rb
118
+ - test/dummy/config/routes.rb
119
+ - test/dummy/config/environment.rb
120
+ - test/dummy/config/boot.rb
121
+ - test/dummy/config/database.yml
122
+ - test/dummy/config/locales/en.yml
123
+ - test/dummy/script/rails
124
+ - test/dummy/config.ru
125
+ - test/dalli_captcha_test.rb
126
+ - test/integration/navigation_test.rb
127
+ has_rdoc: true
128
+ homepage: http://hi.baidu.com/javyquan
129
+ licenses: []
130
+
131
+ post_install_message:
132
+ rdoc_options: []
133
+
134
+ require_paths:
135
+ - lib
136
+ required_ruby_version: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ">="
140
+ - !ruby/object:Gem::Version
141
+ hash: 3
142
+ segments:
143
+ - 0
144
+ version: "0"
145
+ required_rubygems_version: !ruby/object:Gem::Requirement
146
+ none: false
147
+ requirements:
148
+ - - ">="
149
+ - !ruby/object:Gem::Version
150
+ hash: 3
151
+ segments:
152
+ - 0
153
+ version: "0"
154
+ requirements: []
155
+
156
+ rubyforge_project:
157
+ rubygems_version: 1.4.2
158
+ signing_key:
159
+ specification_version: 3
160
+ summary: generate captcha by dalli
161
+ test_files:
162
+ - test/test_helper.rb
163
+ - test/dummy/app/views/layouts/application.html.erb
164
+ - test/dummy/app/assets/javascripts/application.js
165
+ - test/dummy/app/assets/stylesheets/application.css
166
+ - test/dummy/app/controllers/application_controller.rb
167
+ - test/dummy/app/helpers/application_helper.rb
168
+ - test/dummy/public/favicon.ico
169
+ - test/dummy/public/404.html
170
+ - test/dummy/public/422.html
171
+ - test/dummy/public/500.html
172
+ - test/dummy/README.rdoc
173
+ - test/dummy/Rakefile
174
+ - test/dummy/config/environments/development.rb
175
+ - test/dummy/config/environments/test.rb
176
+ - test/dummy/config/environments/production.rb
177
+ - test/dummy/config/initializers/wrap_parameters.rb
178
+ - test/dummy/config/initializers/inflections.rb
179
+ - test/dummy/config/initializers/secret_token.rb
180
+ - test/dummy/config/initializers/mime_types.rb
181
+ - test/dummy/config/initializers/session_store.rb
182
+ - test/dummy/config/initializers/backtrace_silencers.rb
183
+ - test/dummy/config/application.rb
184
+ - test/dummy/config/routes.rb
185
+ - test/dummy/config/environment.rb
186
+ - test/dummy/config/boot.rb
187
+ - test/dummy/config/database.yml
188
+ - test/dummy/config/locales/en.yml
189
+ - test/dummy/script/rails
190
+ - test/dummy/config.ru
191
+ - test/dalli_captcha_test.rb
192
+ - test/integration/navigation_test.rb