Sha256: d1c1d482a4dba7ed75298a2857ce6a540a7266037e0843c049f60ec09cd3595c

Contents?: true

Size: 765 Bytes

Versions: 6

Compression:

Stored size: 765 Bytes

Contents

gemoji
======

Emoji images and names. See the LICENSE for copyright information.


Installation
============

Add `gemoji` to you Gemfile.

``` ruby
gem 'gemoji', :require => 'emoji/railtie'
```


Example Rails Helper
====================

This would allow emojifying content such as: `it's raining :cats: and :dogs:!`

See the [Emoji cheat sheet](http://www.emoji-cheat-sheet.com) for more examples.

```ruby
module EmojiHelper
 def emojify(content)
    h(content).to_str.gsub(/:([a-z0-9\+\-_]+):/) do |match|
      if Emoji.names.include?($1)
        '<img alt="' + $1 + '" height="20" src="' + asset_path("emoji/#{$1}.png") + '" style="vertical-align:middle" width="20" />'
      else
        match
      end
    end.html_safe if content.present?
  end
end
```

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
gemoji-1.2.1 README.md
gemoji-1.2.0 README.md
gemoji-1.1.3 README.md
gemoji-1.1.2 README.md
gemoji-1.1.1 README.md
gemoji-1.1.0 README.md