ankh 0.1.3 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. data/.gitignore +18 -0
  2. data/{spec/spec.opts → .rspec} +0 -0
  3. data/.rvmrc +1 -0
  4. data/Gemfile +4 -0
  5. data/LICENSE +4 -2
  6. data/README.rdoc +15 -5
  7. data/Rakefile +6 -84
  8. data/ankh.gemspec +20 -67
  9. data/lib/..rb +5 -0
  10. data/lib/ankh.rb +4 -6
  11. data/lib/ankh/model.rb +18 -10
  12. data/lib/ankh/question.rb +1 -1
  13. data/lib/ankh/railtie.rb +8 -0
  14. data/lib/ankh/validations/{human.rb → human_validator.rb} +0 -12
  15. data/lib/ankh/version.rb +3 -0
  16. data/spec/ankh/model_spec.rb +10 -7
  17. data/spec/dummy/Rakefile +7 -0
  18. data/spec/dummy/api_docs/api_authentication.markdown +70 -0
  19. data/spec/dummy/api_docs/api_user_creates_user.markdown +1170 -0
  20. data/spec/dummy/api_docs/partner_creation.markdown +78 -0
  21. data/spec/dummy/api_docs/topic_creation.markdown +76 -0
  22. data/spec/dummy/api_docs/user_creation.markdown +31 -0
  23. data/spec/dummy/app/assets/javascripts/application.js +9 -0
  24. data/spec/dummy/app/assets/stylesheets/application.css +7 -0
  25. data/spec/dummy/app/controllers/application_controller.rb +4 -0
  26. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  27. data/{features/step_definitions/ankh_steps.rb → spec/dummy/app/mailers/.gitkeep} +0 -0
  28. data/spec/dummy/app/models/.gitkeep +0 -0
  29. data/spec/dummy/app/views/devise/confirmations/new.html.erb +15 -0
  30. data/spec/dummy/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
  31. data/spec/dummy/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
  32. data/spec/dummy/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
  33. data/spec/dummy/app/views/devise/passwords/edit.html.erb +19 -0
  34. data/spec/dummy/app/views/devise/passwords/new.html.erb +15 -0
  35. data/spec/dummy/app/views/devise/registrations/edit.html.erb +22 -0
  36. data/spec/dummy/app/views/devise/registrations/new.html.erb +20 -0
  37. data/spec/dummy/app/views/devise/sessions/new.html.erb +15 -0
  38. data/spec/dummy/app/views/devise/sessions/new.mobile.erb +14 -0
  39. data/spec/dummy/app/views/devise/shared/_links.erb +25 -0
  40. data/spec/dummy/app/views/devise/unlocks/new.html.erb +15 -0
  41. data/spec/dummy/config.ru +4 -0
  42. data/spec/dummy/config/application.rb +45 -0
  43. data/spec/dummy/config/boot.rb +10 -0
  44. data/spec/dummy/config/database.yml +20 -0
  45. data/spec/dummy/config/environment.rb +5 -0
  46. data/spec/dummy/config/environments/development.rb +30 -0
  47. data/spec/dummy/config/environments/production.rb +60 -0
  48. data/spec/dummy/config/environments/test.rb +39 -0
  49. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  50. data/spec/dummy/config/initializers/inflections.rb +10 -0
  51. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  52. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  53. data/spec/dummy/config/initializers/session_store.rb +8 -0
  54. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  55. data/spec/dummy/config/locales/en.yml +5 -0
  56. data/spec/dummy/config/routes.rb +3 -0
  57. data/spec/dummy/db/development.sqlite3 +0 -0
  58. data/spec/dummy/db/schema.rb +188 -0
  59. data/spec/dummy/db/test.sqlite3 +0 -0
  60. data/spec/dummy/lib/assets/.gitkeep +0 -0
  61. data/spec/dummy/public/404.html +26 -0
  62. data/spec/dummy/public/422.html +26 -0
  63. data/spec/dummy/public/500.html +26 -0
  64. data/spec/dummy/public/favicon.ico +0 -0
  65. data/spec/dummy/script/rails +6 -0
  66. data/spec/spec_helper.rb +10 -14
  67. metadata +205 -130
  68. data/features/ankh.feature +0 -9
  69. data/features/support/env.rb +0 -4
  70. data/lib/ankh/rails/legacy.rb +0 -41
  71. data/spec/support/active_record_spec_helper.rb +0 -44
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/422.html -->
21
+ <div class="dialog">
22
+ <h1>The change you wanted was rejected.</h1>
23
+ <p>Maybe you tried to change something you didn't have access to.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/500.html -->
21
+ <div class="dialog">
22
+ <h1>We're sorry, but something went wrong.</h1>
23
+ <p>We've been notified about this issue and we'll take a look at it shortly.</p>
24
+ </div>
25
+ </body>
26
+ </html>
File without changes
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
+
4
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
5
+ require File.expand_path('../../config/boot', __FILE__)
6
+ require 'rails/commands'
@@ -1,21 +1,17 @@
1
1
  $LOAD_PATH.unshift(File.dirname(__FILE__))
