emojionearea-rails 0.1.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +16 -0
- data/lib/emojionearea/rails.rb +1 -0
- data/lib/emojionearea/rails/helper.rb +19 -0
- data/lib/emojionearea/rails/railtie.rb +14 -0
- data/lib/emojionearea/rails/version.rb +1 -1
- metadata +33 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f5832a5ebb57fd0bf77350d20d4f102fea69a32
|
4
|
+
data.tar.gz: 973e90070b56d6a97b0173da41ba7a091a8547e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e979b3f7c75c41f41182907dc37188fa707246ed1f30360394fddf2b24565a3ddca81b7a35e71fe7e4020c0510315e2d4d937086d446cb4bf47b4a6e81f1503c
|
7
|
+
data.tar.gz: 440bf150d845f3dbf31e0594370fde76b8bec96af1029197d1eabf2964478b252e3a33ff8e72595ebef8732b780c944e731edef59d1cbc322ee6081eabdd1862
|
data/README.md
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
Rails gem for EmojiOne Area
|
4
4
|
https://github.com/mervick/emojionearea
|
5
5
|
|
6
|
+
[![Gem Version](https://badge.fury.io/rb/emojionearea-rails.svg)](https://badge.fury.io/rb/emojionearea-rails)
|
6
7
|
|
7
8
|
## Installation
|
8
9
|
|
@@ -20,6 +21,8 @@ Or install it yourself as:
|
|
20
21
|
|
21
22
|
$ gem install emojionearea-rails
|
22
23
|
|
24
|
+
> **Note** : On bundling this gem, `rumoji` and `emoji` gems are also bundled as dependencies.
|
25
|
+
|
23
26
|
## Usage
|
24
27
|
|
25
28
|
##### 1. `assets/javascripts/application.js` :
|
@@ -68,6 +71,19 @@ $(document).on 'turbolinks:load', ->
|
|
68
71
|
<% end %>
|
69
72
|
```
|
70
73
|
|
74
|
+
##### 6. `gemojify` helper method
|
75
|
+
|
76
|
+
After bundling this gem, you can use `gemojify` helper method out of box. This is for showing all emoji characters graphically in `show` action view template.
|
77
|
+
|
78
|
+
```html
|
79
|
+
<div class='message'>
|
80
|
+
<div class='user'><%= message.user.user_name %> : </div>
|
81
|
+
<div class='content'>
|
82
|
+
<%=sanitize gemojify( message.content ) %>
|
83
|
+
</div>
|
84
|
+
</div>
|
85
|
+
```
|
86
|
+
|
71
87
|
That's it.
|
72
88
|
|
73
89
|
## Development
|
data/lib/emojionearea/rails.rb
CHANGED
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'rumoji'
|
2
|
+
require 'emoji'
|
3
|
+
|
4
|
+
module Emojionearea
|
5
|
+
module Rails
|
6
|
+
module Helper
|
7
|
+
def gemojify(content)
|
8
|
+
text_symbol = Rumoji.encode(content)
|
9
|
+
text_symbol.gsub(/:([\w+-]+):/) do |match|
|
10
|
+
if emoji = Emoji.find_by_alias($1)
|
11
|
+
%(<img alt="#{emoji.raw}" src="https://cdnjs.cloudflare.com/ajax/libs/emojione/2.1.4/assets/png/#{emoji.image_filename.split("/").last}" style="vertical-align:middle" width="16" height="16" />)
|
12
|
+
else
|
13
|
+
match
|
14
|
+
end
|
15
|
+
end.html_safe if content.present?
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'rails'
|
2
|
+
require 'emojionearea/rails/helper'
|
3
|
+
|
4
|
+
module Emojionearea
|
5
|
+
module Rails
|
6
|
+
class Railtie < ::Rails::Railtie
|
7
|
+
initializer "emojionearea.action_view" do
|
8
|
+
ActiveSupport.on_load(:action_view) do
|
9
|
+
include Emojionearea::Rails::Helper
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: emojionearea-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lucius Choi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-04-
|
11
|
+
date: 2017-04-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -38,6 +38,34 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rumoji
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.5.0
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.5.0
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: gemoji
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 3.0.0
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 3.0.0
|
41
69
|
description: WYSIWYG-like EmojiOne Converter / Picker Plugin for jQuery
|
42
70
|
email:
|
43
71
|
- lucius.choi@gmail.com
|
@@ -48,6 +76,8 @@ files:
|
|
48
76
|
- LICENSE.txt
|
49
77
|
- README.md
|
50
78
|
- lib/emojionearea/rails.rb
|
79
|
+
- lib/emojionearea/rails/helper.rb
|
80
|
+
- lib/emojionearea/rails/railtie.rb
|
51
81
|
- lib/emojionearea/rails/version.rb
|
52
82
|
- vendor/assets/javascripts/emojionearea.js
|
53
83
|
- vendor/assets/javascripts/emojionearea.min.js
|
@@ -75,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
75
105
|
version: '0'
|
76
106
|
requirements: []
|
77
107
|
rubyforge_project:
|
78
|
-
rubygems_version: 2.
|
108
|
+
rubygems_version: 2.6.8
|
79
109
|
signing_key:
|
80
110
|
specification_version: 4
|
81
111
|
summary: emojionearea jquery plugin for Rails asset pipeline.
|