rumoji 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 937596f7150b11e8edda58fb25ce551aa5a09c34
4
- data.tar.gz: f030bc4df7e3f826c3a16bfab65fd1fc16d8cb9d
3
+ metadata.gz: 8bee7e446d40d5d3b472ef20dc39c4ba19c4a6a4
4
+ data.tar.gz: 2dbd9169b0e2ad18a0299f6a735a5c06624b2149
5
5
  SHA512:
6
- metadata.gz: 69dd6d823624ed3b57903db1568aeb357c40f78d1c97ca44600d8afb16a15093233c6da5afdfbd702fe358d130a939ce0c2750b4ff4443cb136f662856cc49d3
7
- data.tar.gz: 1eed7329f0e7a5b2a8e69bda5a4b65fc0870d0b1059ea826a8800ff74a66cdcbea3228f82dbba4f8c16ab82d4dd73d686ba3eb50ebe110518bfec44f7197dff8
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 - 2013 Mark Wunsch. Licensed under the [MIT License](http://opensource.org/licenses/mit-license.php).
56
+ Copyright (c) 2012 - 2015 Mark Wunsch. Licensed under the [MIT License](http://opensource.org/licenses/mit-license.php).
57
57
 
@@ -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(""))
@@ -1,3 +1,3 @@
1
1
  module Rumoji
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
@@ -5,14 +5,14 @@ require 'minitest/autorun'
5
5
 
6
6
  describe Rumoji::Emoji do
7
7
  let(:symbols) { [:hankey, :poop, :shit] }
8
- let(:name) { "PILE OF POO" }
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, name)
12
+ Rumoji::Emoji.new(poo_string, symbols, emoji_name)
13
13
  end
14
14
 
15
- it("has a name") { subject.name.must_equal name }
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(:name) { "REGIONAL INDICATOR SYMBOL LETTERS US" }
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, name)
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 }
@@ -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.0
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: 2014-09-02 00:00:00.000000000 Z
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.0.14
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