2
2
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
+
4
+ ENV["RAILS_ENV"] ||= 'test'
5
+
6
+ require File.expand_path("../dummy/config/environment.rb", __FILE__)
7
+
3
8
  require 'ankh'
4
- require 'spec'
5
- require 'spec/autorun'
9
+ require 'rspec'
6
10
  require 'mocha'
7
11
 
8
- require 'support/active_record_spec_helper'
9
- Spec::Runner.configure do |config|
10
- include ActiveRecordSpecHelper
11
-
12
- config.before(:all) do
13
- create_tables
14
- end
15
-
16
- config.after(:all) do
17
- drop_tables
18
- end
19
-
12
+ ENGINE_RAILS_ROOT=File.join(File.dirname(__FILE__), '../')
13
+
14
+ RSpec.configure do |config|
20
15
  config.mock_with :mocha
21
16
  end
17
+
metadata CHANGED
@@ -1,180 +1,255 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: ankh
3
- version: !ruby/object:Gem::Version
4
- hash: 29
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 1
9
- - 3
10
- version: 0.1.3
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Dan Pickett
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-10-23 00:00:00 -04:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
22
- name: activerecord
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
12
+ date: 2011-12-14 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: activesupport
16
+ requirement: &2153276320 !ruby/object:Gem::Requirement
25
17
  none: false
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 11
30
- segments:
31
- - 2
32
- - 3
33
- - 4
34
- version: 2.3.4
18
+ requirements:
19
+ - - ! '>'
20
+ - !ruby/object:Gem::Version
21
+ version: '3.0'
35
22
  type: :runtime
36
- version_requirements: *id001
37
- - !ruby/object:Gem::Dependency
38
- name: activesupport
39
23
  prerelease: false
40
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *2153276320
25
+ - !ruby/object:Gem::Dependency
26
+ name: configatron
27
+ requirement: &2153275760 !ruby/object:Gem::Requirement
41
28
  none: false
42
- requirements:
43
- - - ">="
44
- - !ruby/object:Gem::Version
45
- hash: 11
46
- segments:
47
- - 2
48
- - 3
49
- - 4
50
- version: 2.3.4
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
51
33
  type: :runtime
52
- version_requirements: *id002
53
- - !ruby/object:Gem::Dependency
54
- name: configatron
55
34
  prerelease: false
56
- requirement: &id003 !ruby/object:Gem::Requirement
35
+ version_requirements: *2153275760
36
+ - !ruby/object:Gem::Dependency
37
+ name: sqlite3
38
+ requirement: &2153275120 !ruby/object:Gem::Requirement
57
39
  none: false
58
- requirements:
59
- - - "="
60
- - !ruby/object:Gem::Version
61
- hash: 17
62
- segments:
63
- - 2
64
- - 6
65
- - 3
66
- version: 2.6.3
67
- type: :runtime
68
- version_requirements: *id003
69
- - !ruby/object:Gem::Dependency
70
- name: rspec
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ type: :development
71
45
  prerelease: false
