antage-merb-recaptcha 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. data/LICENSE +20 -0
  2. data/README.textile +45 -0
  3. data/Rakefile +66 -0
  4. data/TODO +1 -0
  5. data/lib/merb-recaptcha/controller_mixin.rb +29 -0
  6. data/lib/merb-recaptcha/exceptions.rb +10 -0
  7. data/lib/merb-recaptcha/merbtasks.rb +0 -0
  8. data/lib/merb-recaptcha/view_helpers.rb +72 -0
  9. data/lib/merb-recaptcha.rb +28 -0
  10. data/merb-recaptcha.gemspec +38 -0
  11. data/spec/fixture/app/controllers/application.rb +2 -0
  12. data/spec/fixture/app/controllers/exceptions.rb +13 -0
  13. data/spec/fixture/app/controllers/recaptcha.rb +29 -0
  14. data/spec/fixture/app/helpers/global_helpers.rb +5 -0
  15. data/spec/fixture/app/helpers/recaptcha_helpers.rb +4 -0
  16. data/spec/fixture/app/views/exceptions/not_acceptable.html.erb +63 -0
  17. data/spec/fixture/app/views/exceptions/not_found.html.erb +47 -0
  18. data/spec/fixture/app/views/layout/application.html.erb +10 -0
  19. data/spec/fixture/app/views/recaptcha/ajax.html.erb +2 -0
  20. data/spec/fixture/app/views/recaptcha/ajax_with_callback.html.erb +2 -0
  21. data/spec/fixture/app/views/recaptcha/ajax_with_jquery.html.erb +2 -0
  22. data/spec/fixture/app/views/recaptcha/ajax_with_options.html.erb +2 -0
  23. data/spec/fixture/app/views/recaptcha/noajax_with_noscript.html.erb +1 -0
  24. data/spec/fixture/app/views/recaptcha/noajax_with_options.html.erb +1 -0
  25. data/spec/fixture/app/views/recaptcha/noajax_without_noscript.html.erb +1 -0
  26. data/spec/recaptcha_ajax_spec.rb +39 -0
  27. data/spec/recaptcha_ajax_with_callback_spec.rb +35 -0
  28. data/spec/recaptcha_ajax_with_jquery_spec.rb +39 -0
  29. data/spec/recaptcha_ajax_with_options_spec.rb +35 -0
  30. data/spec/recaptcha_noajax_with_noscript_spec.rb +59 -0
  31. data/spec/recaptcha_noajax_with_options_spec.rb +39 -0
  32. data/spec/recaptcha_noajax_without_noscript_spec.rb +39 -0
  33. data/spec/recaptcha_valid_spec.rb +97 -0
  34. data/spec/spec_helper.rb +43 -0
  35. metadata +137 -0
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2008 Anton Ageev
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.textile ADDED
@@ -0,0 +1,45 @@
1
+ h1. merb-recaptcha
2
+
3
+ h2. About
4
+
5
+ Merb-recaptcha is plugin for "Merb":http://github.com/wycats/merb web-framework. It provides view and controller helpers for "Recaptcha":http://recaptcha.net service.
6
+
7
+ h2. Installation
8
+
9
+ Install gem from github.com:
10
+ <pre><code>gem install antage-merb-recaptcha --source=http://gems.github.com</code></pre>
11
+
12
+ Add following line in <tt>config/dependencies.rb</tt> of your web application:
13
+ <pre><code>dependency "antage-merb-recaptcha", "~> 1.0.0", :require_as => "merb-recaptcha"</code></pre>
14
+
15
+ Sign up at "Recaptcha":http://recaptcha.net and get public and private keys. Add keys in <tt>config/init.rb</tt>:
16
+ <pre><code>Merb::BootLoader.after_app_loads do
17
+ Merb::Plugins.config[:merb_recaptcha][:public_key] = "... here your public key ..."
18
+ Merb::Plugins.config[:merb_recaptcha][:private_key] = "... here your private key ..."
19
+ end</code></pre>
20
+
21
+ h2. Usage
22
+
23
+ Just add helper in your form:
24
+ <pre><code><%= form_for @users, :action => resource(:users), :method => :post do %>
25
+ .....
26
+ <%= recaptcha_tags %>
27
+ <%= submit "Send" %>
28
+ <% end %></code></pre>
29
+
30
+ And then check captcha in controller:
31
+ <pre><code>class Users < Application
32
+ ......
33
+ def create(user)
34
+ @user = User.new(user)
35
+ if (captcha_correct = recaptcha_valid?) && @user.save
36
+ redirect resource(@user)
37
+ else
38
+ unless captcha_correct
39
+ @user.valid?
40
+ @user.errors.add(:general, "Captcha code is incorrect")
41
+ end
42
+ render :new
43
+ end
44
+ ......
45
+ end</code></pre>
data/Rakefile ADDED
@@ -0,0 +1,66 @@
1
+ require 'rubygems'
2
+ require 'rake/gempackagetask'
3
+ require 'rake/clean'
4
+
5
+ require 'spec/rake/spectask'
6
+
7
+ require 'merb-core'
8
+ require 'merb-core/tasks/merb'
9
+
10
+ GEM_NAME = "merb-recaptcha"
11
+ GEM_VERSION = "1.0.0"
12
+ AUTHOR = "Anton Ageev"
13
+ EMAIL = "antage@gmail.com"
14
+ HOMEPAGE = "http://github.com/antage/merb-recaptcha/"
15
+ SUMMARY = "Merb plugin that provides helpers for recaptcha.net service"
16
+
17
+ spec = Gem::Specification.new do |s|
18
+ s.rubyforge_project = 'merb-recaptcha'
19
+ s.name = GEM_NAME
20
+ s.version = GEM_VERSION
21
+ s.platform = Gem::Platform::RUBY
22
+ s.has_rdoc = true
23
+ s.extra_rdoc_files = ["README.textile", "LICENSE", 'TODO']
24
+ s.summary = SUMMARY
25
+ s.description = s.summary
26
+ s.author = AUTHOR
27
+ s.email = EMAIL
28
+ s.homepage = HOMEPAGE
29
+ s.require_path = 'lib'
30
+ s.files = %w(LICENSE README.textile Rakefile TODO merb-recaptcha.gemspec) + Dir["lib/**/*"].select { |f| File.file?(f) }
31
+ s.test_files = %w(spec/spec_helper.rb) + Dir["spec/*_spec.rb"] + Dir["spec/fixture/app/**/*"].select { |f| File.file?(f) }
32
+
33
+ s.add_runtime_dependency "merb-core", ">= 1.0.0"
34
+ s.add_runtime_dependency "builder", "~> 2.0"
35
+ s.add_development_dependency "rspec", ">= 1.1.0"
36
+ end
37
+
38
+ Rake::GemPackageTask.new(spec) do |pkg|
39
+ pkg.gem_spec = spec
40
+ end
41
+
42
+ desc "install the plugin as a gem"
43
+ task :install do
44
+ Merb::RakeHelper.install(GEM_NAME, :version => GEM_VERSION)
45
+ end
46
+
47
+ desc "Uninstall the gem"
48
+ task :uninstall do
49
+ Merb::RakeHelper.uninstall(GEM_NAME, :version => GEM_VERSION)
50
+ end
51
+
52
+ desc "Create a gemspec file"
53
+ task :gemspec do
54
+ File.open("#{GEM_NAME}.gemspec", "w") do |file|
55
+ file.puts spec.to_ruby
56
+ end
57
+ end
58
+
59
+ Spec::Rake::SpecTask.new(:spec) do |t|
60
+ t.spec_opts << '--format' << 'specdoc' << '--colour'
61
+ t.spec_opts << '--loadby' << 'random'
62
+ t.spec_files = Pathname.glob(ENV['FILES'] || 'spec/**/*_spec.rb')
63
+ t.rcov = false
64
+ end
65
+
66
+ task :default => :spec
data/TODO ADDED
@@ -0,0 +1 @@
1
+ TODO:
@@ -0,0 +1,29 @@
1
+ require 'net/http'
2
+
3
+ module Merb
4
+ module RecaptchaMixin
5
+ def recaptcha_valid?
6
+ response = Net::HTTP.post_form(URI.parse("http://api-verify.recaptcha.net/verify"), {
7
+ :privatekey => Merb::Plugins.config[:merb_recaptcha][:private_key],
8
+ :remoteip => request.remote_ip,
9
+ :challenge => params[:recaptcha_challenge_field],
10
+ :response => params[:recaptcha_response_field]
11
+ })
12
+ answer, error = response.body.split.map { |s| s.chomp }
13
+ if answer == "true"
14
+ true
15
+ else
16
+ case error
17
+ when "incorrect-captcha-sol" then false
18
+ when "invalid-site-public-key" then raise Merb::Recaptcha::InvalidSitePublicKey
19
+ when "invalid-site-private-key" then raise Merb::Recaptcha::InvalidSitePrivateKey
20
+ when "invalid-request-cookie" then raise Merb::Recaptcha::InvalidRequestCookie
21
+ when "verify-params-incorrect" then raise Merb::Recaptcha::VerifyParamsIncorrect
22
+ when "invalid-referrer" then raise Merb::Recaptcha::InvalidReferrer
23
+ else
24
+ raise Merb::Recaptcha::GenericError
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,10 @@
1
+ module Merb
2
+ module Recaptcha
3
+ class GenericError < RuntimeError; end
4
+ class InvalidSitePublicKey < GenericError; end
5
+ class InvalidSitePrivateKey < GenericError; end
6
+ class InvalidRequestCookie < GenericError; end
7
+ class VerifyParamsIncorrect < GenericError; end
8
+ class InvalidReferrer < GenericError; end
9
+ end
10
+ end
File without changes
@@ -0,0 +1,72 @@
1
+ require 'builder'
2
+
3
+ module Merb
4
+ module Helpers
5
+ module Recaptcha
6
+ API_SERVER = "http://api.recaptcha.net"
7
+ API_SECURE_SERVER = "https://api-secure.recaptcha.net"
8
+
9
+ def recaptcha_tags(options = {})
10
+ public_key = Merb::Plugins.config[:merb_recaptcha][:public_key]
11
+
12
+ ajax = options.delete(:ajax) || false # boolean or :jquery
13
+ element_id = options.delete(:element_id) || "recaptcha" # string, html element id, only if ajax == true
14
+ callback = options.delete(:callback) # string, javascript function name, only if ajax == true
15
+ noscript = options.delete(:noscript) || false # boolean
16
+ iframe_height = options.delete(:iframe_height) || 300 # integer, only if noscript == true
17
+ iframe_width = options.delete(:iframe_width) || 500 # integer, only if noscript == true
18
+
19
+ api_url = if request.ssl?
20
+ API_SECURE_SERVER
21
+ else
22
+ API_SERVER
23
+ end
24
+
25
+ result = ""
26
+ xhtml = Builder::XmlMarkup.new(:target => result, :indent => 2)
27
+ if ajax
28
+ xhtml.script(:type => "text/javascript", :src => "#{api_url}/js/recaptcha_ajax.js") {}
29
+ xhtml.script(:type => "text/javascript") do
30
+ options_and_callback = callback.nil? ? options : options.merge(:callback => callback)
31
+ xhtml.text!("var options = #{hash_to_json(options_and_callback)};\n")
32
+ if ajax == :jquery
33
+ xhtml.text!("$(document).ready(function() { Recaptcha.create('#{public_key}', document.getElementById('#{element_id}'), options); });\n")
34
+ else
35
+ xhtml.text!("window.onload = function() { Recaptcha.create('#{public_key}', document.getElementById('#{element_id}'), options); }\n")
36
+ end
37
+ end
38
+ else
39
+ unless options.empty?
40
+ xhtml.script(:type => "text/javascript") do
41
+ xhtml.text!("var RecaptchaOptions = #{hash_to_json(options)};\n")
42
+ end
43
+ end
44
+ xhtml.script(:type => "text/javascript", :src => "#{api_url}/challenge?k=#{public_key}") {}
45
+ if noscript
46
+ xhtml.noscript do
47
+ xhtml.iframe(:src => "#{api_url}/noscript?k=#{public_key}", :height => iframe_height, :width => iframe_width, :frameborder => 0) {}
48
+ xhtml.br
49
+ xhtml.textarea(:name => "recaptcha_challenge_field", :rows => 3, :cols => 40) {}
50
+ xhtml.input :name => "recaptcha_response_field", :type => "hidden", :value => "manual_challenge"
51
+ end
52
+ end
53
+ end
54
+ result
55
+ end
56
+
57
+ private
58
+
59
+ def hash_to_json(hash)
60
+ result = "{"
61
+ result << hash.map do |k, v|
62
+ if ! v.is_a?(String) || k.to_s == "callback"
63
+ "\"#{k}\": #{v}"
64
+ else
65
+ "\"#{k}\": \"#{v}\""
66
+ end
67
+ end.join(", ")
68
+ result << "}"
69
+ end
70
+ end
71
+ end
72
+ end
@@ -0,0 +1,28 @@
1
+ # make sure we're running inside Merb
2
+ if defined?(Merb::Plugins)
3
+
4
+ # Merb gives you a Merb::Plugins.config hash...feel free to put your stuff in your piece of it
5
+ Merb::Plugins.config[:merb_recaptcha] = {
6
+ :public_key => "",
7
+ :private_key => ""
8
+ }
9
+
10
+ Merb::BootLoader.before_app_loads do
11
+ # require code that must be loaded before the application
12
+ require 'merb-recaptcha/view_helpers.rb'
13
+ require 'merb-recaptcha/exceptions.rb'
14
+ require 'merb-recaptcha/controller_mixin.rb'
15
+ module Merb::GlobalHelpers
16
+ include Merb::Helpers::Recaptcha
17
+ end
18
+ class Merb::Controller
19
+ include Merb::RecaptchaMixin
20
+ end
21
+ end
22
+
23
+ Merb::BootLoader.after_app_loads do
24
+ # code that can be required after the application loads
25
+ end
26
+
27
+ Merb::Plugins.add_rakefiles "merb-recaptcha/merbtasks"
28
+ end
@@ -0,0 +1,38 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = %q{merb-recaptcha}
3
+ s.version = "1.0.0"
4
+
5
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
6
+ s.authors = ["Anton Ageev"]
7
+ s.date = %q{2008-12-10}
8
+ s.description = %q{Merb plugin that provides helpers for recaptcha.net service}
9
+ s.email = %q{antage@gmail.com}
10
+ s.extra_rdoc_files = ["README.textile", "LICENSE", "TODO"]
11
+ s.files = ["LICENSE", "README.textile", "Rakefile", "TODO", "merb-recaptcha.gemspec", "lib/merb-recaptcha.rb", "lib/merb-recaptcha/exceptions.rb", "lib/merb-recaptcha/view_helpers.rb", "lib/merb-recaptcha/controller_mixin.rb", "lib/merb-recaptcha/merbtasks.rb", "spec/spec_helper.rb", "spec/recaptcha_ajax_with_callback_spec.rb", "spec/recaptcha_noajax_with_noscript_spec.rb", "spec/recaptcha_noajax_with_options_spec.rb", "spec/recaptcha_ajax_spec.rb", "spec/recaptcha_ajax_with_jquery_spec.rb", "spec/recaptcha_ajax_with_options_spec.rb", "spec/recaptcha_noajax_without_noscript_spec.rb", "spec/recaptcha_valid_spec.rb", "spec/fixture/app/views/layout/application.html.erb", "spec/fixture/app/views/recaptcha/ajax_with_callback.html.erb", "spec/fixture/app/views/recaptcha/noajax_with_noscript.html.erb", "spec/fixture/app/views/recaptcha/ajax.html.erb", "spec/fixture/app/views/recaptcha/ajax_with_jquery.html.erb", "spec/fixture/app/views/recaptcha/noajax_with_options.html.erb", "spec/fixture/app/views/recaptcha/noajax_without_noscript.html.erb", "spec/fixture/app/views/recaptcha/ajax_with_options.html.erb", "spec/fixture/app/views/exceptions/not_acceptable.html.erb", "spec/fixture/app/views/exceptions/not_found.html.erb", "spec/fixture/app/controllers/exceptions.rb", "spec/fixture/app/controllers/application.rb", "spec/fixture/app/controllers/recaptcha.rb", "spec/fixture/app/helpers/recaptcha_helpers.rb", "spec/fixture/app/helpers/global_helpers.rb"]
12
+ s.has_rdoc = true
13
+ s.homepage = %q{http://github.com/antage/merb-recaptcha/}
14
+ s.require_paths = ["lib"]
15
+ s.rubyforge_project = %q{merb-recaptcha}
16
+ s.rubygems_version = %q{1.2.0}
17
+ s.summary = %q{Merb plugin that provides helpers for recaptcha.net service}
18
+ s.test_files = ["spec/spec_helper.rb", "spec/recaptcha_ajax_with_callback_spec.rb", "spec/recaptcha_noajax_with_noscript_spec.rb", "spec/recaptcha_noajax_with_options_spec.rb", "spec/recaptcha_ajax_spec.rb", "spec/recaptcha_ajax_with_jquery_spec.rb", "spec/recaptcha_ajax_with_options_spec.rb", "spec/recaptcha_noajax_without_noscript_spec.rb", "spec/recaptcha_valid_spec.rb", "spec/fixture/app/views/layout/application.html.erb", "spec/fixture/app/views/recaptcha/ajax_with_callback.html.erb", "spec/fixture/app/views/recaptcha/noajax_with_noscript.html.erb", "spec/fixture/app/views/recaptcha/ajax.html.erb", "spec/fixture/app/views/recaptcha/ajax_with_jquery.html.erb", "spec/fixture/app/views/recaptcha/noajax_with_options.html.erb", "spec/fixture/app/views/recaptcha/noajax_without_noscript.html.erb", "spec/fixture/app/views/recaptcha/ajax_with_options.html.erb", "spec/fixture/app/views/exceptions/not_acceptable.html.erb", "spec/fixture/app/views/exceptions/not_found.html.erb", "spec/fixture/app/controllers/exceptions.rb", "spec/fixture/app/controllers/application.rb", "spec/fixture/app/controllers/recaptcha.rb", "spec/fixture/app/helpers/recaptcha_helpers.rb", "spec/fixture/app/helpers/global_helpers.rb"]
19
+
20
+ if s.respond_to? :specification_version then
21
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
22
+ s.specification_version = 2
23
+
24
+ if current_version >= 3 then
25
+ s.add_runtime_dependency(%q<merb-core>, [">= 1.0.0"])
26
+ s.add_runtime_dependency(%q<builder>, ["~> 2.0"])
27
+ s.add_development_dependency(%q<rspec>, [">= 1.1.0"])
28
+ else
29
+ s.add_dependency(%q<merb-core>, [">= 1.0.0"])
30
+ s.add_dependency(%q<builder>, ["~> 2.0"])
31
+ s.add_dependency(%q<rspec>, [">= 1.1.0"])
32
+ end
33
+ else
34
+ s.add_dependency(%q<merb-core>, [">= 1.0.0"])
35
+ s.add_dependency(%q<builder>, ["~> 2.0"])
36
+ s.add_dependency(%q<rspec>, [">= 1.1.0"])
37
+ end
38
+ end
@@ -0,0 +1,2 @@
1
+ class Application < Merb::Controller
2
+ end
@@ -0,0 +1,13 @@
1
+ class Exceptions < Merb::Controller
2
+
3
+ # handle NotFound exceptions (404)
4
+ def not_found
5
+ render :format => :html
6
+ end
7
+
8
+ # handle NotAcceptable exceptions (406)
9
+ def not_acceptable
10
+ render :format => :html
11
+ end
12
+
13
+ end
@@ -0,0 +1,29 @@
1
+ class Recaptcha < Application
2
+ def ajax
3
+ render
4
+ end
5
+
6
+ def ajax_with_jquery
7
+ render
8
+ end
9
+
10
+ def ajax_with_callback
11
+ render
12
+ end
13
+
14
+ def ajax_with_options
15
+ render
16
+ end
17
+
18
+ def noajax_without_noscript
19
+ render
20
+ end
21
+
22
+ def noajax_with_noscript
23
+ render
24
+ end
25
+
26
+ def noajax_with_options
27
+ render
28
+ end
29
+ end
@@ -0,0 +1,5 @@
1
+ module Merb
2
+ module GlobalHelpers
3
+ # helpers defined here available to all views.
4
+ end
5
+ end
@@ -0,0 +1,4 @@
1
+ module Merb
2
+ module RecaptchaHelper
3
+ end
4
+ end
@@ -0,0 +1,63 @@
1
+ <div id="container">
2
+ <div id="header-container">
3
+ <img src="/images/merb.jpg" />
4
+ <!-- <h1>Mongrel + Erb</h1> -->
5
+ <h2>pocket rocket web framework</h2>
6
+ <hr />
7
+ </div>
8
+
9
+ <div id="left-container">
10
+ <h3>Exception:</h3>
11
+ <p><%= request.exceptions.first.message %></p>
12
+ </div>
13
+
14
+ <div id="main-container">
15
+ <h3>Why am I seeing this page?</h3>
16
+ <p>Merb couldn't find an appropriate content_type to return,
17
+ based on what you said was available via provides() and
18
+ what the client requested.</p>
19
+
20
+ <h3>How to add a mime-type</h3>
21
+ <pre><code>
22
+ Merb.add_mime_type :pdf, :to_pdf, %w[application/pdf], &quot;Content-Encoding&quot; =&gt; &quot;gzip&quot;
23
+ </code></pre>
24
+ <h3>What this means is:</h3>
25
+ <ul>
26
+ <li>Add a mime-type for :pdf</li>
27
+ <li>Register the method for converting objects to PDF as <code>#to_pdf</code>.</li>
28
+ <li>Register the incoming mime-type "Accept" header as <code>application/pdf</code>.</li>
29
+ <li>Specify a new header for PDF types so it will set <code>Content-Encoding</code> to gzip.</li>
30
+ </ul>
31
+
32
+ <h3>You can then do:</h3>
33
+ <pre><code>
34
+ class Foo &lt; Application
35
+ provides :pdf
36
+ end
37
+ </code></pre>
38
+
39
+ <h3>Where can I find help?</h3>
40
+ <p>If you have any questions or if you can't figure something out, please take a
41
+ look at our <a href="http://merbivore.com/"> project page</a>,
42
+ feel free to come chat at irc.freenode.net, channel #merb,
43
+ or post to <a href="http://groups.google.com/group/merb">merb mailing list</a>
44
+ on Google Groups.</p>
45
+
46
+ <h3>What if I've found a bug?</h3>
47
+ <p>If you want to file a bug or make your own contribution to Merb,
48
+ feel free to register and create a ticket at our
49
+ <a href="http://merb.lighthouseapp.com/">project development page</a>
50
+ on Lighthouse.</p>
51
+
52
+ <h3>How do I edit this page?</h3>
53
+ <p>You can change what people see when this happens by editing <tt>app/views/exceptions/not_acceptable.html.erb</tt>.</p>
54
+
55
+ </div>
56
+
57
+ <div id="footer-container">
58
+ <hr />
59
+ <div class="left"></div>
60
+ <div class="right">&copy; 2008 the merb dev team</div>
61
+ <p>&nbsp;</p>
62
+ </div>
63
+ </div>
@@ -0,0 +1,47 @@
1
+ <div id="container">
2
+ <div id="header-container">
3
+ <img src="/images/merb.jpg" />
4
+ <!-- <h1>Mongrel + Erb</h1> -->
5
+ <h2>pocket rocket web framework</h2>
6
+ <hr />
7
+ </div>
8
+
9
+ <div id="left-container">
10
+ <h3>Exception:</h3>
11
+ <p><%= request.exceptions.first.message %></p>
12
+ </div>
13
+
14
+ <div id="main-container">
15
+ <h3>Welcome to Merb!</h3>
16
+ <p>Merb is a light-weight MVC framework written in Ruby. We hope you enjoy it.</p>
17
+
18
+ <h3>Where can I find help?</h3>
19
+ <p>If you have any questions or if you can't figure something out, please take a
20
+ look at our <a href="http://merbivore.com/"> project page</a>,
21
+ feel free to come chat at irc.freenode.net, channel #merb,
22
+ or post to <a href="http://groups.google.com/group/merb">merb mailing list</a>
23
+ on Google Groups.</p>
24
+
25
+ <h3>What if I've found a bug?</h3>
26
+ <p>If you want to file a bug or make your own contribution to Merb,
27
+ feel free to register and create a ticket at our
28
+ <a href="http://merb.lighthouseapp.com/">project development page</a>
29
+ on Lighthouse.</p>
30
+
31
+ <h3>How do I edit this page?</h3>
32
+ <p>You're seeing this page because you need to edit the following files:
33
+ <ul>
34
+ <li>config/router.rb <strong><em>(recommended)</em></strong></li>
35
+ <li>app/views/exceptions/not_found.html.erb <strong><em>(recommended)</em></strong></li>
36
+ <li>app/views/layout/application.html.erb <strong><em>(change this layout)</em></strong></li>
37
+ </ul>
38
+ </p>
39
+ </div>
40
+
41
+ <div id="footer-container">
42
+ <hr />
43
+ <div class="left"></div>
44
+ <div class="right">&copy; 2008 the merb dev team</div>
45
+ <p>&nbsp;</p>
46
+ </div>
47
+ </div>
@@ -0,0 +1,10 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us" lang="en-us">
3
+ <head>
4
+ <title>Fresh Merb App</title>
5
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6
+ </head>
7
+ <body>
8
+ <%= catch_content :for_layout %>
9
+ </body>
10
+ </html>
@@ -0,0 +1,2 @@
1
+ <%= recaptcha_tags :ajax => true, :element_id => "recaptcha_without_callback" %>
2
+ <div id="recaptcha_without_callback"></div>
@@ -0,0 +1,2 @@
1
+ <%= recaptcha_tags :ajax => true, :element_id => "recaptcha_with_callback", :callback => "test_callback" %>
2
+ <div id="recaptcha_with_callback"></div>
@@ -0,0 +1,2 @@
1
+ <%= recaptcha_tags :ajax => :jquery, :element_id => "recaptcha_without_callback" %>
2
+ <div id="recaptcha_without_callback"></div>
@@ -0,0 +1,2 @@
1
+ <%= recaptcha_tags :ajax => true, :element_id => "recaptcha_without_callback", :theme => "clean", :tabindex => 2 %>
2
+ <div id="recaptcha_without_callback"></div>
@@ -0,0 +1 @@
1
+ <%= recaptcha_tags :ajax => false, :noscript => true, :iframe_height => 250, :iframe_width => 250 %>
@@ -0,0 +1 @@
1
+ <%= recaptcha_tags :ajax => false, :noscript => false, :theme => "clean", :tabindex => 2 %>
@@ -0,0 +1 @@
1
+ <%= recaptcha_tags :ajax => false, :noscript => false %>
@@ -0,0 +1,39 @@
1
+ require File.dirname(__FILE__) + '/spec_helper'
2
+
3
+ describe "Recaptcha#ajax" do
4
+ describe "HTTP" do
5
+ before(:each) do
6
+ @response = dispatch_to(Recaptcha, "ajax")
7
+ end
8
+
9
+ it "should load script from api url" do
10
+ @response.should have_xpath("//script[@src='http://api.recaptcha.net/js/recaptcha_ajax.js']")
11
+ end
12
+
13
+ it "should invoke Recaptcha.create using onload event" do
14
+ @response.should have_xpath("//script[contains(., 'window.onload = function() { Recaptcha.create')]")
15
+ end
16
+
17
+ it "should send element_id ('recaptcha_without_callback')" do
18
+ @response.should have_xpath("//script[contains(., 'Recaptcha.create') and contains(., \"getElementById('recaptcha_without_callback')\")]")
19
+ end
20
+
21
+ it "should create empty options array" do
22
+ @response.should have_xpath("//script[contains(., 'Recaptcha.create') and contains(., 'var options = {};')]")
23
+ end
24
+
25
+ it_should_behave_like "ajax recaptcha"
26
+ end
27
+
28
+ describe "HTTPS" do
29
+ before(:each) do
30
+ @response = dispatch_to(Recaptcha, "ajax", {}, { "HTTPS" => "on" })
31
+ end
32
+
33
+ it "should load script from secure api url" do
34
+ @response.should have_xpath("//script[@src='https://api-secure.recaptcha.net/js/recaptcha_ajax.js']")
35
+ end
36
+
37
+ it_should_behave_like "ajax recaptcha"
38
+ end
39
+ end
@@ -0,0 +1,35 @@
1
+ require File.dirname(__FILE__) + '/spec_helper'
2
+
3
+ describe "Recaptcha#ajax_with_callback" do
4
+ describe "HTTP" do
5
+ before(:each) do
6
+ @response = dispatch_to(Recaptcha, "ajax_with_callback")
7
+ end
8
+
9
+ it "should load script from api url" do
10
+ @response.should have_xpath("//script[@src='http://api.recaptcha.net/js/recaptcha_ajax.js']")
11
+ end
12
+
13
+ it "should send element_id ('recaptcha_with_callback')" do
14
+ @response.should have_xpath("//script[contains(., 'Recaptcha.create') and contains(., \"getElementById('recaptcha_with_callback')\")]")
15
+ end
16
+
17
+ it "should create options array containing callback value ('test_callback')" do
18
+ @response.should have_xpath("//script[contains(., 'Recaptcha.create') and contains(., 'var options = {\"callback\": test_callback};')]")
19
+ end
20
+
21
+ it_should_behave_like "ajax recaptcha"
22
+ end
23
+
24
+ describe "HTTPS" do
25
+ before(:each) do
26
+ @response = dispatch_to(Recaptcha, "ajax_with_callback", {}, { "HTTPS" => "on" })
27
+ end
28
+
29
+ it "should load script from secure api url" do
30
+ @response.should have_xpath("//script[@src='https://api-secure.recaptcha.net/js/recaptcha_ajax.js']")
31
+ end
32
+
33
+ it_should_behave_like "ajax recaptcha"
34
+ end
35
+ end
@@ -0,0 +1,39 @@
1
+ require File.dirname(__FILE__) + '/spec_helper'
2
+
3
+ describe "Recaptcha#ajax_with_jquery" do
4
+ describe "HTTP" do
5
+ before(:each) do
6
+ @response = dispatch_to(Recaptcha, "ajax_with_jquery")
7
+ end
8
+
9
+ it "should load script from api url" do
10
+ @response.should have_xpath("//script[@src='http://api.recaptcha.net/js/recaptcha_ajax.js']")
11
+ end
12
+
13
+ it "should invoke Recaptcha.create using onload event" do
14
+ @response.should have_xpath("//script[contains(., '$(document).ready(function() { Recaptcha.create')]")
15
+ end
16
+
17
+ it "should send element_id ('recaptcha_without_callback')" do
18
+ @response.should have_xpath("//script[contains(., 'Recaptcha.create') and contains(., \"getElementById('recaptcha_without_callback')\")]")
19
+ end
20
+
21
+ it "should create empty options array" do
22
+ @response.should have_xpath("//script[contains(., 'Recaptcha.create') and contains(., 'var options = {};')]")
23
+ end
24
+
25
+ it_should_behave_like "ajax recaptcha"
26
+ end
27
+
28
+ describe "HTTPS" do
29
+ before(:each) do
30
+ @response = dispatch_to(Recaptcha, "ajax_with_jquery", {}, { "HTTPS" => "on" })
31
+ end
32
+
33
+ it "should load script from secure api url" do
34
+ @response.should have_xpath("//script[@src='https://api-secure.recaptcha.net/js/recaptcha_ajax.js']")
35
+ end
36
+
37
+ it_should_behave_like "ajax recaptcha"
38
+ end
39
+ end
@@ -0,0 +1,35 @@
1
+ require File.dirname(__FILE__) + '/spec_helper'
2
+
3
+ describe "Recaptcha#ajax_with_options" do
4
+ describe "HTTP" do
5
+ before(:each) do
6
+ @response = dispatch_to(Recaptcha, "ajax_with_options")
7
+ end
8
+
9
+ it "should load script from api url" do
10
+ @response.should have_xpath("//script[@src='http://api.recaptcha.net/js/recaptcha_ajax.js']")
11
+ end
12
+
13
+ it "should send element_id ('recaptcha_without_callback')" do
14
+ @response.should have_xpath("//script[contains(., 'Recaptcha.create') and contains(., \"getElementById('recaptcha_without_callback')\")]")
15
+ end
16
+
17
+ it "should create options array containing custom options (theme = 'clean', tabindex = 2)" do
18
+ @response.should have_xpath("//script[contains(., 'Recaptcha.create') and (contains(., 'var options = {\"theme\": \"clean\", \"tabindex\": 2};') or contains(., 'var options = {\"tabindex\": 2, \"theme\": \"clean\"};'))]")
19
+ end
20
+
21
+ it_should_behave_like "ajax recaptcha"
22
+ end
23
+
24
+ describe "HTTPS" do
25
+ before(:each) do
26
+ @response = dispatch_to(Recaptcha, "ajax_with_options", {}, { "HTTPS" => "on" })
27
+ end
28
+
29
+ it "should load script from secure api url" do
30
+ @response.should have_xpath("//script[@src='https://api-secure.recaptcha.net/js/recaptcha_ajax.js']")
31
+ end
32
+
33
+ it_should_behave_like "ajax recaptcha"
34
+ end
35
+ end
@@ -0,0 +1,59 @@
1
+ require File.dirname(__FILE__) + '/spec_helper'
2
+
3
+ describe "Recaptcha#noajax_with_noscript" do
4
+ describe "HTTP" do
5
+ before(:each) do
6
+ @response = dispatch_to(Recaptcha, "noajax_with_noscript")
7
+ end
8
+
9
+ it "should load script from api url" do
10
+ @response.should have_xpath("//script[@src='http://api.recaptcha.net/challenge?k=#{Merb::Plugins.config[:merb_recaptcha][:public_key]}']")
11
+ end
12
+
13
+ it "should not send private key to anything" do
14
+ @response.should_not have_xpath("//*[contains(., '#{Merb::Plugins.config[:merb_recaptcha][:private_key]}')]")
15
+ end
16
+
17
+ it "should not have RecaptchaOptions array initialization" do
18
+ @response.should_not have_xpath("//script[contains(., 'var RecaptchaOptions')]")
19
+ end
20
+
21
+ it "should have noscript element" do
22
+ @response.should have_xpath("//noscript")
23
+ end
24
+
25
+ it "should have iframe in noscript element" do
26
+ @response.should have_xpath("//noscript/iframe")
27
+ end
28
+
29
+ it "should have iframe with specified height and width (250x250)" do
30
+ @response.should have_xpath("//noscript/iframe[@height=250 and @width=250]")
31
+ end
32
+
33
+ it "should have br element in noscript element" do
34
+ @response.should have_xpath("//noscript/br")
35
+ end
36
+
37
+ it "should have textarea in noscript element" do
38
+ @response.should have_xpath("//noscript/textarea[@name='recaptcha_challenge_field']")
39
+ end
40
+
41
+ it "should have hidden input element in noscript element" do
42
+ @response.should have_xpath("//noscript/input[@name='recaptcha_response_field' and @type='hidden' and @value='manual_challenge']")
43
+ end
44
+ end
45
+
46
+ describe "HTTPS" do
47
+ before(:each) do
48
+ @response = dispatch_to(Recaptcha, "noajax_with_noscript", {}, { "HTTPS" => "on" })
49
+ end
50
+
51
+ it "should load script from secure api url" do
52
+ @response.should have_xpath("//script[@src='https://api-secure.recaptcha.net/challenge?k=#{Merb::Plugins.config[:merb_recaptcha][:public_key]}']")
53
+ end
54
+
55
+ it "should not send private key to anything" do
56
+ @response.should_not have_xpath("//*[contains(., '#{Merb::Plugins.config[:merb_recaptcha][:private_key]}')]")
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,39 @@
1
+ require File.dirname(__FILE__) + '/spec_helper'
2
+
3
+ describe "Recaptcha#noajax_with_options" do
4
+ describe "HTTP" do
5
+ before(:each) do
6
+ @response = dispatch_to(Recaptcha, "noajax_with_options")
7
+ end
8
+
9
+ it "should load script from api url" do
10
+ @response.should have_xpath("//script[@src='http://api.recaptcha.net/challenge?k=#{Merb::Plugins.config[:merb_recaptcha][:public_key]}']")
11
+ end
12
+
13
+ it "should not send private key to anything" do
14
+ @response.should_not have_xpath("//*[contains(., '#{Merb::Plugins.config[:merb_recaptcha][:private_key]}')]")
15
+ end
16
+
17
+ it "should not have noscript element" do
18
+ @response.should_not have_xpath("//noscript")
19
+ end
20
+
21
+ it "should have RecaptchaOptions array intialization (theme = 'clean', tabindex = 2)" do
22
+ @response.should have_xpath("//script[contains(., 'var RecaptchaOptions = {\"theme\": \"clean\", \"tabindex\": 2};') or contains(., 'var RecaptchaOptions = {\"tabindex\": 2, \"theme\": \"clean\"};')]")
23
+ end
24
+ end
25
+
26
+ describe "HTTPS" do
27
+ before(:each) do
28
+ @response = dispatch_to(Recaptcha, "noajax_with_options", {}, { "HTTPS" => "on" })
29
+ end
30
+
31
+ it "should load script from secure api url" do
32
+ @response.should have_xpath("//script[@src='https://api-secure.recaptcha.net/challenge?k=#{Merb::Plugins.config[:merb_recaptcha][:public_key]}']")
33
+ end
34
+
35
+ it "should not send private key to anything" do
36
+ @response.should_not have_xpath("//*[contains(., '#{Merb::Plugins.config[:merb_recaptcha][:private_key]}')]")
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,39 @@
1
+ require File.dirname(__FILE__) + '/spec_helper'
2
+
3
+ describe "Recaptcha#noajax_without_noscript" do
4
+ describe "HTTP" do
5
+ before(:each) do
6
+ @response = dispatch_to(Recaptcha, "noajax_without_noscript")
7
+ end
8
+
9
+ it "should load script from api url" do
10
+ @response.should have_xpath("//script[@src='http://api.recaptcha.net/challenge?k=#{Merb::Plugins.config[:merb_recaptcha][:public_key]}']")
11
+ end
12
+
13
+ it "should not send private key to anything" do
14
+ @response.should_not have_xpath("//*[contains(., '#{Merb::Plugins.config[:merb_recaptcha][:private_key]}')]")
15
+ end
16
+
17
+ it "should not have noscript element" do
18
+ @response.should_not have_xpath("//noscript")
19
+ end
20
+
21
+ it "should not have RecaptchaOptions array initialization" do
22
+ @response.should_not have_xpath("//script[contains(., 'var RecaptchaOptions')]")
23
+ end
24
+ end
25
+
26
+ describe "HTTPS" do
27
+ before(:each) do
28
+ @response = dispatch_to(Recaptcha, "noajax_without_noscript", {}, { "HTTPS" => "on" })
29
+ end
30
+
31
+ it "should load script from secure api url" do
32
+ @response.should have_xpath("//script[@src='https://api-secure.recaptcha.net/challenge?k=#{Merb::Plugins.config[:merb_recaptcha][:public_key]}']")
33
+ end
34
+
35
+ it "should not send private key to anything" do
36
+ @response.should_not have_xpath("//*[contains(., '#{Merb::Plugins.config[:merb_recaptcha][:private_key]}')]")
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,97 @@
1
+ require File.join(File.dirname(__FILE__), "spec_helper")
2
+
3
+ class FakeController < Merb::Controller
4
+ def check_recaptcha
5
+ return recaptcha_valid?.to_s
6
+ end
7
+ end
8
+
9
+ describe "FakeController#check_recaptcha" do
10
+ def do_request
11
+ @response = dispatch_to(FakeController, "check_recaptcha", { :recaptcha_challenge_field => "blabla", :recaptcha_response_field => "blabla" })
12
+ end
13
+
14
+ def stub_response(body)
15
+ Net::HTTP.stub!(:post_form).and_return mock("Net::HTTPResponse", :body => body)
16
+ end
17
+
18
+ describe "with correct response" do
19
+ before(:each) do
20
+ stub_response("true\n")
21
+ end
22
+
23
+ it "should render 'true'" do
24
+ do_request
25
+ @response.should have_selector("*:contains('true')")
26
+ end
27
+
28
+ it "should not raise any exception" do
29
+ lambda { do_request }.should_not raise_error
30
+ end
31
+ end
32
+
33
+ describe "with incorrect response" do
34
+ before(:each) do
35
+ stub_response("false\nincorrect-captcha-sol\n")
36
+ end
37
+
38
+ it "should render 'false'" do
39
+ do_request
40
+ @response.should have_selector("*:contains('false')")
41
+ end
42
+
43
+ it "should not raise any exception" do
44
+ lambda { do_request }.should_not raise_error
45
+ end
46
+ end
47
+
48
+ describe "with incorrect public key" do
49
+ before(:each) do
50
+ stub_response("false\ninvalid-site-public-key\n")
51
+ end
52
+
53
+ it "should raise Merb::Recaptcha::InvalidSitePublicKey" do
54
+ lambda { do_request }.should raise_error(Merb::Recaptcha::InvalidSitePublicKey)
55
+ end
56
+ end
57
+
58
+ describe "with incorrect private key" do
59
+ before(:each) do
60
+ stub_response("false\ninvalid-site-private-key\n")
61
+ end
62
+
63
+ it "should raise Merb::Recaptcha::InvalidSitePrivateKey" do
64
+ lambda { do_request }.should raise_error(Merb::Recaptcha::InvalidSitePrivateKey)
65
+ end
66
+ end
67
+
68
+ describe "with invalid request cookie" do
69
+ before(:each) do
70
+ stub_response("false\ninvalid-request-cookie\n")
71
+ end
72
+
73
+ it "should raise Merb::Recaptcha::InvalidRequestCookie" do
74
+ lambda { do_request }.should raise_error(Merb::Recaptcha::InvalidRequestCookie)
75
+ end
76
+ end
77
+
78
+ describe "with verify parameters incorrect" do
79
+ before(:each) do
80
+ stub_response("false\nverify-params-incorrect\n")
81
+ end
82
+
83
+ it "should raise Merb::Recaptcha::VerifyParamsIncorrect" do
84
+ lambda { do_request }.should raise_error(Merb::Recaptcha::VerifyParamsIncorrect)
85
+ end
86
+ end
87
+
88
+ describe "with invalid referrer" do
89
+ before(:each) do
90
+ stub_response("false\ninvalid-referrer\n")
91
+ end
92
+
93
+ it "should raise Merb::Recaptcha::IvalidReferrer" do
94
+ lambda { do_request }.should raise_error(Merb::Recaptcha::InvalidReferrer)
95
+ end
96
+ end
97
+ end
@@ -0,0 +1,43 @@
1
+ require 'rubygems'
2
+ require 'spec'
3
+ require 'merb-core'
4
+
5
+ $:.push File.join(File.dirname(__FILE__), '..', 'lib')
6
+ require File.join(File.dirname(__FILE__), '..', 'lib', 'merb-recaptcha')
7
+
8
+ default_options = {
9
+ :testing => true,
10
+ :adapter => 'runner',
11
+ :merb_root => File.dirname(__FILE__) / 'fixture',
12
+ :log_stream => STDOUT
13
+ }
14
+ options = default_options.merge($START_OPTIONS || {})
15
+
16
+ Merb.disable(:initfile)
17
+ Merb::BootLoader.after_app_loads do
18
+ Merb::Plugins.config[:merb_recaptcha][:public_key] = "QAAAAAA--public-key--AAAAAAQ"
19
+ Merb::Plugins.config[:merb_recaptcha][:private_key] = "QAAAAAA--private-key--AAAAAAAQ"
20
+
21
+ Merb::Router.prepare { default_routes }
22
+ end
23
+ Merb.start_environment(options)
24
+
25
+ Spec::Runner.configure do |config|
26
+ config.include Merb::Test::ViewHelper
27
+ config.include Merb::Test::RouteHelper
28
+ config.include Merb::Test::ControllerHelper
29
+ end
30
+
31
+ describe "ajax recaptcha", :shared => true do
32
+ it "should invoke Recaptcha.create" do
33
+ @response.should have_xpath("//script[contains(., 'Recaptcha.create')]")
34
+ end
35
+
36
+ it "should send public key to Recaptcha.create" do
37
+ @response.should have_xpath("//script[contains(., 'Recaptcha.create') and contains(., '#{Merb::Plugins.config[:merb_recaptcha][:public_key]}')]")
38
+ end
39
+
40
+ it "should not send private key to anything" do
41
+ @response.should_not have_xpath("//*[contains(., '#{Merb::Plugins.config[:merb_recaptcha][:private_key]}')]")
42
+ end
43
+ end
metadata ADDED
@@ -0,0 +1,137 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: antage-merb-recaptcha
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Anton Ageev
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-12-10 00:00:00 -08:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: merb-core
17
+ version_requirement:
18
+ version_requirements: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 1.0.0
23
+ version:
24
+ - !ruby/object:Gem::Dependency
25
+ name: builder
26
+ version_requirement:
27
+ version_requirements: !ruby/object:Gem::Requirement
28
+ requirements:
29
+ - - ~>
30
+ - !ruby/object:Gem::Version
31
+ version: "2.0"
32
+ version:
33
+ - !ruby/object:Gem::Dependency
34
+ name: rspec
35
+ version_requirement:
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 1.1.0
41
+ version:
42
+ description: Merb plugin that provides helpers for recaptcha.net service
43
+ email: antage@gmail.com
44
+ executables: []
45
+
46
+ extensions: []
47
+
48
+ extra_rdoc_files:
49
+ - README.textile
50
+ - LICENSE
51
+ - TODO
52
+ files:
53
+ - LICENSE
54
+ - README.textile
55
+ - Rakefile
56
+ - TODO
57
+ - merb-recaptcha.gemspec
58
+ - lib/merb-recaptcha.rb
59
+ - lib/merb-recaptcha/exceptions.rb
60
+ - lib/merb-recaptcha/view_helpers.rb
61
+ - lib/merb-recaptcha/controller_mixin.rb
62
+ - lib/merb-recaptcha/merbtasks.rb
63
+ - spec/spec_helper.rb
64
+ - spec/recaptcha_ajax_with_callback_spec.rb
65
+ - spec/recaptcha_noajax_with_noscript_spec.rb
66
+ - spec/recaptcha_noajax_with_options_spec.rb
67
+ - spec/recaptcha_ajax_spec.rb
68
+ - spec/recaptcha_ajax_with_jquery_spec.rb
69
+ - spec/recaptcha_ajax_with_options_spec.rb
70
+ - spec/recaptcha_noajax_without_noscript_spec.rb
71
+ - spec/recaptcha_valid_spec.rb
72
+ - spec/fixture/app/views/layout/application.html.erb
73
+ - spec/fixture/app/views/recaptcha/ajax_with_callback.html.erb
74
+ - spec/fixture/app/views/recaptcha/noajax_with_noscript.html.erb
75
+ - spec/fixture/app/views/recaptcha/ajax.html.erb
76
+ - spec/fixture/app/views/recaptcha/ajax_with_jquery.html.erb
77
+ - spec/fixture/app/views/recaptcha/noajax_with_options.html.erb
78
+ - spec/fixture/app/views/recaptcha/noajax_without_noscript.html.erb
79
+ - spec/fixture/app/views/recaptcha/ajax_with_options.html.erb
80
+ - spec/fixture/app/views/exceptions/not_acceptable.html.erb
81
+ - spec/fixture/app/views/exceptions/not_found.html.erb
82
+ - spec/fixture/app/controllers/exceptions.rb
83
+ - spec/fixture/app/controllers/application.rb
84
+ - spec/fixture/app/controllers/recaptcha.rb
85
+ - spec/fixture/app/helpers/recaptcha_helpers.rb
86
+ - spec/fixture/app/helpers/global_helpers.rb
87
+ has_rdoc: true
88
+ homepage: http://github.com/antage/merb-recaptcha/
89
+ post_install_message:
90
+ rdoc_options: []
91
+
92
+ require_paths:
93
+ - lib
94
+ required_ruby_version: !ruby/object:Gem::Requirement
95
+ requirements:
96
+ - - ">="
97
+ - !ruby/object:Gem::Version
98
+ version: "0"
99
+ version:
100
+ required_rubygems_version: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: "0"
105
+ version:
106
+ requirements: []
107
+
108
+ rubyforge_project: merb-recaptcha
109
+ rubygems_version: 1.2.0
110
+ signing_key:
111
+ specification_version: 2
112
+ summary: Merb plugin that provides helpers for recaptcha.net service
113
+ test_files:
114
+ - spec/spec_helper.rb
115
+ - spec/recaptcha_ajax_with_callback_spec.rb
116
+ - spec/recaptcha_noajax_with_noscript_spec.rb
117
+ - spec/recaptcha_noajax_with_options_spec.rb
118
+ - spec/recaptcha_ajax_spec.rb
119
+ - spec/recaptcha_ajax_with_jquery_spec.rb
120
+ - spec/recaptcha_ajax_with_options_spec.rb
121
+ - spec/recaptcha_noajax_without_noscript_spec.rb
122
+ - spec/recaptcha_valid_spec.rb
123
+ - spec/fixture/app/views/layout/application.html.erb
124
+ - spec/fixture/app/views/recaptcha/ajax_with_callback.html.erb
125
+ - spec/fixture/app/views/recaptcha/noajax_with_noscript.html.erb
126
+ - spec/fixture/app/views/recaptcha/ajax.html.erb
127
+ - spec/fixture/app/views/recaptcha/ajax_with_jquery.html.erb
128
+ - spec/fixture/app/views/recaptcha/noajax_with_options.html.erb
129
+ - spec/fixture/app/views/recaptcha/noajax_without_noscript.html.erb
130
+ - spec/fixture/app/views/recaptcha/ajax_with_options.html.erb
131
+ - spec/fixture/app/views/exceptions/not_acceptable.html.erb
132
+ - spec/fixture/app/views/exceptions/not_found.html.erb
133
+ - spec/fixture/app/controllers/exceptions.rb
134
+ - spec/fixture/app/controllers/application.rb
135
+ - spec/fixture/app/controllers/recaptcha.rb
136
+ - spec/fixture/app/helpers/recaptcha_helpers.rb
137
+ - spec/fixture/app/helpers/global_helpers.rb