rumoji 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/rumoji.rb +1 -1
- data/lib/rumoji/version.rb +1 -1
- data/spec/rumoji/emoji_spec.rb +5 -5
- data/spec/rumoji_spec.rb +4 -0
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8bee7e446d40d5d3b472ef20dc39c4ba19c4a6a4
|
4
|
+
data.tar.gz: 2dbd9169b0e2ad18a0299f6a735a5c06624b2149
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44fbc7120aa1031d77d330f6f246e4a6d8b1503347641925f91b357d9bf47dd3431ef89de03f35e039da4daf72088cb5803cb4f7e16fcfee342521a08d310cc4
|
7
|
+
data.tar.gz: d8329c723c7ab9288e36f3b0d1510064e684639645b9a7e86330205c7ebf47e1f1558d91b4d4178c60b67c75029f9eaa79a2ac92493a245072d964c1bc7b147f
|
data/README.md
CHANGED
@@ -53,5 +53,5 @@ _Having trouble discerning what's happening in this README?_ You might be on a d
|
|
53
53
|
Thanks!
|
54
54
|
|
55
55
|
## Copyright
|
56
|
-
Copyright (c) 2012 -
|
56
|
+
Copyright (c) 2012 - 2015 Mark Wunsch. Licensed under the [MIT License](http://opensource.org/licenses/mit-license.php).
|
57
57
|
|
data/lib/rumoji.rb
CHANGED
@@ -14,7 +14,7 @@ module Rumoji
|
|
14
14
|
|
15
15
|
# Transform a cheat-sheet code into an Emoji
|
16
16
|
def decode(str)
|
17
|
-
str.gsub(/:([^s:]?[\w-]+):/) {|sym| Emoji.find($1.intern).to_s }
|
17
|
+
str.gsub(/:([^s:]?[\w-]+):/) {|sym| (Emoji.find($1.intern) || sym).to_s }
|
18
18
|
end
|
19
19
|
|
20
20
|
def encode_io(readable, writeable=StringIO.new(""))
|
data/lib/rumoji/version.rb
CHANGED
data/spec/rumoji/emoji_spec.rb
CHANGED
@@ -5,14 +5,14 @@ require 'minitest/autorun'
|
|
5
5
|
|
6
6
|
describe Rumoji::Emoji do
|
7
7
|
let(:symbols) { [:hankey, :poop, :shit] }
|
8
|
-
let(:
|
8
|
+
let(:emoji_name) { "PILE OF POO" }
|
9
9
|
let(:poo_string) { "\u{1F4A9}" }
|
10
10
|
|
11
11
|
subject do
|
12
|
-
Rumoji::Emoji.new(poo_string, symbols,
|
12
|
+
Rumoji::Emoji.new(poo_string, symbols, emoji_name)
|
13
13
|
end
|
14
14
|
|
15
|
-
it("has a name") { subject.name.must_equal
|
15
|
+
it("has a name") { subject.name.must_equal emoji_name }
|
16
16
|
it("has a cheat sheet code") { symbols.must_include subject.code[1...-1].intern }
|
17
17
|
it("can test if it includes a cheat sheet code") { symbols.all?{|symbol| subject.include?(symbol) }.must_equal true }
|
18
18
|
it("converts to the emoji string") { subject.to_s.must_equal poo_string }
|
@@ -44,11 +44,11 @@ describe Rumoji::Emoji do
|
|
44
44
|
#
|
45
45
|
# http://www.unicode.org/versions/Unicode6.2.0/
|
46
46
|
let(:symbol) { :us }
|
47
|
-
let(:
|
47
|
+
let(:emoji_name) { "REGIONAL INDICATOR SYMBOL LETTERS US" }
|
48
48
|
let(:us_string) { "\xF0\x9F\x87\xBA\xF0\x9F\x87\xB8" }
|
49
49
|
|
50
50
|
subject do
|
51
|
-
Rumoji::Emoji.new(us_string, symbol,
|
51
|
+
Rumoji::Emoji.new(us_string, symbol, emoji_name)
|
52
52
|
end
|
53
53
|
|
54
54
|
it("has one symbol, representing the code") { subject.symbol.must_equal symbol }
|
data/spec/rumoji_spec.rb
CHANGED
@@ -32,6 +32,10 @@ describe Rumoji do
|
|
32
32
|
it "transforms a cheat-sheet code with a dash into an emoji" do
|
33
33
|
Rumoji.decode(":non-potable_water:").must_equal @non_potable_water
|
34
34
|
end
|
35
|
+
|
36
|
+
it "does not transform an arbitrary string wrapped in colons" do
|
37
|
+
Rumoji.decode(":this-is-just-a-string:").must_equal ":this-is-just-a-string:"
|
38
|
+
end
|
35
39
|
end
|
36
40
|
|
37
41
|
describe "#encode_io" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rumoji
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Wunsch
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-06-11 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Transcode emoji utf-8 characters into emoji-cheat-sheet form
|
14
14
|
email:
|
@@ -18,8 +18,8 @@ executables:
|
|
18
18
|
extensions: []
|
19
19
|
extra_rdoc_files: []
|
20
20
|
files:
|
21
|
-
- .gitignore
|
22
|
-
- .travis.yml
|
21
|
+
- ".gitignore"
|
22
|
+
- ".travis.yml"
|
23
23
|
- Gemfile
|
24
24
|
- LICENSE.txt
|
25
25
|
- README.md
|
@@ -45,17 +45,17 @@ require_paths:
|
|
45
45
|
- lib
|
46
46
|
required_ruby_version: !ruby/object:Gem::Requirement
|
47
47
|
requirements:
|
48
|
-
- -
|
48
|
+
- - ">="
|
49
49
|
- !ruby/object:Gem::Version
|
50
50
|
version: '0'
|
51
51
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
|
-
- -
|
53
|
+
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '0'
|
56
56
|
requirements: []
|
57
57
|
rubyforge_project:
|
58
|
-
rubygems_version: 2.
|
58
|
+
rubygems_version: 2.2.2
|
59
59
|
signing_key:
|
60
60
|
specification_version: 4
|
61
61
|
summary: Transcode emoji utf-8 characters into emoji-cheat-sheet form
|