72
- requirement: &id004 !ruby/object:Gem::Requirement
46
+ version_requirements: *2153275120
47
+ - !ruby/object:Gem::Dependency
48
+ name: rake
49
+ requirement: &2153274580 !ruby/object:Gem::Requirement
73
50
  none: false
74
- requirements:
75
- - - ">="
76
- - !ruby/object:Gem::Version
77
- hash: 13
78
- segments:
79
- - 1
80
- - 2
81
- - 9
82
- version: 1.2.9
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
83
55
  type: :development
84
- version_requirements: *id004
85
- - !ruby/object:Gem::Dependency
86
- name: cucumber
87
56
  prerelease: false
88
- requirement: &id005 !ruby/object:Gem::Requirement
57
+ version_requirements: *2153274580
58
+ - !ruby/object:Gem::Dependency
59
+ name: rails
60
+ requirement: &2153273820 !ruby/object:Gem::Requirement
89
61
  none: false
90
- requirements:
91
- - - ">="
92
- - !ruby/object:Gem::Version
93
- hash: 3
94
- segments:
95
- - 0
96
- version: "0"
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
97
66
  type: :development
98
- version_requirements: *id005
99
- - !ruby/object:Gem::Dependency
100
- name: mocha
101
67
  prerelease: false
102
- requirement: &id006 !ruby/object:Gem::Requirement
68
+ version_requirements: *2153273820
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec
71
+ requirement: &2153272960 !ruby/object:Gem::Requirement
103
72
  none: false
104
- requirements:
105
- - - ">="
106
- - !ruby/object:Gem::Version
107
- hash: 3
108
- segments:
109
- - 0
110
- version: "0"
73
+ requirements:
74
+ - - ! '>'
75
+ - !ruby/object:Gem::Version
76
+ version: 1.2.9
111
77
  type: :development
112
- version_requirements: *id006
113
- description: |-
114
- Use Ankh in your Rails (2.3.x or 3.0) projects to protect against bots and other spam producers. It asks a simple
115
- arithmatic question to verify that the poster is human.
116
- email: dpickett@enlightsolutions.com
78
+ prerelease: false
79
+ version_requirements: *2153272960
80
+ - !ruby/object:Gem::Dependency
81
+ name: mocha
82
+ requirement: &2153272320 !ruby/object:Gem::Requirement
83
+ none: false
84
+ requirements:
85
+ - - ! '>='
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
88
+ type: :development
89
+ prerelease: false
90
+ version_requirements: *2153272320
91
+ description: Protect against bots and other spam producers
92
+ email:
93
+ - dpickett@enlightsolutions.com
117
94
  executables: []
118
-
119
95
  extensions: []
120
-
121
- extra_rdoc_files:
122
- - LICENSE
123
- - README.rdoc
124
- files:
96
+ extra_rdoc_files: []
97
+ files:
125
98
  - .document
99
+ - .gitignore
100
+ - .rspec
101
+ - .rvmrc
102
+ - Gemfile
126
103
  - LICENSE
127
104
  - README.rdoc
128
105
  - Rakefile
129
106
  - VERSION
130
107
  - ankh.gemspec
131
- - features/ankh.feature
132
- - features/step_definitions/ankh_steps.rb
133
- - features/support/env.rb
108
+ - lib/..rb
134
109
  - lib/ankh.rb
135
110
  - lib/ankh/model.rb
136
111
  - lib/ankh/question.rb
137
- - lib/ankh/rails/legacy.rb
138
- - lib/ankh/validations/human.rb
112
+ - lib/ankh/railtie.rb
113
+ - lib/ankh/validations/human_validator.rb
114
+ - lib/ankh/version.rb
139
115
  - spec/ankh/model_spec.rb
140
116
  - spec/ankh/question_spec.rb
141
117
  - spec/ankh_spec.rb
