captchme 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +26 -7
- data/lib/captchme/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a7d4f1d61e5df18d80ddb8bf8ea82cf1512a0d69
|
4
|
+
data.tar.gz: 30a82692c02db2d09099fefb2fd65ef021534216
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 60bb77f12ce29ed69e5ac344bd415c28fd0efc593061a818878277d95a1425439357c4702dfadee52dc337d732f90873d9b759a0cbdb4e948e7647797e818ac6
|
7
|
+
data.tar.gz: 2d344f22411ac80c5b7643e640cbd05d1699887d9cdbc9708628faf499d7b68520ed481985ceae9007167998eb4fddb195ca9d95badb4059cca3f5d791197ae3
|
data/README.md
CHANGED
@@ -1,15 +1,12 @@
|
|
1
1
|
# Rails::Captchme
|
2
2
|
|
3
|
-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/rails/captchme`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
6
3
|
|
7
4
|
## Installation
|
8
5
|
|
9
6
|
Add this line to your application's Gemfile:
|
10
7
|
|
11
8
|
```ruby
|
12
|
-
gem '
|
9
|
+
gem 'captchme'
|
13
10
|
```
|
14
11
|
|
15
12
|
And then execute:
|
@@ -18,11 +15,33 @@ And then execute:
|
|
18
15
|
|
19
16
|
Or install it yourself as:
|
20
17
|
|
21
|
-
$ gem install
|
18
|
+
$ gem install captchme
|
22
19
|
|
23
20
|
## Usage
|
24
21
|
|
25
|
-
|
22
|
+
CONTROLLER
|
23
|
+
|
24
|
+
After a POST action, in your controller use:
|
25
|
+
```ruby
|
26
|
+
captchme = CAPTCHME::Captchme.new(YOUR_PRIVATE_KEY, params, request.remote_ip)
|
27
|
+
|
28
|
+
# send POST request to captchme server
|
29
|
+
captchme.request
|
30
|
+
|
31
|
+
# return true if captchme is OK
|
32
|
+
captchme.is_valid?
|
33
|
+
```
|
34
|
+
|
35
|
+
VIEWS
|
36
|
+
In your form
|
37
|
+
(slim)
|
38
|
+
```ruby
|
39
|
+
= javascript_include_tag 'http://api.captchme.net/api/script?key=' + YOUR_PUBLIC_KEY
|
40
|
+
```
|
41
|
+
(erb)
|
42
|
+
```ruby
|
43
|
+
<%= javascript_include_tag 'http://api.captchme.net/api/script?key=' + YOUR_PUBLIC_KEY %>
|
44
|
+
```
|
26
45
|
|
27
46
|
## Development
|
28
47
|
|
@@ -32,7 +51,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
32
51
|
|
33
52
|
## Contributing
|
34
53
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/
|
54
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/captchme. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
|
36
55
|
|
37
56
|
|
38
57
|
## License
|
data/lib/captchme/version.rb
CHANGED