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
50c03fca
Commit
50c03fca
authored
Aug 24, 2015
by
Mark Wunsch
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #20 from amacou/fix-line-brake-bug
fix line brake bug
parents
6b264e8a
3c2bf28a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletions
+5
-1
lib/rumoji.rb
+1
-1
spec/rumoji_spec.rb
+4
-0
No files found.
lib/rumoji.rb
View file @
50c03fca
...
@@ -13,7 +13,7 @@ module Rumoji
...
@@ -13,7 +13,7 @@ module Rumoji
# Transform a cheat-sheet code into an Emoji
# Transform a cheat-sheet code into an Emoji
def
decode
(
str
)
def
decode
(
str
)
str
.
gsub
(
/:([^s:]?[\w-]+):/
)
{
|
sym
|
(
Emoji
.
find
(
$1
.
intern
)
||
sym
).
to_s
}
str
.
gsub
(
/:([^
\
s:]?[\w-]+):/
)
{
|
sym
|
(
Emoji
.
find
(
$1
.
intern
)
||
sym
).
to_s
}
end
end
def
encode_io
(
readable
,
writeable
=
StringIO
.
new
(
""
))
def
encode_io
(
readable
,
writeable
=
StringIO
.
new
(
""
))
...
...
spec/rumoji_spec.rb
View file @
50c03fca
...
@@ -74,6 +74,10 @@ describe Rumoji do
...
@@ -74,6 +74,10 @@ describe Rumoji do
it
"does not transform an arbitrary string wrapped in colons"
do
it
"does not transform an arbitrary string wrapped in colons"
do
Rumoji
.
decode
(
":this-is-just-a-string:"
).
must_equal
":this-is-just-a-string:"
Rumoji
.
decode
(
":this-is-just-a-string:"
).
must_equal
":this-is-just-a-string:"
end
end
it
"transforms a cheat-sheet code into an emoji with line brake"
do
Rumoji
.
decode
(
":
\n
abc:poop:"
).
must_equal
":
\n
abc"
+
@poop
end
end
end
describe
"#encode_io"
do
describe
"#encode_io"
do
...
...
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