142
- - spec/spec.opts
118
+ - spec/dummy/Rakefile
119
+ - spec/dummy/api_docs/api_authentication.markdown
120
+ - spec/dummy/api_docs/api_user_creates_user.markdown
121
+ - spec/dummy/api_docs/partner_creation.markdown
122
+ - spec/dummy/api_docs/topic_creation.markdown
123
+ - spec/dummy/api_docs/user_creation.markdown
124
+ - spec/dummy/app/assets/javascripts/application.js
125
+ - spec/dummy/app/assets/stylesheets/application.css
126
+ - spec/dummy/app/controllers/application_controller.rb
127
+ - spec/dummy/app/helpers/application_helper.rb
128
+ - spec/dummy/app/mailers/.gitkeep
129
+ - spec/dummy/app/models/.gitkeep
130
+ - spec/dummy/app/views/devise/confirmations/new.html.erb
131
+ - spec/dummy/app/views/devise/mailer/confirmation_instructions.html.erb
132
+ - spec/dummy/app/views/devise/mailer/reset_password_instructions.html.erb
133
+ - spec/dummy/app/views/devise/mailer/unlock_instructions.html.erb
134
+ - spec/dummy/app/views/devise/passwords/edit.html.erb
135
+ - spec/dummy/app/views/devise/passwords/new.html.erb
136
+ - spec/dummy/app/views/devise/registrations/edit.html.erb
137
+ - spec/dummy/app/views/devise/registrations/new.html.erb
138
+ - spec/dummy/app/views/devise/sessions/new.html.erb
139
+ - spec/dummy/app/views/devise/sessions/new.mobile.erb
140
+ - spec/dummy/app/views/devise/shared/_links.erb
141
+ - spec/dummy/app/views/devise/unlocks/new.html.erb
142
+ - spec/dummy/config.ru
143
+ - spec/dummy/config/application.rb
144
+ - spec/dummy/config/boot.rb
145
+ - spec/dummy/config/database.yml
146
+ - spec/dummy/config/environment.rb
147
+ - spec/dummy/config/environments/development.rb
148
+ - spec/dummy/config/environments/production.rb
149
+ - spec/dummy/config/environments/test.rb
150
+ - spec/dummy/config/initializers/backtrace_silencers.rb
151
+ - spec/dummy/config/initializers/inflections.rb
152
+ - spec/dummy/config/initializers/mime_types.rb
153
+ - spec/dummy/config/initializers/secret_token.rb
154
+ - spec/dummy/config/initializers/session_store.rb
155
+ - spec/dummy/config/initializers/wrap_parameters.rb
156
+ - spec/dummy/config/locales/en.yml
157
+ - spec/dummy/config/routes.rb
158
+ - spec/dummy/db/development.sqlite3
159
+ - spec/dummy/db/schema.rb
160
+ - spec/dummy/db/test.sqlite3
161
+ - spec/dummy/lib/assets/.gitkeep
162
+ - spec/dummy/log/.gitkeep
163
+ - spec/dummy/log/development.log
164
+ - spec/dummy/public/404.html
165
+ - spec/dummy/public/422.html
166
+ - spec/dummy/public/500.html
167
+ - spec/dummy/public/favicon.ico
168
+ - spec/dummy/script/rails
143
169
  - spec/spec_helper.rb
144
- - spec/support/active_record_spec_helper.rb
145
- has_rdoc: true
146
- homepage: http://github.com/dpickett/ankh
170
+ homepage: ''
147
171
  licenses: []
148
-
149
172
  post_install_message:
150
173
  rdoc_options: []
151
-
152
- require_paths:
174
+ require_paths:
153
175
  - lib
154
- required_ruby_version: !ruby/object:Gem::Requirement
176
+ required_ruby_version: !ruby/object:Gem::Requirement
155
177
  none: false
156
- requirements:
157
- - - ">="
158
- - !ruby/object:Gem::Version
159
- hash: 3
160
- segments:
178
+ requirements:
179
+ - - ! '>='
180
+ - !ruby/object:Gem::Version
181
+ version: '0'
182
+ segments:
161
183
  - 0
162
- version: "0"
163
- required_rubygems_version: !ruby/object:Gem::Requirement
184
+ hash: -4469238890165927442
185
+ required_rubygems_version: !ruby/object:Gem::Requirement
164
186
  none: false
