<commit_before># PunditExtra

[![Gem](https://img.shields.io/gem/v/pundit_extra.svg?style=flat-square)](https://rubygems.org/gems/pundit_extra)
[![Travis](https://img.shields.io/travis/DannyBen/pundit_extra.svg?style=flat-square)](https://travis-ci.org/DannyBen/pundit_extra)
[![Maintainability](https://img.shields.io/codeclimate/maintainability/DannyBen/pundit_extra.svg?style=flat-square)](https://codeclimate.com/github/DannyBen/pundit_extra)
[![Issues](https://img.shields.io/codeclimate/issues/DannyBen/pundit_extra.svg?style=flat-square)](https://codeclimate.com/github/DannyBen/pundit_extra)
[![Gemnasium](https://img.shields.io/gemnasium/DannyBen/pundit_extra.svg?style=flat-square)](https://gemnasium.com/DannyBen/pundit_extra)

This library borrows functionality from [CanCan(Can)][2] and adds it to [Pundit][1].

- `can?` and `cannot?` view helpers
- `load_resource`, `authorize_resource`, `load_and_authorize_resource` and 
  `skip_authorization` controller filters

The design intentions were:

1. To ease the transition from CanCanCan to Pundit.
2. To reduce boilerplate code in controller methods.
3. To keep things simple and intentionally avoid dealing with edge cases or
   endless magical options you need to memorize.

---

## Install

Add to your Gemfile:

```
gem 'pundit_extra'
```

Add to your `ApplicationController`:

```ruby
class ApplicationController < ActionController::Base<commit_msg>remove codeclimate issues<commit_after># PunditExtra

[![Gem](https://img.shields.io/gem/v/pundit_extra.svg?style=flat-square)](https://rubygems.org/gems/pundit_extra)
[![Travis](https://img.shields.io/travis/DannyBen/pundit_extra.svg?style=flat-square)](https://travis-ci.org/DannyBen/pundit_extra)
[![Maintainability](https://img.shields.io/codeclimate/maintainability/DannyBen/pundit_extra.svg?style=flat-square)](https://codeclimate.com/github/DannyBen/pundit_extra)
[![Gemnasium](https://img.shields.io/gemnasium/DannyBen/pundit_extra.svg?style=flat-square)](https://gemnasium.com/DannyBen/pundit_extra)

This library borrows functionality from [CanCan(Can)][2] and adds it to [Pundit][1].

- `can?` and `cannot?` view helpers
- `load_resource`, `authorize_resource`, `load_and_authorize_resource` and 
  `skip_authorization` controller filters

The design intentions were:

1. To ease the transition from CanCanCan to Pundit.
2. To reduce boilerplate code in controller methods.
3. To keep things simple and intentionally avoid dealing with edge cases or
   endless magical options you need to memorize.

---

## Install

Add to your Gemfile:

```
gem 'pundit_extra'
```

Add to your `ApplicationController`:

```ruby
class ApplicationController < ActionController::Base
{'fraction_non_alphanumeric': 0.13999257333828444, 'fraction_numerical': 0.003713330857779428, 'mean_word_length': 6.126984126984127, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 18, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2380836', 'n_tokens_mistral': 962, 'n_tokens_neox': 931, 'n_words': 174}