emoji_sub 0.2.2 → 0.3.0

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
  SHA256:
3
- metadata.gz: 6452a3a122c4fc7168b83a44871acd14ef5c37bf6ff7fc402cb17c4dcc6f6989
4
- data.tar.gz: 85582412e9e009aac38c38652a422219f4843919dd01f0ff3446a09fd740e5dc
3
+ metadata.gz: 2042ce47d58672b62d17ddf7b5cc520e965a505464399644fa79da7f0eba3140
4
+ data.tar.gz: f15703e29f303373308f017ae4be00c8f7f4ca8ff741ccf21c5f8c0e834198a7
5
5
  SHA512:
6
- metadata.gz: edec0d0eb2edf0631447e0f58b6eeaea807389c7b862e8d6b90df28055e4775026e12ee48952e0fc5830a32f85e0cd0fa2dd7ae4aee3d1a0d7359c90444a5db8
7
- data.tar.gz: f9140447eda1854375e50984fedc2c5f3653539941b94fd1865f08caf67ba96f9c01417964554c42cc91036e7d2e1d10c854bc4e1c2d2cd04ee21aacfa6c6eb4
6
+ metadata.gz: 76a9b86548c4f1f5059657e112d4d0b59bf87477b1d75e54dd442dc1201dcf73bf4a98749a3b5534e3f506f1d0dd46b11da79aa5b7469f6ea8586b78eee06daa
7
+ data.tar.gz: d029e8c17df35017faf3409b904c62d955aa403769cdfcb8940937df9240e9d6d04d794056b31a6d970ab9f05286aa0ed1bb371168abee689a4f13e98aef4844
@@ -6,6 +6,10 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
6
6
 
7
7
  N.B. until it hits 1.0 do not make any expectations about API consistency! (SemVer says it's OK so nyah!)
8
8
 
9
+ ## [0.3.0] - 2020-10-05
10
+
11
+ - Adds monkey-patch to allow String to call `:emoji_sub` directly
12
+
9
13
  ## [0.2.2] - 2020-08-22
10
14
 
11
15
  - Some reorganization of files, and cleanup
@@ -42,6 +46,8 @@ emoji HTML entities (hex-unicode) for slack shortcut format (:this_kind:)
42
46
  - data/emoji.yml file,
43
47
  - Specs covering basic funcitonality
44
48
 
49
+ [0.3.0]: https://github.com/armahillo/emoji_sub/compare/v0.2.2...v0.3.0
50
+ [0.2.2]: https://github.com/armahillo/emoji_sub/compare/v0.2.1...v0.2.2
45
51
  [0.2.1]: https://github.com/armahillo/emoji_sub/compare/v0.2.0...v0.2.1
46
52
  [0.2.0]: https://github.com/armahillo/emoji_sub/compare/v0.1.0...v0.2.0
47
53
  [0.1.0]: https://github.com/armahillo/emoji_sub/releases/tag/v0.1.0
data/README.md CHANGED
@@ -38,15 +38,25 @@ text = "I :heart: New York :statue_of_liberty: :pizza: :pigeon:"
38
38
  better_text = EmojiSub.emoji_sub(text, additional_emoji)
39
39
  ```
40
40
 
41
+ You can also include the monkey-patch for it so that you can call `.emoji_sub` directly on a string. To enable this behavior, add this somewhere in your scripts bootstrap (it just needs to be run before other it's used)
42
+
43
+ ```ruby
44
+ String.prepend CoreExtensions::EmojiSub::String
45
+ ```
46
+
47
+ ### Using Custom Mappings / Overrides
48
+
41
49
  You can even, even override the mappings I did with your own! If your expert-moji opinion says that `:smiley_cat:` should be 😸 and `:smile_cat:` should be 😺 who am I to disagree? They're very different, clearly, and obviously the "-y" on the end of "smile-y" means that the cat should have eyes that are more smiley. Very reasonable and I completely understand! YES I'M FINE WHY DO YOU ASK?
42
50
 
43
51
  In all seriousness, one big reason I could see wanting to do overrides is because emoji shortcodes in Slack are often quite gendered, such as :man_bouncing_ball: => ⛹ and you'd like to use :woman_bouncing_ball: (⛹), which doesn't exist in the current YML mapping because GOOD GOB THERE ARE SO MANY AND I AM BUT ONE PERSON.
44
52
 
45
- Currently, the emoji are also a single skin-tone. I'm still learning how to combine emoji to do skin-tone modifiers, but when I do, you would also use the overrides thing to do that, as well! If you're an e-moji e-xpert and can help out with this, please do!
46
-
47
53
  Other reasons to override might be because you prefer a specific version of `:airplane:` to be mapped to `:airplane:` instead of ✈, and at the end of the day, this is about making it more convenient for you.
48
54
 
49
55
 
56
+ ### Skin-tone variants
57
+
58
+ Currently, the emoji are also a single skin-tone. I'm still learning how to combine emoji to do skin-tone modifiers, but when I do, you would also use the overrides thing to do that, as well! If you're an e-moji e-xpert and can help out with this, please do!
59
+
50
60
  ## Development
51
61
 
52
62
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -0,0 +1,19 @@
1
+ module CoreExtensions
2
+ module EmojiSub
3
+ ##
4
+ # This monkey patches String so that it can receive emoji_sub directives
5
+ # cf. https://github.com/armahillo/emoji_sub/issues/2
6
+ # If you want to monkey patch your use of String, you should be able to include
7
+ # this module and that should do it.
8
+ ##
9
+ module String
10
+ def emoji_sub(options = {})
11
+ ::EmojiSub.emoji_sub(self, options)
12
+ end
13
+
14
+ def emoji_sub!(options = {})
15
+ replace emoji_sub(options)
16
+ end
17
+ end
18
+ end
19
+ end
@@ -24,5 +24,4 @@ module EmojiSub
24
24
  end
25
25
 
26
26
  module_function :emoji_sub, :emoji_definitions
27
-
28
27
  end
@@ -1,3 +1,3 @@
1
1
  module EmojiSub
2
- VERSION = "0.2.2"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: emoji_sub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Hill
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-08-22 00:00:00.000000000 Z
11
+ date: 2020-10-06 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: 'EmojiSub allows you to use :short_code_emoji: in your text and quickly
14
14
  replace it with the natural Unicode versions via a bit of string parsing logic'
@@ -32,6 +32,7 @@ files:
32
32
  - bin/setup
33
33
  - data/emoji.yaml
34
34
  - emoji_sub.gemspec
35
+ - lib/core_extensions/string.rb
35
36
  - lib/emoji_sub.rb
36
37
  - lib/emoji_sub/version.rb
37
38
  homepage: https://github.com/armahillo/emoji_sub