165
- requirements:
166
- - - ">="
167
- - !ruby/object:Gem::Version
168
- hash: 3
169
- segments:
187
+ requirements:
188
+ - - ! '>='
189
+ - !ruby/object:Gem::Version
190
+ version: '0'
191
+ segments:
170
192
  - 0
171
- version: "0"
193
+ hash: -4469238890165927442
172
194
  requirements: []
173
-
174
195
  rubyforge_project:
175
- rubygems_version: 1.4.2
196
+ rubygems_version: 1.8.6
176
197
  signing_key:
177
198
  specification_version: 3
178
- summary: Protect against bots and other spam producers with simple mathematical questions
179
- test_files: []
180
-
199
+ summary: Asks simple randomized questions to detect humans
200
+ test_files:
201
+ - spec/ankh/model_spec.rb
202
+ - spec/ankh/question_spec.rb
203
+ - spec/ankh_spec.rb
204
+ - spec/dummy/Rakefile
205
+ - spec/dummy/api_docs/api_authentication.markdown
206
+ - spec/dummy/api_docs/api_user_creates_user.markdown
207
+ - spec/dummy/api_docs/partner_creation.markdown
208
+ - spec/dummy/api_docs/topic_creation.markdown
209
+ - spec/dummy/api_docs/user_creation.markdown
210
+ - spec/dummy/app/assets/javascripts/application.js
211
+ - spec/dummy/app/assets/stylesheets/application.css
212
+ - spec/dummy/app/controllers/application_controller.rb
213
+ - spec/dummy/app/helpers/application_helper.rb
214
+ - spec/dummy/app/mailers/.gitkeep
215
+ - spec/dummy/app/models/.gitkeep
216
+ - spec/dummy/app/views/devise/confirmations/new.html.erb
217
+ - spec/dummy/app/views/devise/mailer/confirmation_instructions.html.erb
218
+ - spec/dummy/app/views/devise/mailer/reset_password_instructions.html.erb
219
+ - spec/dummy/app/views/devise/mailer/unlock_instructions.html.erb
220
+ - spec/dummy/app/views/devise/passwords/edit.html.erb
221
+ - spec/dummy/app/views/devise/passwords/new.html.erb
222
+ - spec/dummy/app/views/devise/registrations/edit.html.erb
223
+ - spec/dummy/app/views/devise/registrations/new.html.erb
224
+ - spec/dummy/app/views/devise/sessions/new.html.erb
225
+ - spec/dummy/app/views/devise/sessions/new.mobile.erb
226
+ - spec/dummy/app/views/devise/shared/_links.erb
227
+ - spec/dummy/app/views/devise/unlocks/new.html.erb
228
+ - spec/dummy/config.ru
229
+ - spec/dummy/config/application.rb
230
+ - spec/dummy/config/boot.rb
231
+ - spec/dummy/config/database.yml
232
+ - spec/dummy/config/environment.rb
233
+ - spec/dummy/config/environments/development.rb
234
+ - spec/dummy/config/environments/production.rb
235
+ - spec/dummy/config/environments/test.rb
236
+ - spec/dummy/config/initializers/backtrace_silencers.rb
237
+ - spec/dummy/config/initializers/inflections.rb
238
+ - spec/dummy/config/initializers/mime_types.rb
239
+ - spec/dummy/config/initializers/secret_token.rb
240
+ - spec/dummy/config/initializers/session_store.rb
241
+ - spec/dummy/config/initializers/wrap_parameters.rb
242
+ - spec/dummy/config/locales/en.yml
243
+ - spec/dummy/config/routes.rb
244
+ - spec/dummy/db/development.sqlite3
245
+ - spec/dummy/db/schema.rb
246
+ - spec/dummy/db/test.sqlite3
247
+ - spec/dummy/lib/assets/.gitkeep
248
+ - spec/dummy/log/.gitkeep
249
+ - spec/dummy/log/development.log
250
+ - spec/dummy/public/404.html
251
+ - spec/dummy/public/422.html
252
+ - spec/dummy/public/500.html
253
+ - spec/dummy/public/favicon.ico
254
+ - spec/dummy/script/rails
255
+ - spec/spec_helper.rb