html-pipeline-negarmoji 0.1.0 → 0.1.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
  SHA256:
3
- metadata.gz: 90dd4cfa20cd8c8b53cab868b926af66047c87eb4677cd1b81c781845b4db594
4
- data.tar.gz: 15bd9e5036ee896f3939df80b8496fc4212a717c43c9ec2da34795300e2432f7
3
+ metadata.gz: b43ba8ef63b7118d74c5a34b44bb6e4c5e27f53053c4fbd4e1bfda1d85dfcbf7
4
+ data.tar.gz: abe3488bb279a0aa7bfa2efa1a3c1323677d828edc53773e87419b580cf477d7
5
5
  SHA512:
6
- metadata.gz: a62779edea9377f91b83e0db17160369689d913f57c86af116ffaa489c0aaee0f549c855aa3f67520a7f0dfddb7514ae191cbef38c15066e562ebba1a27f299d
7
- data.tar.gz: e00bb9dd3ffe1935f74d05e50314562c3882dea1eb96b1e8b8fe5d685d40c13b938cc0325d30b252a6144625425cb0daab2a15336aa978c75fc8b59f7a20dd1b
6
+ metadata.gz: 03ec5b68a29d0d7b4f9e29d2aa321c59bf294c895ad2c56572904cc9ba2333f8f816f73f2edaa21363ac0c4fced32d76a00ccd24425b2024c46555edff392623
7
+ data.tar.gz: 0412d83043496cc50c77bf0b7d0158438fa5433f6b775277bb8cfefb719d112a0765c5e68667beb39e1b36ce13bae9f13f0b043de82e7826beabea73ebebb523
data/.gitlab-ci.yml CHANGED
@@ -71,6 +71,8 @@ test ruby 2.5:
71
71
  # run tests.
72
72
  script:
73
73
  - script/test.sh
74
+ except:
75
+ - tags
74
76
 
75
77
  test ruby 2.4:
76
78
  stage: test
@@ -86,6 +88,8 @@ test ruby 2.4:
86
88
  # run tests.
87
89
  script:
88
90
  - script/test.sh
91
+ except:
92
+ - tags
89
93
 
90
94
  test ruby 2.3:
91
95
  stage: test
@@ -101,6 +105,8 @@ test ruby 2.3:
101
105
  # run tests.
102
106
  script:
103
107
  - script/test.sh
108
+ except:
109
+ - tags
104
110
 
105
111
  # deploy gems to rubygems.org whenever a tag is released.
106
112
  release to rubygems:
data/README.md CHANGED
@@ -59,7 +59,7 @@
59
59
  >discussions, issue tracking and merge requests take place in GitLab.
60
60
 
61
61
 
62
- ## Negareh Emoji Library
62
+ ## Negareh Emoji HTML Pipeline
63
63
 
64
64
 
65
65
  Negareh emoji library is an emoji filter plugin for html pipeline, this package is
@@ -71,7 +71,7 @@ more flexible and customizable then the default emoji filter in html/pipeline.
71
71
  Add `html-pipeline-negarmoji` to your Gemfile.
72
72
 
73
73
  ``` ruby
74
- gem 'negarmoji'
74
+ gem `html-pipeline-negarmoji`
75
75
  ```
76
76
 
77
77
  ## Contribution
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
25
25
  spec.required_ruby_version = ">= 2.3.0"
26
26
 
27
27
  spec.add_dependency "html-pipeline", "~> 2.12"
28
- spec.add_dependency "negarmoji", "~> 0.1.3"
28
+ spec.add_dependency "negarmoji", "~> 0.1.4"
29
29
 
30
30
  spec.add_development_dependency "bundler", "~> 2.0"
31
31
  spec.add_development_dependency "rake", "~> 13.0"
@@ -62,7 +62,7 @@ module HTML
62
62
  end
63
63
  end
64
64
 
65
- # The base url to link emoji sprites
65
+ # The base url to link emoji sprites.
66
66
  #
67
67
  # Raises ArgumentError if context option has not been provided.
68
68
  # Returns the context's asset_root.
@@ -70,7 +70,7 @@ module HTML
70
70
  context[:asset_root]
71
71
  end
72
72
 
73
- # The url path to link emoji sprites
73
+ # The url path to link emoji sprites.
74
74
  #
75
75
  # :file_name can be used in the asset_path as a placeholder for the sprite
76
76
  # file name.
@@ -105,7 +105,7 @@ module HTML
105
105
 
106
106
  private
107
107
 
108
- # Build an emoji image tag
108
+ # Build an emoji image tag.
109
109
  def emoji_image_tag(name)
110
110
  require "active_support/core_ext/hash/indifferent_access"
111
111
  html_attrs = default_img_attrs(name)
@@ -119,12 +119,15 @@ module HTML
119
119
  "<img #{html_attrs}>"
120
120
  end
121
121
 
122
- # Default attributes for img tag
122
+ # Default attributes for img tag.
123
123
  def default_img_attrs(name)
124
+ # extract emoji info.
125
+ emoji = Emoji.find_by_alias(name)
126
+ # default attrs.
124
127
  {
125
128
  :class => "emoji",
126
- :title => ":#{name}:",
127
- :alt => ":#{name}:",
129
+ :title => emoji.name.to_s,
130
+ :alt => emoji.raw.to_s,
128
131
  :src => emoji_url(name).to_s,
129
132
  :height => "20",
130
133
  :width => "20",
@@ -3,7 +3,7 @@
3
3
  module Html
4
4
  module Pipeline
5
5
  module NegarMojiHtmlPipeline
6
- VERSION = "0.1.0"
6
+ VERSION = "0.1.1"
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: html-pipeline-negarmoji
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mohammad Mahdi Baghbani Pourvahid
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-17 00:00:00.000000000 Z
11
+ date: 2019-12-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: html-pipeline
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.1.3
33
+ version: 0.1.4
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.1.3
40
+ version: 0.1.4
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement