named_emoji 1.0.3 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -11,9 +11,13 @@ See also: [Emoji cheat sheet](http://www.emoji-cheat-sheet.com/)
11
11
  ## Usage
12
12
 
13
13
  require 'named_emoji'
14
- puts NamedEmoji[:smile]
14
+ puts NamedEmoji.emojis[:smile]
15
15
  # => ������
16
16
 
17
+ include NamedEmoji
18
+ emojis[:grin]
19
+ # => ������
20
+
17
21
  As command line tool:
18
22
 
19
23
  $ emoji scream
data/bin/emoji CHANGED
@@ -11,7 +11,7 @@ require 'named_emoji'
11
11
 
12
12
  case ARGV[0]
13
13
  when '-l'
14
- max_name_size = NamedEmoji::ALL.keys.map {|i| i.size}.max
14
+ max_name_size = NamedEmoji.emojis.keys.map {|i| i.size}.max
15
15
  %w(PEOPLE NATURE OBJECTS PLACES SYMBOLS).each do |category|
16
16
  puts category + ":"
17
17
  puts
@@ -26,7 +26,7 @@ when '-l'
26
26
  puts
27
27
  end
28
28
  else
29
- if emoji = NamedEmoji[ARGV[0]]
29
+ if emoji = NamedEmoji.emojis[ARGV[0].to_sym]
30
30
  print emoji
31
31
  else
32
32
  warn "Emoji not found :("
@@ -2,7 +2,7 @@ require "named_emoji/version"
2
2
 
3
3
  module NamedEmoji
4
4
  PEOPLE = {
5
- :'bowtie' => nil,
5
+ # :'bowtie' => nil,
6
6
  :'smile' => "\u{1F604}",
7
7
  :'blush' => "\u{1F60A}",
8
8
  :'smiley' => "\u{1F603}",
@@ -47,11 +47,11 @@ module NamedEmoji
47
47
  :'heartpulse' => "\u{1F497}",
48
48
  :'cupid' => "\u{1F498}",
49
49
  :'sparkles' => "\u{2728}",
50
- :'star' => nil,
50
+ # :'star' => nil,
51
51
  :'star2' => "\u{1F31F}",
52
52
  :'anger' => "\u{1F4A2}",
53
- :'exclamation' => nil,
54
- :'question' => nil,
53
+ # :'exclamation' => nil,
54
+ # :'question' => nil,
55
55
  :'grey_exclamation' => "\u{2755}",
56
56
  :'grey_question' => "\u{2754}",
57
57
  :'zzz' => "\u{1F4A4}",
@@ -83,7 +83,7 @@ module NamedEmoji
83
83
  :'point_up_2' => "\u{1F446}",
84
84
  :'clap' => "\u{1F44F}",
85
85
  :'muscle' => "\u{1F4AA}",
86
- :'metal' => nil,
86
+ # :'metal' => nil,
87
87
  :'walking' => "\u{1F6B6}",
88
88
  :'runner' => "\u{1F3C3}",
89
89
  :'couple' => "\u{1F46B}",
@@ -120,17 +120,17 @@ module NamedEmoji
120
120
  :'ear' => "\u{1F442}",
121
121
  :'eyes' => "\u{1F440}",
122
122
  :'nose' => "\u{1F443}",
123
- :'feelsgood' => nil,
124
- :'finnadie' => nil,
125
- :'goberserk' => nil,
126
- :'godmode' => nil,
127
- :'hurtrealbad' => nil,
128
- :'rage1' => nil,
129
- :'rage2' => nil,
130
- :'rage3' => nil,
131
- :'rage4' => nil,
132
- :'suspect' => nil,
133
- :'trollface' => nil,
123
+ # :'feelsgood' => nil,
124
+ # :'finnadie' => nil,
125
+ # :'goberserk' => nil,
126
+ # :'godmode' => nil,
127
+ # :'hurtrealbad' => nil,
128
+ # :'rage1' => nil,
129
+ # :'rage2' => nil,
130
+ # :'rage3' => nil,
131
+ # :'rage4' => nil,
132
+ # :'suspect' => nil,
133
+ # :'trollface' => nil,
134
134
  }
135
135
 
136
136
  NATURE = {
@@ -333,7 +333,7 @@ module NamedEmoji
333
333
  }
334
334
 
335
335
  PLACES = {
336
- :'109' => nil,
336
+ # :'109' => nil,
337
337
  :'house' => "\u{1F3E0}",
338
338
  :'school' => "\u{1F3EB}",
339
339
  :'office' => "\u{1F3E2}",
@@ -509,18 +509,17 @@ module NamedEmoji
509
509
  :'copyright' => "\u{00A9}",
510
510
  :'registered' => "\u{00AE}",
511
511
  :'tm' => "\u{2122}",
512
- :'shipit' => nil,
512
+ # :'shipit' => nil,
513
513
  }
514
514
 
515
- ALL = PEOPLE.merge(NATURE).merge(OBJECTS).merge(PLACES).merge(SYMBOLS)
516
-
517
515
  def self.[](name)
518
- ALL[name.to_sym]
516
+ warn '`.[]` is deprecated. Please use `.emojis[]` instead'
517
+ emojis[name.to_sym]
519
518
  end
520
519
 
521
- def self.each(&block)
522
- ALL.each(&block)
520
+ def emojis
521
+ @all ||= PEOPLE.merge(NATURE).merge(OBJECTS).merge(PLACES).merge(SYMBOLS)
523
522
  end
524
523
 
525
- extend Enumerable
524
+ extend self
526
525
  end
@@ -1,3 +1,3 @@
1
1
  module NamedEmoji
2
- VERSION = "1.0.3"
2
+ VERSION = "1.1.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: named_emoji
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-01 00:00:00.000000000Z
12
+ date: 2012-05-11 00:00:00.000000000Z
13
13
  dependencies: []
14
14
  description: Named Emojis for Mac OSX Lion and Later. Emoji's names are from Campfire
15
15
  and GitHub.