rack-recaptcha 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/lib/rack/recaptcha/helpers.rb +1 -1
- data/rack-recaptcha.gemspec +10 -56
- data/test/helpers_test.rb +11 -3
- metadata +11 -11
- data/VERSION +0 -1
- data/test.watchr +0 -45
data/README.md
CHANGED
data/rack-recaptcha.gemspec
CHANGED
@@ -1,67 +1,21 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
-
# -*- encoding: utf-8 -*-
|
5
|
-
|
6
1
|
Gem::Specification.new do |s|
|
7
2
|
s.name = %q{rack-recaptcha}
|
8
|
-
s.version = "0.2.
|
9
|
-
|
10
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
3
|
+
s.version = "0.2.1"
|
4
|
+
s.required_rubygems_version = ">=1.3.6"
|
11
5
|
s.authors = ["Arthur Chiu"]
|
12
|
-
s.date = %q{2010-
|
6
|
+
s.date = %q{2010-07-18}
|
13
7
|
s.description = %q{Rack middleware Captcha verification using Recaptcha API.}
|
14
8
|
s.email = %q{mr.arthur.chiu@gmail.com}
|
15
|
-
s.extra_rdoc_files = [
|
16
|
-
|
17
|
-
"README.md"
|
18
|
-
]
|
19
|
-
s.files = [
|
20
|
-
".document",
|
21
|
-
".gitignore",
|
22
|
-
"LICENSE",
|
23
|
-
"README.md",
|
24
|
-
"Rakefile",
|
25
|
-
"VERSION",
|
26
|
-
"lib/rack/recaptcha.rb",
|
27
|
-
"lib/rack/recaptcha/helpers.rb",
|
28
|
-
"rack-recaptcha.gemspec",
|
29
|
-
"test.watchr",
|
30
|
-
"test/helpers_test.rb",
|
31
|
-
"test/recaptcha_test.rb",
|
32
|
-
"test/teststrap.rb"
|
33
|
-
]
|
9
|
+
s.extra_rdoc_files = ["LICENSE", "README.md"]
|
10
|
+
s.files = %w{.document .gitignore LICENSE README.md Rakefile rack-recaptcha.gemspec} + Dir.glob("{lib,test}/**/*")
|
34
11
|
s.homepage = %q{http://github.com/achiu/rack-recaptcha}
|
35
12
|
s.rdoc_options = ["--charset=UTF-8"]
|
36
13
|
s.require_paths = ["lib"]
|
37
14
|
s.rubygems_version = %q{1.3.7}
|
38
15
|
s.summary = %q{Rack middleware for Recaptcha}
|
39
|
-
s.test_files =
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
]
|
44
|
-
|
45
|
-
if s.respond_to? :specification_version then
|
46
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
47
|
-
s.specification_version = 3
|
48
|
-
|
49
|
-
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
50
|
-
s.add_runtime_dependency(%q<json>, [">= 0"])
|
51
|
-
s.add_development_dependency(%q<riot>, [">= 0"])
|
52
|
-
s.add_development_dependency(%q<rack-test>, [">= 0"])
|
53
|
-
s.add_development_dependency(%q<rr>, [">= 0"])
|
54
|
-
else
|
55
|
-
s.add_dependency(%q<json>, [">= 0"])
|
56
|
-
s.add_dependency(%q<riot>, [">= 0"])
|
57
|
-
s.add_dependency(%q<rack-test>, [">= 0"])
|
58
|
-
s.add_dependency(%q<rr>, [">= 0"])
|
59
|
-
end
|
60
|
-
else
|
61
|
-
s.add_dependency(%q<json>, [">= 0"])
|
62
|
-
s.add_dependency(%q<riot>, [">= 0"])
|
63
|
-
s.add_dependency(%q<rack-test>, [">= 0"])
|
64
|
-
s.add_dependency(%q<rr>, [">= 0"])
|
65
|
-
end
|
16
|
+
s.test_files = Dir.glob("test/**/*")
|
17
|
+
s.add_runtime_dependency("json", [">= 0"])
|
18
|
+
s.add_development_dependency("riot", [">= 0"])
|
19
|
+
s.add_development_dependency("rack-test", [">= 0"])
|
20
|
+
s.add_development_dependency("rr", [">= 0"])
|
66
21
|
end
|
67
|
-
|
data/test/helpers_test.rb
CHANGED
@@ -3,8 +3,16 @@ require File.expand_path(File.join(File.dirname(__FILE__),'..','lib','rack','rec
|
|
3
3
|
require 'riot/rr'
|
4
4
|
|
5
5
|
class HelperTest
|
6
|
-
attr_accessor :
|
6
|
+
attr_accessor :request
|
7
7
|
include Rack::Recaptcha::Helpers
|
8
|
+
|
9
|
+
def initialize
|
10
|
+
@request = HelperTest::Request.new
|
11
|
+
end
|
12
|
+
|
13
|
+
class Request
|
14
|
+
attr_accessor :env
|
15
|
+
end
|
8
16
|
end
|
9
17
|
|
10
18
|
context "Rack::Recaptcha::Helpers" do
|
@@ -61,7 +69,7 @@ context "Rack::Recaptcha::Helpers" do
|
|
61
69
|
|
62
70
|
context "passing" do
|
63
71
|
setup do
|
64
|
-
mock(@helper.env).[]('recaptcha.valid').returns(true)
|
72
|
+
mock(@helper.request.env).[]('recaptcha.valid').returns(true)
|
65
73
|
@helper.recaptcha_valid?
|
66
74
|
end
|
67
75
|
asserts_topic
|
@@ -69,7 +77,7 @@ context "Rack::Recaptcha::Helpers" do
|
|
69
77
|
|
70
78
|
context "failing" do
|
71
79
|
setup do
|
72
|
-
mock(@helper.env).[]('recaptcha.valid').returns(false)
|
80
|
+
mock(@helper.request.env).[]('recaptcha.valid').returns(false)
|
73
81
|
@helper.recaptcha_valid?
|
74
82
|
end
|
75
83
|
asserts_topic.not!
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-recaptcha
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 1
|
10
|
+
version: 0.2.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Arthur Chiu
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-07-18 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -89,11 +89,9 @@ files:
|
|
89
89
|
- LICENSE
|
90
90
|
- README.md
|
91
91
|
- Rakefile
|
92
|
-
- VERSION
|
93
|
-
- lib/rack/recaptcha.rb
|
94
|
-
- lib/rack/recaptcha/helpers.rb
|
95
92
|
- rack-recaptcha.gemspec
|
96
|
-
-
|
93
|
+
- lib/rack/recaptcha/helpers.rb
|
94
|
+
- lib/rack/recaptcha.rb
|
97
95
|
- test/helpers_test.rb
|
98
96
|
- test/recaptcha_test.rb
|
99
97
|
- test/teststrap.rb
|
@@ -120,10 +118,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
118
|
requirements:
|
121
119
|
- - ">="
|
122
120
|
- !ruby/object:Gem::Version
|
123
|
-
hash:
|
121
|
+
hash: 23
|
124
122
|
segments:
|
125
|
-
-
|
126
|
-
|
123
|
+
- 1
|
124
|
+
- 3
|
125
|
+
- 6
|
126
|
+
version: 1.3.6
|
127
127
|
requirements: []
|
128
128
|
|
129
129
|
rubyforge_project:
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.2.0
|
data/test.watchr
DELETED
@@ -1,45 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# 'autotest' for riot
|
3
|
-
# install watchr
|
4
|
-
# $ sudo gem install watchr
|
5
|
-
#
|
6
|
-
# Run With:
|
7
|
-
# $ watchr test.watchr
|
8
|
-
#
|
9
|
-
|
10
|
-
# --------------------------------------------------
|
11
|
-
# Helpers
|
12
|
-
# --------------------------------------------------
|
13
|
-
|
14
|
-
def run(cmd)
|
15
|
-
puts(cmd)
|
16
|
-
system(cmd)
|
17
|
-
end
|
18
|
-
|
19
|
-
def run_all_tests
|
20
|
-
system( "rake test" )
|
21
|
-
end
|
22
|
-
|
23
|
-
def sudo(cmd)
|
24
|
-
run("sudo #{cmd}")
|
25
|
-
end
|
26
|
-
|
27
|
-
# --------------------------------------------------
|
28
|
-
# Watchr Rules
|
29
|
-
# --------------------------------------------------
|
30
|
-
watch("^lib.*/(.*)\.rb") { |m| run("ruby test/#{m[1]}_test.rb") }
|
31
|
-
watch("test.*/teststrap\.rb") { run_all_tests }
|
32
|
-
watch("^test/(.*)_test\.rb") { |m| run("ruby test/#{m[1]}_test.rb")}
|
33
|
-
|
34
|
-
|
35
|
-
# --------------------------------------------------
|
36
|
-
# Signal Handling
|
37
|
-
# --------------------------------------------------
|
38
|
-
# Ctrl-\
|
39
|
-
Signal.trap('QUIT') do
|
40
|
-
puts " --- Running all tests ---\n\n"
|
41
|
-
run_all_tests
|
42
|
-
end
|
43
|
-
|
44
|
-
# Ctrl-C
|
45
|
-
Signal.trap('INT') { abort("\n") }
|