genius-blocker
所属分类:中间件编程
开发工具:Ruby
文件大小:7KB
下载次数:0
上传日期:2021-09-14 16:21:36
上 传 者:
sh-1993
说明: 机架中间件以阻止新闻Genius注释
(Rack Middleware to block News Genius annotations)
文件列表:
.rspec (31, 2021-09-15)
CODE_OF_CONDUCT.md (1434, 2021-09-15)
Gemfile (99, 2021-09-15)
LICENSE.txt (1079, 2021-09-15)
Rakefile (117, 2021-09-15)
bin (0, 2021-09-15)
bin\console (339, 2021-09-15)
bin\setup (115, 2021-09-15)
genius-blocker.gemspec (1402, 2021-09-15)
lib (0, 2021-09-15)
lib\genius (0, 2021-09-15)
lib\genius\blocker.rb (799, 2021-09-15)
lib\genius\blocker (0, 2021-09-15)
lib\genius\blocker\version.rb (62, 2021-09-15)
spec (0, 2021-09-15)
spec\genius (0, 2021-09-15)
spec\genius\blocker_spec.rb (1043, 2021-09-15)
spec\spec_helper.rb (132, 2021-09-15)
# Genius::Blocker
Genius Blocker is a piece of Rack Middleware designed to prevent unwanted
annotations by [News Genius](http://news.genius.com/).
The middleware injects a small bit of JavaScript code into the
`` of a website in order to force a redirect to the original
website whenever anyone attempts to prepend `genius.it/` onto a website's URL
for annotation purposes.
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'genius-blocker'
```
And then execute:
$ bundle
Or install it yourself as:
$ gem install genius-blocker
## Usage
For most applications, you can insert middleware into the config.ru file in the root of the application.
A simple `config.ru` in a Rails application might look
like this after adding Genius::Blocker:
```ruby
require ::File.expand_path('../config/environment', __FILE__)
use Genius::Blocker
run MyRailsApp::Application
```
## Contributing
Bug reports and pull requests are welcome on [GitHub](https://github.com/marlabrizel/genius-blocker). 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. Any pull requests or issues that do not adhere to these guidelines will be ignored and/or deleted.
## License
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
近期下载者:
相关文件:
收藏者: