CountryRejector

Rack middleware that ban any IP located in a ban list.
Installation
Add this line to your application's Gemfile:
gem 'country_rejector'
And then execute:
$ bundle
Or install it yourself as:
$ gem install country_rejector
Usage
Add this line in your application.rb
config.middleware.use "CountryRejector::Middleware"
Create an initializer file (rack_reject_countries.rb)
CountryRejector::Middleware.configure do |config|
config.banned_list = ::Gaston.countries.banned
end
Advice
Don't use this middleware in your test environnement! ( It's a bad idea ).
So add this line in your environments/test.rb for example:
config.middleware.delete ::CountryRejector::Middleware
Testing the Gem
bundle exec rspec
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/Vodeclic/country_rejector.
License
Copyright © 2016 Vodeclic SAS released under the MIT License.