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
4914c7da
Unverified
Commit
4914c7da
authored
Feb 16, 2018
by
Colin
Committed by
GitHub
Feb 16, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2 from redtail-technology/develop
Develop
parents
7cb2cd9e
8a45fd0f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
6 deletions
+8
-6
lib/rumoji.rb
+4
-4
lib/rumoji/emoji.rb
+2
-1
lib/rumoji/emoji/food.rb
+2
-1
lib/rumoji/emoji/newmoji.rb
+0
-0
No files found.
lib/rumoji.rb
View file @
4914c7da
...
@@ -6,9 +6,9 @@ require 'stringio'
...
@@ -6,9 +6,9 @@ require 'stringio'
module
Rumoji
module
Rumoji
extend
self
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
)
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
emoji
=
Emoji
.
find_by_string
(
match
)
if
block_given?
if
block_given?
yield
emoji
yield
emoji
...
@@ -21,9 +21,9 @@ module Rumoji
...
@@ -21,9 +21,9 @@ module Rumoji
end
end
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
)
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
end
def
encode_io
(
readable
,
writeable
=
StringIO
.
new
(
""
),
&
block
)
def
encode_io
(
readable
,
writeable
=
StringIO
.
new
(
""
),
&
block
)
...
...
lib/rumoji/emoji.rb
View file @
4914c7da
...
@@ -61,8 +61,9 @@ module Rumoji
...
@@ -61,8 +61,9 @@ module Rumoji
autoload
:OBJECTS
,
'rumoji/emoji/objects'
autoload
:OBJECTS
,
'rumoji/emoji/objects'
autoload
:PLACES
,
'rumoji/emoji/places'
autoload
:PLACES
,
'rumoji/emoji/places'
autoload
:SYMBOLS
,
'rumoji/emoji/symbols'
autoload
:SYMBOLS
,
'rumoji/emoji/symbols'
autoload
:NEWMOJI
,
'rumoji/emoji/newmoji'
ALL
=
PEOPLE
|
NATURE
|
OBJECTS
|
PLACES
|
SYMBOLS
|
FOOD
ALL
=
PEOPLE
|
NATURE
|
OBJECTS
|
PLACES
|
SYMBOLS
|
FOOD
|
NEWMOJI
ALL_REGEXP
=
Regexp
.
new
(
ALL
.
map
(
&
:string
).
join
(
'|'
))
ALL_REGEXP
=
Regexp
.
new
(
ALL
.
map
(
&
:string
).
join
(
'|'
))
...
...
lib/rumoji/emoji/food.rb
View file @
4914c7da
...
@@ -73,7 +73,7 @@ module Rumoji
...
@@ -73,7 +73,7 @@ module Rumoji
self
.
new
(
"
\u
{1F959}"
,
[
:stuffed_flatbread
]),
self
.
new
(
"
\u
{1F959}"
,
[
:stuffed_flatbread
]),
self
.
new
(
"
\u
{1F943}"
,
[
:tumbler_glass
]),
self
.
new
(
"
\u
{1F943}"
,
[
:tumbler_glass
]),
self
.
new
(
"
\u
{1F942}"
,
[
:clinking_glasses
]),
self
.
new
(
"
\u
{1F942}"
,
[
:clinking_glasses
]),
self
.
new
(
"
\u
{1F95B}"
,
[
:glass_of_milk
])
self
.
new
(
"
\u
{1F95B}"
,
[
:glass_of_milk
])
,
]
]
end
end
end
end
\ No newline at end of file
lib/rumoji/emoji/newmoji.rb
0 → 100644
View file @
4914c7da
This diff is collapsed.
Click to expand it.
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