bot-away 1.2.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +14 -0
- data/History.txt +20 -0
- data/README.md +198 -0
- data/Rakefile +14 -94
- data/bot-away.gemspec +20 -87
- data/gemfiles/Gemfile.rails-3.0.x +8 -0
- data/gemfiles/Gemfile.rails-3.0.x.lock +121 -0
- data/gemfiles/Gemfile.rails-3.1.x +8 -0
- data/gemfiles/Gemfile.rails-3.1.x.lock +133 -0
- data/lib/bot-away.rb +15 -13
- data/lib/bot-away/action_dispatch/params_parser.rb +22 -0
- data/lib/bot-away/action_view/helpers/instance_tag.rb +36 -12
- data/lib/bot-away/param_parser.rb +2 -2
- data/lib/bot-away/railtie.rb +10 -0
- data/lib/bot-away/test_case.rb +58 -0
- data/lib/bot-away/test_case/controller_test_case.rb +11 -0
- data/lib/bot-away/test_case/instance_tag_test_case.rb +15 -0
- data/lib/bot-away/test_case/matchers.rb +20 -0
- data/lib/bot-away/test_case/matchers/honeypot_matcher.rb +30 -0
- data/lib/bot-away/test_case/matchers/obfuscation_matcher.rb +30 -0
- data/lib/bot-away/test_case/mock_object.rb +16 -0
- data/lib/bot-away/version.rb +12 -0
- data/lib/locale/honeypots.yml +6 -0
- data/spec/controllers/basic_form_view_spec.rb +112 -0
- data/spec/controllers/{test_controller_spec.rb → tests_controller_spec.rb} +29 -80
- data/spec/integration/params_post_spec.rb +42 -0
- data/spec/lib/action_view/helpers/instance_tag_spec.rb +94 -0
- data/spec/{views/lib → lib/action_view}/param_parser_spec.rb +10 -10
- data/spec/spec_helper.rb +37 -105
- data/spec/test_rails_app/app/controllers/tests_controller.rb +11 -0
- data/spec/test_rails_app/app/models/post.rb +13 -0
- data/spec/test_rails_app/app/views/tests/basic_form.html.erb +5 -0
- data/spec/test_rails_app/app/views/tests/model_form.html.erb +12 -0
- data/spec/test_rails_app/config/locales/bot-away-overrides.yml +6 -0
- data/spec/views/form_builder_spec.rb +118 -0
- metadata +94 -137
- data/Manifest.txt +0 -23
- data/README.rdoc +0 -179
- data/VERSION +0 -1
- data/lib/bot-away/action_dispatch/request.rb +0 -20
- data/spec/rspec_version.rb +0 -19
- data/spec/support/honeypot_matcher.rb +0 -30
- data/spec/support/obfuscation_helper.rb +0 -123
- data/spec/support/obfuscation_matcher.rb +0 -28
- data/spec/support/rails/mock_logger.rb +0 -21
- data/spec/support/test_controller.rb +0 -28
- data/spec/support/views/test/index.html.erb +0 -4
- data/spec/support/views/test/model_form.html.erb +0 -6
- data/spec/views/lib/action_view/helpers/instance_tag_spec.rb +0 -75
- data/spec/views/lib/disabled_for_spec.rb +0 -101
- data/spec/views/lib/form_builder_spec.rb +0 -56
data/.travis.yml
ADDED
data/History.txt
CHANGED
@@ -1,3 +1,23 @@
|
|
1
|
+
=== 2.0.0 2012-01-13
|
2
|
+
* Bumped major version number to signify that the version for Rails v2.x is no longer under active development.
|
3
|
+
Use v1.2.x under Rails 2. BotAway now officially supports only Rails 3.0.x and up.
|
4
|
+
* Enhancements:
|
5
|
+
* Removed sc-core-ext as a dependency, reducing bloat.
|
6
|
+
* Added BotAway::TestCase and friends, in case you need to do some spec'ing of your own. Just include the modules
|
7
|
+
and away you go!
|
8
|
+
* Added I18n support! BotAway supports English language for 3 honeypot warnings out of the box. See README for
|
9
|
+
customization instructions.
|
10
|
+
* Honeypot warning messages are constructed as reversed, unicode-escaped strings displayed within right-to-left
|
11
|
+
directional tags (which are standard in HTML 4 and should be recognized by all browsers), so that in the unlikely
|
12
|
+
event a bot can figure out what your I18n locale's "don't fill this in" text means, it'll also have to figure out
|
13
|
+
how to read the text in reverse after unescaping the unicode characters. Obviously, human users won't have this
|
14
|
+
problem.
|
15
|
+
* To disable obfuscation of the honeypot warning messages (that is, serve them as plain left-to-right text), add
|
16
|
+
the line `BotAway.obfuscate_honeypot_warning_messages = false` to `config/initializers/bot-away.rb`.
|
17
|
+
* Bugfix
|
18
|
+
* Select tag options untainted (#1). Select tags now produce html-safe options tags, so they don't culminate
|
19
|
+
in mass confusion.
|
20
|
+
|
1
21
|
=== 1.2.0 2010-10-14
|
2
22
|
* Enhancements:
|
3
23
|
* Rails 3 / RSpec 2 support! Yay!
|
data/README.md
ADDED
@@ -0,0 +1,198 @@
|
|
1
|
+
# bot-away [![Build Status](https://secure.travis-ci.org/sinisterchipmunk/bot-away.png)](http://travis-ci.org/sinisterchipmunk/bot-away)
|
2
|
+
|
3
|
+
* http://github.com/sinisterchipmunk/bot-away
|
4
|
+
|
5
|
+
Unobtrusively detects form submissions made by spambots, and silently drops those submissions. The key word here is
|
6
|
+
"unobtrusive" -- this is NOT a CAPTCHA. This is a transparent, modular implementation of the bot-catching techniques
|
7
|
+
discussed by Ned Batchelder at http://nedbatchelder.com/text/stopbots.html.
|
8
|
+
|
9
|
+
## How It Works
|
10
|
+
|
11
|
+
If a bot submission is detected, the params hash is cleared, so the data can't be used. Since this includes the
|
12
|
+
authenticity token, Rails should complain about an invalid or missing authenticity token. Congrats, spam blocked.
|
13
|
+
|
14
|
+
The specifics of the techniques employed for filtering spambots are discussed Ned's site in the description; however,
|
15
|
+
here's a brief run-down of what's going on:
|
16
|
+
|
17
|
+
* Your code stays the same. After the Bot-Away gem has been activated, all Rails-generated forms on your site
|
18
|
+
will automatically be transformed into bot-resistent forms.
|
19
|
+
* All of the form elements that you create (for instance, a "comment" model with a "body" field) are turned into
|
20
|
+
dummy elements, or honeypots, and are made invisible to the end user. This is done using div elements and inline
|
21
|
+
CSS stylesheets (I decided against a JavaScript option because it's the most likely to be disabled on a legitimate
|
22
|
+
client). There are several ways an element can be hidden, and these approaches are chosen at random to help
|
23
|
+
minimize predictability.
|
24
|
+
* In the rare event that a real user actually can see the element, it has a label next to it
|
25
|
+
along the lines of "Leave this blank" -- though the exact message is randomized to help prevent detection by
|
26
|
+
bots.
|
27
|
+
* All of the form elements are mirrored by hashes. The hashes are generated using the session's authenticity token,
|
28
|
+
so they can't be predicted.
|
29
|
+
* When data is submitted, Bot-Away steps in and
|
30
|
+
1. validates that no honeypots have been filled in; and
|
31
|
+
2. converts the hashed elements back into the field names that you are expecting (replacing the honeypot fields).
|
32
|
+
Your code is never aware of the difference; it's just business as usual as long as the user is legitimate.
|
33
|
+
* If a honeypot has been filled in, or a hashed element is missing where it was expected, then the request is
|
34
|
+
considered to be either spam, or tampered with; and the entire params hash is emptied. Since this happens at the
|
35
|
+
lowest level, the most likely result is that Rails will complain that the user's authenticity token is invalid. If
|
36
|
+
that does not happen, then your code will be passed a params hash containing only a "suspected_bot" key, and an
|
37
|
+
error will result. Either way, the spambot has been foiled!
|
38
|
+
|
39
|
+
## Installation:
|
40
|
+
|
41
|
+
* gem install bot-away
|
42
|
+
|
43
|
+
## Usage:
|
44
|
+
|
45
|
+
Whether you're on Rails 2 or Rails 3, adding Bot-Away to your project is as easy as telling Rails where to find it.
|
46
|
+
|
47
|
+
### Rails 2.x
|
48
|
+
|
49
|
+
The Rails 2.x version will still receive bug fixes, but is no longer under active development. To use bot-away with Rails 2, pull in bot-away v1.x:
|
50
|
+
|
51
|
+
# in config/environment.rb:
|
52
|
+
config.gem 'bot-away', '~> 1.2'
|
53
|
+
|
54
|
+
### Rails 3
|
55
|
+
|
56
|
+
# in Gemfile
|
57
|
+
gem 'bot-away', '~> 2.0'
|
58
|
+
|
59
|
+
That's it.
|
60
|
+
|
61
|
+
## Whitelists
|
62
|
+
|
63
|
+
Sometimes you don't care about whether or not a bot is filling out a particular form. Even more, sometimes it's
|
64
|
+
preferable to make a form bot-friendly. I'm talking specifically about login forms, where all sorts of people
|
65
|
+
use bots (their Web browsers, usually) in order to prefill the form with their login information. This is perfectly
|
66
|
+
harmless, and even a malicious bot is not going to be able to cause any trouble on a form like this because it'll only be denied access to the site.
|
67
|
+
|
68
|
+
In cases like these, you'll want to go ahead and disable Bot-Away. Since Bot-Away is only disabled on a per-controller or per-action basis, it stays active throughout the remainder of your site, which prevents bots from (for example) creating new users.
|
69
|
+
|
70
|
+
To disable Bot-Away for an entire controller, add this line to a file called `config/initializers/bot-away.rb`:
|
71
|
+
|
72
|
+
BotAway.disabled_for :controller => 'sessions'
|
73
|
+
|
74
|
+
And here's how to do the same for a specific action, leaving Bot-Away active for all other actions:
|
75
|
+
|
76
|
+
BotAway.disabled_for :controller => 'sessions', :action => 'login'
|
77
|
+
|
78
|
+
You can also disable Bot-Away for a given action in every controller, but I'm not sure how useful that is. In any case, here's how to do it:
|
79
|
+
|
80
|
+
BotAway.disabled_for :action => 'index' # all we did was omit :controller
|
81
|
+
|
82
|
+
This line can be specified multiple times, for each of the controllers and/or actions that you need it disabled for.
|
83
|
+
|
84
|
+
## Disabling Bot-Away in Development
|
85
|
+
|
86
|
+
If, while developing your app, you find yourself viewing the HTML source code, it'll probably be more helpful
|
87
|
+
to have Bot-Away disabled entirely so that you're not confused by MD5 tags and legions of honeypots. This is easy enough to do:
|
88
|
+
|
89
|
+
BotAway.disabled_for :mode => 'development'
|
90
|
+
|
91
|
+
## Accepting Unfiltered Params
|
92
|
+
|
93
|
+
Sometimes you need to tell Bot-Away to explicitly _not_ filter a parameter. This is most notable with fields you've
|
94
|
+
dynamically added via JavaScript, since those can confuse Bot-Away's catching techniques. (It tends to think Javascript-
|
95
|
+
generated fields are honeypots, and raises an error based on that.) Here's how to tell Bot-Away that such fields are
|
96
|
+
not to be checked:
|
97
|
+
|
98
|
+
BotAway.accepts_unfiltered_params "name_of_param", "name_of_another_param"
|
99
|
+
|
100
|
+
Note that these parameters can be either model keys, field keys or exact matches. For example, imagine the following
|
101
|
+
scenario: you have two models, `User` and `Group`, and each `has_many :roles`. That means you'll likely have an administration screen somewhere with check boxes representing user roles and group roles. Here are the different ways you can control how Bot-Away interacts with these fields:
|
102
|
+
|
103
|
+
BotAway.accepts_unfiltered_params "user"
|
104
|
+
# disables BotAway filtering for ALL fields belonging to 'user', but NO fields belonging to 'group'
|
105
|
+
|
106
|
+
BotAway.accepts_unfiltered_params 'user[role_ids]', 'group[role_ids]'
|
107
|
+
# disables BotAway filtering for ONLY the 'role_ids' field belonging to BOTH 'user' and 'group', while leaving
|
108
|
+
# filtering enabled for ALL OTHER fields.
|
109
|
+
|
110
|
+
BotAway.accepts_unfiltered_params 'role_ids'
|
111
|
+
# disables BotAway filtering for ONLY the 'role_ids' fields belonging to ALL MODELS, while leaving all
|
112
|
+
# other fields enabled.
|
113
|
+
|
114
|
+
You can specify this option as many times as you need to do.
|
115
|
+
|
116
|
+
## I18n
|
117
|
+
|
118
|
+
BotAway is mostly code, and produces mostly code, so there's not that much to translate. However, as mentioned above, the honeypots could theoretically be seen by humans in some rare cases (if they have an exceedingly simplistic browser or have disabled such fundamental Web controls as CSS). In these rare cases, BotAway prefixes the honeypot fields with a message akin to "Leave This Field Empty".
|
119
|
+
|
120
|
+
To further confound smart bots, these messages are chosen at random and by default there are 3 such messages BotAway can choose from. However, BotAway only supports the English language by default, so if you are targeting other languages you'll want to add translations. Also, to give your Web app a bit of personalization (highly recommended, if you want to keep the bot-builders guessing!) then you'll want to override and/or add to the English messages as well!
|
121
|
+
|
122
|
+
To do this, create a file in `config/locales/bot-away.yml` and add content such as this:
|
123
|
+
|
124
|
+
en:
|
125
|
+
bot_away:
|
126
|
+
number_of_honeypot_warning_messages: 3
|
127
|
+
honeypot_warning_1: "Leave this empty: "
|
128
|
+
honeypot_warning_2: "Don't fill this in: "
|
129
|
+
honeypot_warning_3: "Keep this blank: "
|
130
|
+
|
131
|
+
Shown above is exactly what resides in the default BotAway locale. Change the contents of warning strings 1 through 3 within your own app to override them; change the `number_of_honeypot_warning_messages` field to cause BotAway to choose randomly from more or fewer messages. Also, as the above example implies, you can set a different number of randomized warnings per language.
|
132
|
+
|
133
|
+
* If you'd like to add some warning messages to BotAway in currently-unsupported languages (or if you just want
|
134
|
+
BotAway to have more messages to choose from) then your additions are welcome! Please fork this project,
|
135
|
+
update the
|
136
|
+
[lib/locale/honeypots.yml](https://github.com/sinisterchipmunk/bot-away/blob/master/lib/locale/honeypots.yml)
|
137
|
+
file with your changes, and then send me a pull request!
|
138
|
+
|
139
|
+
* Honeypot warning messages are obfuscated: they are sent as reversed, unicode-escaped strings displayed within
|
140
|
+
right-to-left directional tags (which are standard in HTML 4 and should be recognized by all browsers), so that in
|
141
|
+
the unlikely event a bot can figure out what your I18n locale's "don't fill this in" text means, it'll also have to
|
142
|
+
figure out how to read the text in reverse after unescaping the unicode characters. Obviously, human users won't
|
143
|
+
have this problem.
|
144
|
+
* To disable obfuscation of the honeypot warning messages (that is, serve them as plain left-to-right text), add
|
145
|
+
the line `BotAway.obfuscate_honeypot_warning_messages = false` to `config/initializers/bot-away.rb`.
|
146
|
+
|
147
|
+
|
148
|
+
## Further Configuration (Mostly for Debugging):
|
149
|
+
|
150
|
+
In general, Bot-Away doesn't have that much to configure. Most options only exist for your debugging pleasure, in
|
151
|
+
case something isn't quite working as you'd expected. As shown above, these settings should be specified in a file
|
152
|
+
called `config/initializers/bot-away.rb`. Configuration options available to you are as follows:
|
153
|
+
|
154
|
+
### Showing the Honeypots
|
155
|
+
|
156
|
+
Generally, you want to keep honeypots hidden, because they will clutter your interface and confuse your users. However, there was an issue awhile back (near the 1.0 release of Bot-Away) where Safari was a bit smarter than its competitors, successfully prefilling honeypots with data where Chrome, FF and IE all failed to do so. Eventually, I added the ability to show honeypots on the screen, proving my suspicion that Safari was being "too smart". After resolving the issue, I decided to leave this option available to Bot-Away as a debugging tool for handling future issues. To enable:
|
157
|
+
|
158
|
+
BotAway.show_honeypots = true
|
159
|
+
|
160
|
+
### Dumping Params
|
161
|
+
|
162
|
+
Like showing honeypots, above, this option is only useful if you're debugging issues in development
|
163
|
+
mode. You can enable this if you need to see exactly what Rails sees _before_ Bot-Away steps in to intervene. Enabling this is a major security risk in production mode because it'll include sensitive data such as passwords; but it's very useful for debugging false positives (that is, Bot-Away thinks you're a bot, but you're not).
|
164
|
+
|
165
|
+
BotAway.dump_params = true
|
166
|
+
|
167
|
+
## Features / Problems:
|
168
|
+
|
169
|
+
* Wherever protection from forgery is not enabled in your Rails app, the Rails forms will be generated as if this gem
|
170
|
+
did not exist. That means hashed elements won't be generated, honeypots won't be generated, and posted forms will
|
171
|
+
not be intercepted.
|
172
|
+
|
173
|
+
* By default, protection from forgery is enabled for all Rails controllers, so by default the above-mentioned checks
|
174
|
+
will also be triggered. For more details on forgery protection, see:
|
175
|
+
http://api.rubyonrails.org/classes/ActionController/RequestForgeryProtection.html
|
176
|
+
|
177
|
+
* The techniques implemented by this library will be very difficult for a spambot to circumvent. However, keep in
|
178
|
+
mind that since the pages have to be machine-readable by definition, and since this gem has to follow certain
|
179
|
+
protocols in order to avoid confusing lots of humans (such as hiding the honeypots), it is always theoretically
|
180
|
+
possible for a spambot to get around it. It's just very, very difficult.
|
181
|
+
|
182
|
+
* I feel this library has been fairly well-tested (99.21% test coverage as of this writing), but if you discover a
|
183
|
+
bug and can't be bothered to let me know about it (or you just don't have time to wait for a fix or fix it
|
184
|
+
yourself), then you can simply add the name of the offending form element to the BotAway.unfiltered_params
|
185
|
+
array like so:
|
186
|
+
BotAway.accepts_unfiltered_params 'role_ids'
|
187
|
+
BotAway.accepts_unfiltered_params 'user' # this can be called multiple times
|
188
|
+
You should also take note that this is an array, not a hash. So if you have a `user[role_ids]` as well as a
|
189
|
+
`group[role_ids]`, the `role_ids` will not be filtered on EITHER of these models.
|
190
|
+
|
191
|
+
* Currently, there's no direct support for per-request configuration of unfiltered params. This is mostly due to
|
192
|
+
Bot-Away's low-level approach to filtering bots: the params have already been filtered by the time your controller
|
193
|
+
is created. I'd like to revisit per-request filtering sometime in the future, once I figure out the best way to do
|
194
|
+
it.
|
195
|
+
|
196
|
+
## Requirements:
|
197
|
+
|
198
|
+
* Rails 3.0 or better.
|
data/Rakefile
CHANGED
@@ -1,102 +1,22 @@
|
|
1
|
-
|
2
|
-
require '
|
1
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("gemfiles/Gemfile.rails-3.1.x", File.dirname(__FILE__))
|
2
|
+
require 'bundler/gem_tasks'
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
gem.name = 'bot-away'
|
8
|
-
gem.summary = %Q{Unobtrusively detects form submissions made by spambots, and silently drops those submissions.}
|
9
|
-
gem.description = %Q{Unobtrusively detects form submissions made by spambots, and silently drops those submissions.}
|
10
|
-
gem.email = "sinisterchipmunk@gmail.com"
|
11
|
-
gem.homepage = "http://www.thoughtsincomputation.com"
|
12
|
-
gem.authors = ["Colin MacKenzie IV"]
|
13
|
-
gem.add_dependency "actionpack", ">= 2.3.5"
|
14
|
-
gem.add_dependency "sc-core-ext", ">= 1.1.1"
|
15
|
-
gem.add_development_dependency "jeweler", ">= 1.4.0"
|
16
|
-
gem.add_development_dependency "rspec", ">= 1.3.0"
|
17
|
-
gem.add_development_dependency "rspec-rails", ">= 1.3.2"
|
18
|
-
end
|
19
|
-
Jeweler::GemcutterTasks.new
|
20
|
-
rescue LoadError
|
21
|
-
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
4
|
+
require 'rspec/core/rake_task'
|
5
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
6
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
22
7
|
end
|
23
8
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
RSpec::Core::RakeTask.new(:
|
28
|
-
|
29
|
-
|
30
|
-
else # Rake task for 1.3.x
|
31
|
-
Spec::Rake::SpecTask.new(:spec) do |spec|
|
32
|
-
spec.libs << 'lib' << 'spec'
|
33
|
-
spec.spec_files = FileList['spec/**/*_spec.rb']
|
9
|
+
desc "Run all specs with rcov"
|
10
|
+
begin
|
11
|
+
require 'rcov'
|
12
|
+
RSpec::Core::RakeTask.new(:rcov) do |t|
|
13
|
+
t.rcov = true
|
14
|
+
t.rcov_opts = %w{--exclude osx\/objc,gems\/,spec\/,features\/,lib\/bot-away\/test_case\/}
|
34
15
|
end
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
spec.pattern = 'spec/**/*_spec.rb'
|
39
|
-
spec.rcov = true
|
16
|
+
rescue LoadError
|
17
|
+
task :rcov do
|
18
|
+
raise "Install rcov first: gem install rcov"
|
40
19
|
end
|
41
20
|
end
|
42
21
|
|
43
|
-
task :spec => :check_dependencies
|
44
22
|
task :default => :spec
|
45
|
-
|
46
|
-
require 'rake/rdoctask'
|
47
|
-
Rake::RDocTask.new do |rdoc|
|
48
|
-
version = File.exist?("VERSION") ? File.read("VERSION") : ""
|
49
|
-
rdoc.rdoc_dir = 'rdoc'
|
50
|
-
rdoc.title = "bot-away #{version}"
|
51
|
-
rdoc.rdoc_files.include("README*")
|
52
|
-
rdoc.rdoc_files.include("*")
|
53
|
-
rdoc.rdoc_files.include("lib/**/*.rb")
|
54
|
-
end
|
55
|
-
|
56
|
-
=begin
|
57
|
-
require 'rubygems'
|
58
|
-
gem 'hoe', '>= 2.1.0'
|
59
|
-
require 'hoe'
|
60
|
-
require 'fileutils'
|
61
|
-
require './lib/bot-away'
|
62
|
-
|
63
|
-
Hoe.plugin :newgem
|
64
|
-
# Hoe.plugin :website
|
65
|
-
# Hoe.plugin :cucumberfeatures
|
66
|
-
|
67
|
-
# Generate all the Rake tasks
|
68
|
-
# Run 'rake -T' to see list of generated tasks (from gem root directory)
|
69
|
-
$hoe = Hoe.spec 'bot-away' do
|
70
|
-
self.developer 'Colin MacKenzie IV', 'sinisterchipmunk@gmail.com'
|
71
|
-
self.extra_deps = [['actionpack','>= 2.3.5'],['sc-core-ext','>= 1.1.1']]
|
72
|
-
self.readme_file = "README.rdoc"
|
73
|
-
end
|
74
|
-
|
75
|
-
Rake::RDocTask.new(:docs) do |rdoc|
|
76
|
-
files = ['README.rdoc', # 'LICENSE', 'CHANGELOG',
|
77
|
-
'lib/**/*.rb', 'doc/**/*.rdoc']#, 'spec/*.rb']
|
78
|
-
rdoc.rdoc_files.add(files)
|
79
|
-
rdoc.main = 'README.rdoc'
|
80
|
-
rdoc.title = 'Bot-Away Documentation'
|
81
|
-
#rdoc.template = '/path/to/gems/allison-2.0/lib/allison'
|
82
|
-
rdoc.rdoc_dir = 'doc'
|
83
|
-
rdoc.options << '--line-numbers' << '--inline-source'
|
84
|
-
end
|
85
|
-
|
86
|
-
|
87
|
-
require 'newgem/tasks'
|
88
|
-
Dir['tasks/**/*.rake'].each { |t| load t }
|
89
|
-
|
90
|
-
require 'spec/rake/spectask'
|
91
|
-
|
92
|
-
desc "Run all examples with RCov"
|
93
|
-
Spec::Rake::SpecTask.new('rcov') do |t|
|
94
|
-
t.spec_files = FileList['spec/**/*_spec.rb']
|
95
|
-
t.rcov = true
|
96
|
-
t.rcov_opts = ['--exclude', 'spec,/home/*']
|
97
|
-
end
|
98
|
-
|
99
|
-
# TODO - want other tests/tasks run by default? Add them to the list
|
100
|
-
# remove_task :default
|
101
|
-
# task :default => [:spec, :features]
|
102
|
-
=end
|
data/bot-away.gemspec
CHANGED
@@ -1,96 +1,29 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
1
|
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "bot-away/version"
|
5
4
|
|
6
5
|
Gem::Specification.new do |s|
|
7
|
-
s.name
|
8
|
-
s.version
|
9
|
-
|
10
|
-
s.
|
11
|
-
s.
|
12
|
-
s.
|
6
|
+
s.name = "bot-away"
|
7
|
+
s.version = BotAway::VERSION
|
8
|
+
s.authors = ["Colin MacKenzie IV"]
|
9
|
+
s.email = ["sinisterchipmunk@gmail.com"]
|
10
|
+
s.homepage = "http://github.com/sinisterchipmunk/bot-away"
|
11
|
+
s.summary = %q{Unobtrusively detects form submissions made by spambots, and silently drops those submissions.}
|
13
12
|
s.description = %q{Unobtrusively detects form submissions made by spambots, and silently drops those submissions.}
|
14
|
-
|
13
|
+
|
14
|
+
s.rubyforge_project = "bot-away"
|
15
|
+
|
16
|
+
s.files = `git ls-files`.split("\n")
|
17
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
+
s.require_paths = ["lib"]
|
15
20
|
s.extra_rdoc_files = [
|
16
21
|
"LICENSE",
|
17
|
-
|
18
|
-
|
19
|
-
s.files = [
|
20
|
-
".gitignore",
|
21
|
-
"History.txt",
|
22
|
-
"LICENSE",
|
23
|
-
"Manifest.txt",
|
24
|
-
"README.rdoc",
|
25
|
-
"Rakefile",
|
26
|
-
"VERSION",
|
27
|
-
"bot-away.gemspec",
|
28
|
-
"lib/bot-away.rb",
|
29
|
-
"lib/bot-away/action_dispatch/request.rb",
|
30
|
-
"lib/bot-away/action_view/helpers/instance_tag.rb",
|
31
|
-
"lib/bot-away/param_parser.rb",
|
32
|
-
"lib/bot-away/spinner.rb",
|
33
|
-
"script/console",
|
34
|
-
"script/destroy",
|
35
|
-
"script/generate",
|
36
|
-
"spec/controllers/test_controller_spec.rb",
|
37
|
-
"spec/rspec_version.rb",
|
38
|
-
"spec/spec_helper.rb",
|
39
|
-
"spec/support/honeypot_matcher.rb",
|
40
|
-
"spec/support/obfuscation_helper.rb",
|
41
|
-
"spec/support/obfuscation_matcher.rb",
|
42
|
-
"spec/support/rails/mock_logger.rb",
|
43
|
-
"spec/support/test_controller.rb",
|
44
|
-
"spec/support/views/test/index.html.erb",
|
45
|
-
"spec/support/views/test/model_form.html.erb",
|
46
|
-
"spec/views/lib/action_view/helpers/instance_tag_spec.rb",
|
47
|
-
"spec/views/lib/disabled_for_spec.rb",
|
48
|
-
"spec/views/lib/form_builder_spec.rb",
|
49
|
-
"spec/views/lib/param_parser_spec.rb"
|
50
|
-
]
|
51
|
-
s.homepage = %q{http://www.thoughtsincomputation.com}
|
52
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
53
|
-
s.require_paths = ["lib"]
|
54
|
-
s.rubygems_version = %q{1.3.7}
|
55
|
-
s.summary = %q{Unobtrusively detects form submissions made by spambots, and silently drops those submissions.}
|
56
|
-
s.test_files = [
|
57
|
-
"spec/controllers/test_controller_spec.rb",
|
58
|
-
"spec/rspec_version.rb",
|
59
|
-
"spec/spec_helper.rb",
|
60
|
-
"spec/support/honeypot_matcher.rb",
|
61
|
-
"spec/support/obfuscation_helper.rb",
|
62
|
-
"spec/support/obfuscation_matcher.rb",
|
63
|
-
"spec/support/rails/mock_logger.rb",
|
64
|
-
"spec/support/test_controller.rb",
|
65
|
-
"spec/views/lib/action_view/helpers/instance_tag_spec.rb",
|
66
|
-
"spec/views/lib/disabled_for_spec.rb",
|
67
|
-
"spec/views/lib/form_builder_spec.rb",
|
68
|
-
"spec/views/lib/param_parser_spec.rb"
|
22
|
+
"README.md",
|
23
|
+
"History.txt"
|
69
24
|
]
|
70
25
|
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
76
|
-
s.add_runtime_dependency(%q<actionpack>, [">= 2.3.5"])
|
77
|
-
s.add_runtime_dependency(%q<sc-core-ext>, [">= 1.1.1"])
|
78
|
-
s.add_development_dependency(%q<jeweler>, [">= 1.4.0"])
|
79
|
-
s.add_development_dependency(%q<rspec>, [">= 1.3.0"])
|
80
|
-
s.add_development_dependency(%q<rspec-rails>, [">= 1.3.2"])
|
81
|
-
else
|
82
|
-
s.add_dependency(%q<actionpack>, [">= 2.3.5"])
|
83
|
-
s.add_dependency(%q<sc-core-ext>, [">= 1.1.1"])
|
84
|
-
s.add_dependency(%q<jeweler>, [">= 1.4.0"])
|
85
|
-
s.add_dependency(%q<rspec>, [">= 1.3.0"])
|
86
|
-
s.add_dependency(%q<rspec-rails>, [">= 1.3.2"])
|
87
|
-
end
|
88
|
-
else
|
89
|
-
s.add_dependency(%q<actionpack>, [">= 2.3.5"])
|
90
|
-
s.add_dependency(%q<sc-core-ext>, [">= 1.1.1"])
|
91
|
-
s.add_dependency(%q<jeweler>, [">= 1.4.0"])
|
92
|
-
s.add_dependency(%q<rspec>, [">= 1.3.0"])
|
93
|
-
s.add_dependency(%q<rspec-rails>, [">= 1.3.2"])
|
94
|
-
end
|
26
|
+
s.add_runtime_dependency('actionpack', ">= 2.3.5")
|
27
|
+
s.add_development_dependency 'rake', '~> 0.9.2'
|
28
|
+
s.add_development_dependency 'capybara', '~> 1.1.2'
|
95
29
|
end
|
96
|
-
|