README.md in rack-cerberus-1.0.3 vs README.md in rack-cerberus-1.0.4

- old
+ new

@@ -6,22 +6,22 @@ options in order to style the authentication page. Install with: ``` -# sudo gem install rack-cerberus +# gem install rack-cerberus ``` Or in your `Gemfile`: -``` +```ruby gem 'rack-cerberus' ``` You can use it almost the same way you use `Rack::Auth::Basic`: -``` +```ruby require 'rack/cerberus' use Rack::Session::Cookie, secret: 'change_me' use Rack::Cerberus do |login, pass| pass=='secret' end @@ -43,11 +43,11 @@ - `:css_location` (Path to a CSS file for a complete reskin) - `:session_key` (Where login name is kept. Default is `cerberus_user`) Which is used that way: -``` +```ruby use Rack::Cerberus, {company_name: 'Nintendo'} do |login, pass| pass=='secret' end ``` @@ -64,19 +64,18 @@ and delegate authentication to the block you send it which should return `true` or `false`. You can also use the 3rd argument which is the request object: -``` +```ruby use Rack::Cerberus, {company_name: 'Nintendo'} do |login, pass, req| pass=='secret' && req.xhr? end ``` This is useful if you want to check other details of the request. -Like the referer or another parameter. But bear in mind that `cerberus_login` -and `cerberus_pass` are still mandatory. +Like the referer or another parameter. But bear in mind that `cerberus_login` and `cerberus_pass` are still mandatory. Example ------- If you want to see a concrete example, go into the `example/` directory and run: @@ -101,7 +100,7 @@ or send patches. Copyright --------- -(c) 2010-2015 Mickael Riga - see MIT_LICENSE for details +(c) 2010-2016 Mickael Riga - see `MIT_LICENSE` for details