jemoji-plus 0.1.7 → 0.1.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/jemoji_plus.rb +22 -17
  3. metadata +5 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3fe0934b1f6c45efa396e5980db921ab5dc3f322d3e1059660e9a4b2b91c9e87
4
- data.tar.gz: 16e7017a6442789b69f588b8fa12b8b7deeed466c0a5cbc4bb842033218f6f48
3
+ metadata.gz: a351ce7c6cc403a6a030e6b247dc7e6bf04678543d9c11fa697e75bfafd5ff06
4
+ data.tar.gz: a38db1e29b24b2d63ce12990bc587b4f86cd028268d3d6da54f2b8704d5698fe
5
5
  SHA512:
6
- metadata.gz: 1bb752cc3497d1992c7e7c542cebee283b85ce1b06636bc2dbf27260093229ed20d23f0304cbe1e579864ab585ed17e1cdae9c10b7bef7a9f7f06c08a668a640
7
- data.tar.gz: 335289b74ec7da50c2ad75343207b8f6a4c48da1b19a70dfe7938b0219a848719c67985a630215dd4caba220749b2b27bacaab030a80213ec05bdf0d16131e10
6
+ metadata.gz: 13c12a0e5f464907c74a1121217c237ba3bc646490dfe350047b1323a63bbe01f3f7a321e92e381f0a67ae8796ee66f8ed27c4aa997883adb9491d21c7c11824
7
+ data.tar.gz: b31de423976cf8d2980a447a6c9fdd6a2afece104b23a9a481af6e2de8136331eb46137dc2930049ad4dfc4edfd54a19ee2c665f653bf609e462720259584b4b
@@ -2,10 +2,10 @@
2
2
 
3
3
  require "jekyll"
4
4
  require "gemoji"
5
- require "html/pipeline_plus"
5
+ require "html/pipeline"
6
6
 
7
7
  module Jekyll
8
- class Emoji
8
+ class Emoji_Plus
9
9
  ASSET_HOST = "https://github.githubassets.com"
10
10
  ASSET_PATH = "/images/icons/"
11
11
  BODY_START_TAG = "<body"
@@ -51,7 +51,7 @@ module Jekyll
51
51
  # URL for assets provided by an ASSET_HOST environment variable,
52
52
  # otherwise the root URL for emoji assets at assets-cdn.github.com.
53
53
  def emoji_src(config = {})
54
- if config.key?("jemoji_plus") && config["jemoji_plus"].key?("host") && config["jemoji_plus"].key?("path")
54
+ if config.key?("emoji-plus") && config["emoji-plus"].key?("host") && config["emoji-plus"].key?("path")
55
55
  config_asset_root(config)
56
56
  else
57
57
  default_asset_root
@@ -72,25 +72,30 @@ module Jekyll
72
72
 
73
73
  def config_asset_root(config)
74
74
  # Ensure that any trailing "/" is trimmed.
75
- asset_host_url = config["jemoji_plus"]["host"].chomp("/")
76
- asset_path = config["jemoji_plus"]["path"]
77
- # If asset_path is not empty, ensure it is start with "/" character.
78
- if !asset_path.empty?
79
- # '/' ascii code is 47
80
- if asset_path[0] != 47
81
- asset_path = '/' + asset_path
82
- end
75
+ asset_host_url = config["emoji-plus"]["host"].chomp("/")
76
+ # Ensure [asset_path] is start with "/".
77
+ asset_path = config["emoji-plus"]["path"]
78
+ if !asset_path.start_with?("/")
79
+ "#{asset_host_url}/#{asset_path}"
80
+ else
81
+ "#{asset_host_url}#{asset_path}"
83
82
  end
84
- "#{asset_host_url}#{asset_path}"
85
83
  end
86
84
 
87
85
  def default_asset_root
88
86
  if !ENV["ASSET_HOST_URL"].to_s.empty?
89
- # Ensure that any trailing "/" is trimmed
90
- asset_host_url = ENV["ASSET_HOST_URL"].chomp("/")
91
- "#{asset_host_url}#{ASSET_PATH}"
87
+ asset_host_url = ENV["ASSET_HOST_URL"]
88
+ else
89
+ asset_host_url = ASSET_HOST
90
+ end
91
+ # Ensure that any trailing "/" is trimmed.
92
+ asset_host_url = asset_host_url.chomp("/")
93
+ # Ensure [asset_path] is start with "/".
94
+ asset_path = ASSET_PATH
95
+ if !asset_path.start_with?("/")
96
+ "#{asset_host_url}/#{asset_path}"
92
97
  else
93
- "#{ASSET_HOST}#{ASSET_PATH}"
98
+ "#{asset_host_url}#{asset_path}"
94
99
  end
95
100
  end
96
101
 
@@ -106,5 +111,5 @@ module Jekyll
106
111
  end
107
112
 
108
113
  Jekyll::Hooks.register [:pages, :documents], :post_render do |doc|
109
- Jekyll::Emoji.emojify(doc) if Jekyll::Emoji.emojiable?(doc)
114
+ Jekyll::Emoji_Plus.emojify(doc) if Jekyll::Emoji_Plus.emojiable?(doc)
110
115
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jemoji-plus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - shines77 and GitHub, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-18 00:00:00.000000000 Z
11
+ date: 2020-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gemoji
@@ -25,19 +25,19 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '3.0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: html-pipeline-plus
28
+ name: html-pipeline
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 2.10.7
33
+ version: '2.2'
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: 2.10.7
40
+ version: '2.2'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: jekyll
43
43
  requirement: !ruby/object:Gem::Requirement