html-pipeline-negarmoji 0.0.2 → 0.0.3

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: abf58f54680cbc7e239817a53f882ad18de06ebb10783f83f8aca2e2995f5c72
4
- data.tar.gz: 4b9fcce07af7601049e77d9a915de4f9e27bd16480a09d7e864eefb67ebc4596
3
+ metadata.gz: 46edae81c4900008044d7ff883532cde0f6a35cd77bebdb59a902172ec7e1844
4
+ data.tar.gz: a8b0715ba49b667e32397d0682cc680b7a61e9a51804e1fba353202fb4f5b124
5
5
  SHA512:
6
- metadata.gz: 442f0f8deae3bdcb210456ac47d13289a8ecd354c0177f2d372c56c2020ecc903cd335451a6c92a8c9eec8f37cf5e8295f798acaa72e0225666cf7779978b2fa
7
- data.tar.gz: 4191931efa9d23984567a3b0dc6c713a93714c418e0c3117f1f2f111fa15012c98807b7f1f528cd9fcf1c39b894fdd05944ee0cfd03b89d4e08599700018b059
6
+ metadata.gz: '0854ff1edddef1980d151489582236334deec0e025da2a205fca02b8d4ce5f90b34e0b3169a019a70a6f0319c1c36881aae4336f01e10c63826a2ce25e7b08e2'
7
+ data.tar.gz: 1788bc861cce092585d49c569bef4a52afb9fa2f1e78dad76ea3e18632c0de141bac8d097baeefabee60fceb5f2a0e12ef996d16ec60af13950e9278a354bf1b
@@ -88,16 +88,26 @@ module HTML
88
88
  context[:extension] || "svg"
89
89
  end
90
90
 
91
+ # Build a regexp that matches all valid :emoji: names.
92
+ def self.emoji_pattern
93
+ @emoji_pattern ||= %r!:(#{emoji_names.map { |name| Regexp.escape(name) }.join("|")}):!
94
+ end
95
+
96
+ def self.emoji_names
97
+ Emoji.all.map(&:aliases).flatten.sort
98
+ end
99
+
91
100
  private
92
101
 
93
102
  # Build an emoji image tag
94
103
  def emoji_image_tag(name)
95
104
  require "active_support/core_ext/hash/indifferent_access"
96
- html_attrs =
97
- default_img_attrs(name)
98
- .merge!((context[:img_attrs] || {}).with_indifferent_access)
99
- .map { |attr, value| !value.nil? && %(#{attr}="#{value.respond_to?(:call) && value.call(name) || value}") }
100
- .reject(&:blank?).join(" ".freeze)
105
+ html_attrs = default_img_attrs(name)
106
+ .merge!((context[:img_attrs] || {}).with_indifferent_access)
107
+ .map do |attr, value|
108
+ !value.nil? && %(#{attr}="#{value.respond_to?(:call) && value.call(name) || value}")
109
+ end
110
+ .reject(&:blank?).join(" ")
101
111
 
102
112
  "<img #{html_attrs}>"
103
113
  end
@@ -137,17 +147,6 @@ module HTML
137
147
  DEFAULT_IGNORED_ANCESTOR_TAGS
138
148
  end
139
149
  end
140
-
141
- class << self
142
- # Build a regexp that matches all valid :emoji: names.
143
- def self.emoji_pattern
144
- @emoji_pattern ||= %r!:(#{emoji_names.map { |name| Regexp.escape(name) }.join("|")}):!
145
- end
146
-
147
- def self.emoji_names
148
- Emoji.all.map(&:aliases).flatten.sort
149
- end
150
- end
151
150
  end
152
151
  end
153
152
  end
@@ -3,7 +3,7 @@
3
3
  module Html
4
4
  module Pipeline
5
5
  module NegarMojiHtmlPipeline
6
- VERSION = "0.0.2"
6
+ VERSION = "0.0.3"
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: html-pipeline-negarmoji
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mohammad Mahdi Baghbani Pourvahid