edge-captcha 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +20 -0
- data/README.rdoc +3 -0
- data/Rakefile +27 -0
- data/app/assets/javascripts/edge_captcha/application.js +15 -0
- data/app/assets/stylesheets/edge_captcha/application.css +13 -0
- data/app/controllers/edge_captcha/application_controller.rb +4 -0
- data/app/helpers/edge_captcha/application_helper.rb +4 -0
- data/app/views/edge_captcha/_recaptcha.html.erb +14 -0
- data/config/routes.rb +2 -0
- data/lib/edge-captcha/engine.rb +17 -0
- data/lib/edge-captcha/version.rb +3 -0
- data/lib/edge-captcha.rb +4 -0
- data/lib/tasks/edge-captcha_tasks.rake +4 -0
- metadata +69 -0
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2012 YOURNAME
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
begin
|
3
|
+
require 'bundler/setup'
|
4
|
+
rescue LoadError
|
5
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
6
|
+
end
|
7
|
+
begin
|
8
|
+
require 'rdoc/task'
|
9
|
+
rescue LoadError
|
10
|
+
require 'rdoc/rdoc'
|
11
|
+
require 'rake/rdoctask'
|
12
|
+
RDoc::Task = Rake::RDocTask
|
13
|
+
end
|
14
|
+
|
15
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
16
|
+
rdoc.rdoc_dir = 'rdoc'
|
17
|
+
rdoc.title = 'EdgeCaptcha'
|
18
|
+
rdoc.options << '--line-numbers'
|
19
|
+
rdoc.rdoc_files.include('README.rdoc')
|
20
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
21
|
+
end
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
Bundler::GemHelper.install_tasks
|
27
|
+
|
@@ -0,0 +1,15 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
+
// listed below.
|
3
|
+
//
|
4
|
+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
+
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
|
6
|
+
//
|
7
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
+
// the compiled file.
|
9
|
+
//
|
10
|
+
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
|
11
|
+
// GO AFTER THE REQUIRES BELOW.
|
12
|
+
//
|
13
|
+
//= require jquery
|
14
|
+
//= require jquery_ujs
|
15
|
+
//= require_tree .
|
@@ -0,0 +1,13 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the top of the
|
9
|
+
* compiled file, but it's generally better to create a new file per style scope.
|
10
|
+
*
|
11
|
+
*= require_self
|
12
|
+
*= require_tree .
|
13
|
+
*/
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<% if EdgeCaptcha::Engine.config.recaptcha[:enable] %>
|
2
|
+
<!-- this is for recaptcha -->
|
3
|
+
<script>
|
4
|
+
var RecaptchaOptions = {
|
5
|
+
theme : 'white'
|
6
|
+
};
|
7
|
+
</script>
|
8
|
+
<%= javascript_include_tag "http://www.google.com/recaptcha/api/challenge?k=#{EdgeCaptcha::Engine.config.recaptcha[:public_key]}" %>
|
9
|
+
<noscript>
|
10
|
+
<iframe src="http://www.google.com/recaptcha/api/noscript?k=6Len6sISAAAAAFjJaGLIU7IxEEheifrB8HY2AQj7#{EdgeCaptcha::Engine.config.recaptcha[:public_key]}" height="300" width="500" frameborder="0"></iframe>
|
11
|
+
<textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
|
12
|
+
<input type="hidden" name="recaptcha_response_field" value="manual_challenge">
|
13
|
+
</noscript>
|
14
|
+
<% end %>
|
data/config/routes.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
module EdgeCaptcha
|
2
|
+
class Engine < ::Rails::Engine
|
3
|
+
isolate_namespace EdgeCaptcha
|
4
|
+
config.generators do |g|
|
5
|
+
g.test_framework :rspec
|
6
|
+
g.fixture_replacement :factory_girl
|
7
|
+
g.orm :mongoid
|
8
|
+
end
|
9
|
+
|
10
|
+
config.recaptcha = {}
|
11
|
+
config.recaptcha[:enable] = true
|
12
|
+
config.recaptcha[:private_key] = '6Len6sISAAAAAOnvKTBhB-qav8UHClxqP2RAuIHE'
|
13
|
+
config.recaptcha[:public_key] = '6Len6sISAAAAAFjJaGLIU7IxEEheifrB8HY2AQj7'
|
14
|
+
config.recaptcha[:api_server_url] = "http://www.google.com/recaptcha/api/verify"
|
15
|
+
config.recaptcha[:ssl_api_service_url] = "https://www.google.com/recaptcha/api/verify"
|
16
|
+
end
|
17
|
+
end
|
data/lib/edge-captcha.rb
ADDED
metadata
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: edge-captcha
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Dan Persa
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-02-23 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rails
|
16
|
+
requirement: &14189780 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 3.2.1
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *14189780
|
25
|
+
description: Rails mountable engine, that provides captcha support
|
26
|
+
email:
|
27
|
+
- dan.persa@gmail.com
|
28
|
+
executables: []
|
29
|
+
extensions: []
|
30
|
+
extra_rdoc_files: []
|
31
|
+
files:
|
32
|
+
- app/helpers/edge_captcha/application_helper.rb
|
33
|
+
- app/controllers/edge_captcha/application_controller.rb
|
34
|
+
- app/views/edge_captcha/_recaptcha.html.erb
|
35
|
+
- app/assets/stylesheets/edge_captcha/application.css
|
36
|
+
- app/assets/javascripts/edge_captcha/application.js
|
37
|
+
- config/routes.rb
|
38
|
+
- lib/edge-captcha.rb
|
39
|
+
- lib/edge-captcha/engine.rb
|
40
|
+
- lib/edge-captcha/version.rb
|
41
|
+
- lib/tasks/edge-captcha_tasks.rake
|
42
|
+
- MIT-LICENSE
|
43
|
+
- Rakefile
|
44
|
+
- README.rdoc
|
45
|
+
homepage: https://github.com/danpersa/edge-captcha
|
46
|
+
licenses: []
|
47
|
+
post_install_message:
|
48
|
+
rdoc_options: []
|
49
|
+
require_paths:
|
50
|
+
- lib
|
51
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
52
|
+
none: false
|
53
|
+
requirements:
|
54
|
+
- - ! '>='
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: '0'
|
57
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - ! '>='
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
requirements: []
|
64
|
+
rubyforge_project:
|
65
|
+
rubygems_version: 1.8.15
|
66
|
+
signing_key:
|
67
|
+
specification_version: 3
|
68
|
+
summary: Rails mountable engine, that provides captcha support
|
69
|
+
test_files: []
|