<commit_before># [Alert Message](http://rubygems.org/gems/alert_message)

[![Gem Version](https://badge.fury.io/rb/alert_message.svg)](http://badge.fury.io/rb/alert_message)

This is a simple gem for alerts messages.

## Installation

Add to your Gemfile:

     gem 'alert_message'

Then run:

    $ bundle install

Run install script:

    $ rails g alert_message:install

Rename *app/assets/application.css* to *app/assets/application.css.scss* and add in app/assets/application.css.scss

    *= require alert_message

and in app/assets/application.js

    //= require alert_message

## How to use

Add in *application.html.erb*

    <%= render "layouts/alerts" %>

To show your alerts, use:

    flash[:error] = "YOUR MESSAGE"
    flash[:notice] = "YOUR MESSAGE"
    flash[:success] = "YOUR MESSAGE"

## Example

    class HomeController < ApplicationController
      def index
          flash[:error] = "YOUR MESSAGE"  
      end
    end

## Custom message to Devise

Some devise screens do not accept Flash Messages. For this we will use a custom helper.

Add in your app/views/layouts/_alerts.html.erb

    <%= show_messages %>

Create helper alert_message_helper.rb

    module AlertMessageHelper
      def show_messages
        return "" if resource.errors.empty?
        messages = resource.errors.full_messages
        html = <<-HTML
          <div class="alert alert-danger">
          <button type="button" class="close">&times;</button>
            #{messages.first}
          </div>
        HTML
        html.html_safe
      end
    end

## Demo

[https://alert-message.herokuapp.com/](https://alert-message.herokuapp.com/)


## Contributing

**Welcome to contribute**

1. Fork it
2. Create your feature branch (git checkout -b my-new-feature)
3. Commit your changes (git commit -am 'Added some feature')
4. Push to the branch (git push origin my-new-feature)
5. Create new Pull Request

## License

MIT License. Copyright 2014 <NAME>. http://www.luizpicolo.com.br
<commit_msg>Updating READEME.md<commit_after># Alert Message

[![Gem Version](https://badge.fury.io/rb/alert_message.svg)](http://badge.fury.io/rb/alert_message)

This is a simple gem for [alerts messages](http://rubygems.org/gems/alert_message).

## Installation

Add to your Gemfile:

    gem 'alert_message'

Then run:

    $ bundle install

Run install script:

    $ rails g alert_message:install

Add styles in app/assets/application.css

    *= require alert_message

Add scripts in app/assets/application.js

    //= require alert_message


## How to use

Add in app/views/layouts/application.html.erb

    <%= render "layouts/alerts" %>

To show your alerts, use:

    flash[:error] = "YOUR MESSAGE"
    flash[:notice] = "YOUR MESSAGE"
    flash[:success] = "YOUR MESSAGE"

#### Example

    class HomeController < ApplicationController
      def index
          flash[:error] = "YOUR MESSAGE"  
      end
    end

## Custom message to Devise

Some devise screens do not accept Flash Messages. For this we will use a custom helper.

Add in your app/views/layouts/_alerts.html.erb

    <%= show_messages %>

Create helper alert_message_helper.rb

    module AlertMessageHelper
      def show_messages
        return "" if resource.errors.empty?
        messages = resource.errors.full_messages
        html = <<-HTML
          <div class="alert alert-danger">
            #{messages.first}
          </div>
        HTML
        html.html_safe
      end
    end

## Demo

[alert-message.herokuapp.com](https://alert-message.herokuapp.com/)


## Contributing

**Welcome to contribute**

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

## License

MIT License. Copyright 2014 <NAME>. http://www.luizpicolo.com.br

{'fraction_non_alphanumeric': 0.1117996385231087, 'fraction_numerical': 0.004647560030983733, 'mean_word_length': 2.9938144329896907, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 15, 'https://': 5, 'lorem ipsum': 0, 'www.': 2, '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': '4565394', 'n_tokens_mistral': 1263, 'n_tokens_neox': 1192, 'n_words': 351}