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
ce38b8fd
Commit
ce38b8fd
authored
Aug 28, 2013
by
Jake Boxer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stop stripping 0123456789# in encode_io
parent
833ff584
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletions
+10
-1
lib/rumoji.rb
+3
-1
spec/rumoji_spec.rb
+7
-0
No files found.
lib/rumoji.rb
View file @
ce38b8fd
...
...
@@ -27,7 +27,9 @@ module Rumoji
sequence
=
if
last_emoji
.
nil?
||
!
last_emoji
.
codepoints
.
include?
(
codepoint
)
if
possible_emoji
.
empty?
[
codepoint
].
pack
(
"U"
)
last_codepoint
=
last_emoji
&&
last_emoji
.
codepoints
.
first
sequence_codepoints
=
[
last_codepoint
,
codepoint
].
compact
sequence_codepoints
.
pack
(
"U"
*
sequence_codepoints
.
size
)
else
multiple_codepoint_emoji
=
possible_emoji
.
select
(
&
:multiple?
)
if
multiple_codepoint_emoji
.
empty?
...
...
spec/rumoji_spec.rb
View file @
ce38b8fd
...
...
@@ -30,6 +30,13 @@ describe Rumoji do
Rumoji
.
encode_io
(
io
).
string
.
must_equal
":smile:"
end
it
"keeps codepoints that match the beginnings of multi-codepoint emoji"
do
text
=
"i like #hashtags and 1direction"
io
=
StringIO
.
new
(
text
)
Rumoji
.
encode_io
(
io
).
string
.
must_equal
text
end
describe
"with multiple codepoints"
do
it
"transforms a stream"
do
io1
=
StringIO
.
new
(
"
#{
@zero
}
"
)
...
...
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