Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
rumoji
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ikcrm_common
rumoji
Commits
8a45fd0f
Unverified
Commit
8a45fd0f
authored
Feb 16, 2018
by
Colin Rice
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding support for incoming hash values.
parent
f1d1cac7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
lib/rumoji.rb
+4
-4
lib/rumoji/emoji/newmoji.rb
+3
-0
No files found.
lib/rumoji.rb
View file @
8a45fd0f
...
...
@@ -6,9 +6,9 @@ require 'stringio'
module
Rumoji
extend
self
# Transform emoji into its cheat-sheet code
# Transform emoji into its cheat-sheet code
(convert each entry to string first to handle hash values)
def
encode
(
str
)
str
.
gsub
(
Emoji
::
ALL_REGEXP
)
do
|
match
|
str
.
to_s
.
gsub
(
Emoji
::
ALL_REGEXP
)
do
|
match
|
if
emoji
=
Emoji
.
find_by_string
(
match
)
if
block_given?
yield
emoji
...
...
@@ -21,9 +21,9 @@ module Rumoji
end
end
# Transform a cheat-sheet code into an Emoji
# Transform a cheat-sheet code into an Emoji
(convert each entry to string first to handle hash values)
def
decode
(
str
)
str
.
gsub
(
/:([^\s:]?[\w-]+):/
)
{
|
match
|
(
Emoji
.
find
(
$1
)
||
match
).
to_s
}
str
.
to_s
.
gsub
(
/:([^\s:]?[\w-]+):/
)
{
|
match
|
(
Emoji
.
find
(
$1
)
||
match
).
to_s
}
end
def
encode_io
(
readable
,
writeable
=
StringIO
.
new
(
""
),
&
block
)
...
...
lib/rumoji/emoji/newmoji.rb
View file @
8a45fd0f
# New Emojis. Up to date with emoji-js.json as of 2/16/2018
# TODO: Recategorize emojis to the appropriate files.
require
'rumoji/emoji'
require
'set'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment