jemoji-plus 0.1.8 → 0.1.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jemoji_plus.rb +23 -22
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0643b792ed757b5cb5d391643d795ce0c94643fe8d8245a136d40d9761eff08b
|
4
|
+
data.tar.gz: 60827ab301dced59ea5d0900eef6f0a90ca06fd13deca0063ba5caf78a79538a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9373b435ce33e2a91612386e8e514f85678442dff4dbfbc8aeccadd09c8ef7c38866d361dee865cd033e1c3c1573dd0e5bf5050a8641b1fc901dc6c11886272f
|
7
|
+
data.tar.gz: b402e613eae5e03abcd27ac64280396d425c7b298c2b71f366f99979e64203f863f40ca818026e076559245963c64d621dd06a9e12a7ba979842bd4c57c7bd72
|
data/lib/jemoji_plus.rb
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
require "jekyll"
|
4
4
|
require "gemoji"
|
5
|
-
require "html/
|
5
|
+
require "html/pipeline"
|
6
6
|
|
7
7
|
module Jekyll
|
8
|
-
class
|
9
|
-
|
8
|
+
class EmojiPlus
|
9
|
+
ASSET_HOST_URL = "https://github.githubassets.com"
|
10
10
|
ASSET_PATH = "/images/icons/"
|
11
11
|
BODY_START_TAG = "<body"
|
12
12
|
OPENING_BODY_TAG_REGEX = %r!<body(.*?)>\s*!.freeze
|
@@ -48,10 +48,10 @@ module Jekyll
|
|
48
48
|
# config - the hash-like configuration of the document's site
|
49
49
|
#
|
50
50
|
# Returns a full URL to use as the asset root URL. Defaults to the root
|
51
|
-
# URL for assets provided by an
|
51
|
+
# URL for assets provided by an ASSET_HOST_URL 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?("
|
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,29 +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["
|
76
|
-
|
77
|
-
|
78
|
-
if
|
79
|
-
#
|
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}"
|
83
80
|
else
|
84
|
-
asset_path
|
81
|
+
"#{asset_host_url}\/#{asset_path}"
|
85
82
|
end
|
86
|
-
"#{asset_host_url}#{asset_path}"
|
87
83
|
end
|
88
84
|
|
89
85
|
def default_asset_root
|
90
86
|
if !ENV["ASSET_HOST_URL"].to_s.empty?
|
91
|
-
|
92
|
-
asset_host_url = ENV["ASSET_HOST_URL"].chomp("/")
|
93
|
-
# Ensure the trailing is end with "/".
|
94
|
-
asset_host_url.concat("/")
|
95
|
-
"#{asset_host_url}#{ASSET_PATH}"
|
87
|
+
asset_host_url = ENV["ASSET_HOST_URL"]
|
96
88
|
else
|
97
|
-
|
89
|
+
asset_host_url = ASSET_HOST_URL
|
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}"
|
97
|
+
else
|
98
|
+
"#{asset_host_url}\/#{asset_path}"
|
98
99
|
end
|
99
100
|
end
|
100
101
|
|
@@ -110,5 +111,5 @@ module Jekyll
|
|
110
111
|
end
|
111
112
|
|
112
113
|
Jekyll::Hooks.register [:pages, :documents], :post_render do |doc|
|
113
|
-
Jekyll::
|
114
|
+
Jekyll::EmojiPlus.emojify(doc) if Jekyll::EmojiPlus.emojiable?(doc)
|
114
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.
|
4
|
+
version: 0.1.14
|
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:
|
11
|
+
date: 2020-06-17 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
|
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.
|
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.
|
40
|
+
version: '2.2'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: jekyll
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -56,16 +56,16 @@ dependencies:
|
|
56
56
|
name: bundler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
61
|
+
version: '2.0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
68
|
+
version: '2.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rake
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|