rails_emoji 1.6.0 → 1.6.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +2 -2
- data/lib/rails_emoji/render.rb +4 -4
- data/lib/rails_emoji/version.rb +1 -1
- metadata +3 -3
data/README.md
CHANGED
@@ -9,9 +9,9 @@
|
|
9
9
|
|
10
10
|
## Installation
|
11
11
|
|
12
|
-
* Add to your Gemfile: `gem 'rails_emoji', '~> 1.6.
|
12
|
+
* Add to your Gemfile: `gem 'rails_emoji', '~> 1.6.1'`, then: `$ bundle`.
|
13
13
|
|
14
|
-
* Or, download the [rails_emoji-1.6.
|
14
|
+
* Or, download the [rails_emoji-1.6.1.gem](https://rubygems.org/downloads/rails_emoji-1.6.1.gem), then `$ gem install ./rails_emoji-1.6.1.gem --no-ri --no-rdoc`.
|
15
15
|
|
16
16
|
## Usage
|
17
17
|
|
data/lib/rails_emoji/render.rb
CHANGED
@@ -4,14 +4,14 @@ module RailsEmoji
|
|
4
4
|
def render(text, *args)
|
5
5
|
options = args.extract_options!
|
6
6
|
|
7
|
-
host = options[:host] ||
|
7
|
+
host = options[:host] || ''
|
8
8
|
size = options[:size] || 20
|
9
|
-
class_name = options[:class] ||
|
9
|
+
class_name = options[:class] || 'emoji'
|
10
10
|
|
11
11
|
# Replace
|
12
|
-
text.gsub(/:([a-z0-9_
|
12
|
+
text.gsub(/:([a-z0-9_+-]+):/) do |emoji|
|
13
13
|
emoji_code = emoji
|
14
|
-
emoji = emoji_code.gsub(
|
14
|
+
emoji = emoji_code.gsub(':', '')
|
15
15
|
|
16
16
|
if RailsEmoji::EMOJI.include?(emoji)
|
17
17
|
%{<img src="#{ host }/assets/emojis/#{ emoji }.png" } +
|
data/lib/rails_emoji/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_emoji
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 13
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 6
|
9
|
-
-
|
10
|
-
version: 1.6.
|
9
|
+
- 1
|
10
|
+
version: 1.6.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jay-Jay.Zhang (http://MrZhang.me/)
|