recaptcha 0.3.5 → 0.3.6
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 +7 -0
 - data/Gemfile +1 -1
 - data/README.rdoc +12 -11
 - data/lib/recaptcha/client_helper.rb +3 -1
 - data/lib/recaptcha/version.rb +1 -1
 - data/test/verify_recaptcha_test.rb +1 -1
 - metadata +15 -25
 
    
        checksums.yaml
    ADDED
    
    | 
         @@ -0,0 +1,7 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            ---
         
     | 
| 
      
 2 
     | 
    
         
            +
            SHA1:
         
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: a2ab60ab04802c7dc8a205ffa010071d2edd9f47
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 7155b2dcb7ee6c183b3a06b6768562daf6e3e2da
         
     | 
| 
      
 5 
     | 
    
         
            +
            SHA512:
         
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: b2dcd0d13ae9dcbb8f9c96a7c65e0231f058a7979696bd181fe101640f5c3778d02b8dbb39d898f2bcd2a788b1ab062dbb0b027619d71a6c55af9e2e8a0cf151
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: c55e6b3701db18b477ea056b289ec710e550daa71dfe3d03c3540ebdd8e22adef22969fac2013bc0b8586cb65ec89acef72200984fa1765d119b83568676d9aa
         
     | 
    
        data/Gemfile
    CHANGED
    
    
    
        data/README.rdoc
    CHANGED
    
    | 
         @@ -1,10 +1,9 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            = reCAPTCHA
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            Author::    Jason L Perry (http://ambethia.com)
         
     | 
| 
       4 
     | 
    
         
            -
            Copyright:: Copyright (c) 2007 Jason L Perry
         
     | 
| 
      
 4 
     | 
    
         
            +
            Copyright:: Copyright (c) 2007-2013 Jason L Perry
         
     | 
| 
       5 
5 
     | 
    
         
             
            License::   {MIT}[http://creativecommons.org/licenses/MIT/]
         
     | 
| 
       6 
     | 
    
         
            -
            Info::      http:// 
     | 
| 
       7 
     | 
    
         
            -
            Git::       http://github.com/ambethia/recaptcha/tree/master
         
     | 
| 
      
 6 
     | 
    
         
            +
            Info::      http://github.com/ambethia/recaptcha
         
     | 
| 
       8 
7 
     | 
    
         
             
            Bugs::      http://github.com/ambethia/recaptcha/issues
         
     | 
| 
       9 
8 
     | 
    
         | 
| 
       10 
9 
     | 
    
         
             
            This plugin adds helpers for the {reCAPTCHA API}[http://recaptcha.net]. In your
         
     | 
| 
         @@ -15,12 +14,6 @@ Beforehand you need to configure Recaptcha with your custom private and public 
     | 
|
| 
       15 
14 
     | 
    
         
             
            key. You may find detailed examples below. Exceptions will be raised if you
         
     | 
| 
       16 
15 
     | 
    
         
             
            call these methods and the keys can't be found.
         
     | 
| 
       17 
16 
     | 
    
         | 
| 
       18 
     | 
    
         
            -
            == About this fork
         
     | 
| 
       19 
     | 
    
         
            -
             
     | 
| 
       20 
     | 
    
         
            -
            This fork tries to introduce a more convenient way to configure recaptcha's
         
     | 
| 
       21 
     | 
    
         
            -
            settings. The API will be inspired by {Thoughtbot's
         
     | 
| 
       22 
     | 
    
         
            -
            Hoptoad}[http://robots.thoughtbot.com/post/344833329/mygem-configure-block].
         
     | 
| 
       23 
     | 
    
         
            -
             
     | 
| 
       24 
17 
     | 
    
         
             
            == Rails Installation
         
     | 
| 
       25 
18 
     | 
    
         | 
| 
       26 
19 
     | 
    
         
             
            reCAPTCHA for Rails > 3.0, add this to your Gemfile:
         
     | 
| 
         @@ -82,7 +75,15 @@ reCAPTCHA setups. 
     | 
|
| 
       82 
75 
     | 
    
         | 
| 
       83 
76 
     | 
    
         
             
            == To use 'recaptcha'
         
     | 
| 
       84 
77 
     | 
    
         | 
| 
       85 
     | 
    
         
            -
            Add +recaptcha_tags+ to each form you want to protect.
         
     | 
| 
      
 78 
     | 
    
         
            +
            Add +recaptcha_tags+ to each form you want to protect. Place it where you want the recaptcha widget to appear.
         
     | 
| 
      
 79 
     | 
    
         
            +
             
     | 
| 
      
 80 
     | 
    
         
            +
            Example:
         
     | 
| 
      
 81 
     | 
    
         
            +
             
     | 
| 
      
 82 
     | 
    
         
            +
              <%= form_for @foo do |f| %>
         
     | 
| 
      
 83 
     | 
    
         
            +
                # ... additional lines truncated for brevity ...
         
     | 
| 
      
 84 
     | 
    
         
            +
                <%= recaptcha_tags %>
         
     | 
| 
      
 85 
     | 
    
         
            +
                # ... additional lines truncated for brevity ...
         
     | 
| 
      
 86 
     | 
    
         
            +
              <% end %>
         
     | 
| 
       86 
87 
     | 
    
         | 
| 
       87 
88 
     | 
    
         
             
            And, add +verify_recaptcha+ logic to each form action that you've protected.
         
     | 
| 
       88 
89 
     | 
    
         | 
| 
         @@ -129,7 +130,7 @@ to translate the default error message if I18n is available. To customize the me 
     | 
|
| 
       129 
130 
     | 
    
         
             
            add these keys to your I18n backend:
         
     | 
| 
       130 
131 
     | 
    
         | 
| 
       131 
132 
     | 
    
         
             
            <tt>recaptcha.errors.verification_failed</tt>:: error message displayed if the captcha words didn't match
         
     | 
| 
       132 
     | 
    
         
            -
            <tt>recaptcha.errors. 
     | 
| 
      
 133 
     | 
    
         
            +
            <tt>recaptcha.errors.recaptcha_unreachable</tt>:: displayed if a timeout error occured while attempting to verify the captcha
         
     | 
| 
       133 
134 
     | 
    
         | 
| 
       134 
135 
     | 
    
         
             
            Also you can translate API response errors to human friendly by adding translations to the locale (+config/locales/en.yml+):
         
     | 
| 
       135 
136 
     | 
    
         | 
| 
         @@ -55,7 +55,9 @@ module Recaptcha 
     | 
|
| 
       55 
55 
     | 
    
         
             
                def hash_to_json(hash)
         
     | 
| 
       56 
56 
     | 
    
         
             
                  result = "{"
         
     | 
| 
       57 
57 
     | 
    
         
             
                  result << hash.map do |k, v|
         
     | 
| 
       58 
     | 
    
         
            -
                    if  
     | 
| 
      
 58 
     | 
    
         
            +
                    if v.is_a?(Hash)
         
     | 
| 
      
 59 
     | 
    
         
            +
                      "\"#{k}\": #{hash_to_json(v)}"
         
     | 
| 
      
 60 
     | 
    
         
            +
                    elsif ! v.is_a?(String) || k.to_s == "callback"
         
     | 
| 
       59 
61 
     | 
    
         
             
                      "\"#{k}\": #{v}"
         
     | 
| 
       60 
62 
     | 
    
         
             
                    else
         
     | 
| 
       61 
63 
     | 
    
         
             
                      "\"#{k}\": \"#{v}\""
         
     | 
    
        data/lib/recaptcha/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,78 +1,69 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: recaptcha
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.3. 
     | 
| 
       5 
     | 
    
         
            -
              prerelease: 
         
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.3.6
         
     | 
| 
       6 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       7 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       8 
7 
     | 
    
         
             
            - Jason L Perry
         
     | 
| 
       9 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       10 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       11 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       12 
     | 
    
         
            -
            date:  
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2014-01-07 00:00:00.000000000 Z
         
     | 
| 
       13 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       14 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       15 
14 
     | 
    
         
             
              name: mocha
         
     | 
| 
       16 
15 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       17 
     | 
    
         
            -
                none: false
         
     | 
| 
       18 
16 
     | 
    
         
             
                requirements:
         
     | 
| 
       19 
     | 
    
         
            -
                - -  
     | 
| 
      
 17 
     | 
    
         
            +
                - - '>='
         
     | 
| 
       20 
18 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       21 
19 
     | 
    
         
             
                    version: '0'
         
     | 
| 
       22 
20 
     | 
    
         
             
              type: :development
         
     | 
| 
       23 
21 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       24 
22 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       25 
     | 
    
         
            -
                none: false
         
     | 
| 
       26 
23 
     | 
    
         
             
                requirements:
         
     | 
| 
       27 
     | 
    
         
            -
                - -  
     | 
| 
      
 24 
     | 
    
         
            +
                - - '>='
         
     | 
| 
       28 
25 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       29 
26 
     | 
    
         
             
                    version: '0'
         
     | 
| 
       30 
27 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       31 
28 
     | 
    
         
             
              name: rake
         
     | 
| 
       32 
29 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       33 
     | 
    
         
            -
                none: false
         
     | 
| 
       34 
30 
     | 
    
         
             
                requirements:
         
     | 
| 
       35 
     | 
    
         
            -
                - -  
     | 
| 
      
 31 
     | 
    
         
            +
                - - '>='
         
     | 
| 
       36 
32 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       37 
33 
     | 
    
         
             
                    version: '0'
         
     | 
| 
       38 
34 
     | 
    
         
             
              type: :development
         
     | 
| 
       39 
35 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       40 
36 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       41 
     | 
    
         
            -
                none: false
         
     | 
| 
       42 
37 
     | 
    
         
             
                requirements:
         
     | 
| 
       43 
     | 
    
         
            -
                - -  
     | 
| 
      
 38 
     | 
    
         
            +
                - - '>='
         
     | 
| 
       44 
39 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       45 
40 
     | 
    
         
             
                    version: '0'
         
     | 
| 
       46 
41 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       47 
42 
     | 
    
         
             
              name: activesupport
         
     | 
| 
       48 
43 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       49 
     | 
    
         
            -
                none: false
         
     | 
| 
       50 
44 
     | 
    
         
             
                requirements:
         
     | 
| 
       51 
     | 
    
         
            -
                - -  
     | 
| 
      
 45 
     | 
    
         
            +
                - - '>='
         
     | 
| 
       52 
46 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       53 
47 
     | 
    
         
             
                    version: '0'
         
     | 
| 
       54 
48 
     | 
    
         
             
              type: :development
         
     | 
| 
       55 
49 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       56 
50 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       57 
     | 
    
         
            -
                none: false
         
     | 
| 
       58 
51 
     | 
    
         
             
                requirements:
         
     | 
| 
       59 
     | 
    
         
            -
                - -  
     | 
| 
      
 52 
     | 
    
         
            +
                - - '>='
         
     | 
| 
       60 
53 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       61 
54 
     | 
    
         
             
                    version: '0'
         
     | 
| 
       62 
55 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       63 
56 
     | 
    
         
             
              name: i18n
         
     | 
| 
       64 
57 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       65 
     | 
    
         
            -
                none: false
         
     | 
| 
       66 
58 
     | 
    
         
             
                requirements:
         
     | 
| 
       67 
     | 
    
         
            -
                - -  
     | 
| 
      
 59 
     | 
    
         
            +
                - - '>='
         
     | 
| 
       68 
60 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       69 
61 
     | 
    
         
             
                    version: '0'
         
     | 
| 
       70 
62 
     | 
    
         
             
              type: :development
         
     | 
| 
       71 
63 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       72 
64 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       73 
     | 
    
         
            -
                none: false
         
     | 
| 
       74 
65 
     | 
    
         
             
                requirements:
         
     | 
| 
       75 
     | 
    
         
            -
                - -  
     | 
| 
      
 66 
     | 
    
         
            +
                - - '>='
         
     | 
| 
       76 
67 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       77 
68 
     | 
    
         
             
                    version: '0'
         
     | 
| 
       78 
69 
     | 
    
         
             
            description: This plugin adds helpers for the reCAPTCHA API
         
     | 
| 
         @@ -102,27 +93,26 @@ files: 
     | 
|
| 
       102 
93 
     | 
    
         
             
            - test/verify_recaptcha_test.rb
         
     | 
| 
       103 
94 
     | 
    
         
             
            homepage: http://github.com/ambethia/recaptcha
         
     | 
| 
       104 
95 
     | 
    
         
             
            licenses: []
         
     | 
| 
      
 96 
     | 
    
         
            +
            metadata: {}
         
     | 
| 
       105 
97 
     | 
    
         
             
            post_install_message: 
         
     | 
| 
       106 
98 
     | 
    
         
             
            rdoc_options: []
         
     | 
| 
       107 
99 
     | 
    
         
             
            require_paths:
         
     | 
| 
       108 
100 
     | 
    
         
             
            - lib
         
     | 
| 
       109 
101 
     | 
    
         
             
            required_ruby_version: !ruby/object:Gem::Requirement
         
     | 
| 
       110 
     | 
    
         
            -
              none: false
         
     | 
| 
       111 
102 
     | 
    
         
             
              requirements:
         
     | 
| 
       112 
     | 
    
         
            -
              - -  
     | 
| 
      
 103 
     | 
    
         
            +
              - - '>='
         
     | 
| 
       113 
104 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       114 
105 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       115 
106 
     | 
    
         
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
       116 
     | 
    
         
            -
              none: false
         
     | 
| 
       117 
107 
     | 
    
         
             
              requirements:
         
     | 
| 
       118 
     | 
    
         
            -
              - -  
     | 
| 
      
 108 
     | 
    
         
            +
              - - '>='
         
     | 
| 
       119 
109 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       120 
110 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       121 
111 
     | 
    
         
             
            requirements: []
         
     | 
| 
       122 
112 
     | 
    
         
             
            rubyforge_project: recaptcha
         
     | 
| 
       123 
     | 
    
         
            -
            rubygems_version: 1. 
     | 
| 
      
 113 
     | 
    
         
            +
            rubygems_version: 2.1.10
         
     | 
| 
       124 
114 
     | 
    
         
             
            signing_key: 
         
     | 
| 
       125 
     | 
    
         
            -
            specification_version:  
     | 
| 
      
 115 
     | 
    
         
            +
            specification_version: 4
         
     | 
| 
       126 
116 
     | 
    
         
             
            summary: Helpers for the reCAPTCHA API
         
     | 
| 
       127 
117 
     | 
    
         
             
            test_files:
         
     | 
| 
       128 
118 
     | 
    
         
             
            - test/recaptcha_test.rb
         
     |