jemoji 0.6.2 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/jemoji.rb +19 -5
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f5813292ceb0435933a7292e5ed4c4e6d6c74bf
|
4
|
+
data.tar.gz: 6f889170c3c5714835aac5be4864629fe61be9eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68ae4fe100adfb5e5b7b81e0e454dc5ea31292ec1cd3dc895c3412b5533f305984b86e7dc0c1921e8bdb5af9ef5a31a3be14d91e8aeaec08a41892caef1db92d
|
7
|
+
data.tar.gz: d07ca007174b814a835a681165d191bd0eb2bd60f14a85cf6293b76dbd85667bdcdb149bb57a173ac7ca09a08179d2ad2aae41af194560ff8d347f041126689c
|
data/lib/jemoji.rb
CHANGED
@@ -4,7 +4,8 @@ require 'html/pipeline'
|
|
4
4
|
|
5
5
|
module Jekyll
|
6
6
|
class Emoji
|
7
|
-
|
7
|
+
GITHUB_DOT_COM_ASSET_HOST_URL = "https://assets-cdn.github.com".freeze
|
8
|
+
ASSET_PATH = "/images/icons/".freeze
|
8
9
|
BODY_START_TAG = "<body".freeze
|
9
10
|
|
10
11
|
class << self
|
@@ -23,7 +24,7 @@ module Jekyll
|
|
23
24
|
|
24
25
|
# Public: Create or fetch the filter for the given {{src}} asset root.
|
25
26
|
#
|
26
|
-
# src - the asset root URL (e.g. https://assets.github.com/images/icons/)
|
27
|
+
# src - the asset root URL (e.g. https://assets-cdn.github.com/images/icons/)
|
27
28
|
#
|
28
29
|
# Returns an HTML::Pipeline instance for the given asset root.
|
29
30
|
def filter_with_emoji(src)
|
@@ -45,13 +46,14 @@ module Jekyll
|
|
45
46
|
#
|
46
47
|
# config - the hash-like configuration of the document's site
|
47
48
|
#
|
48
|
-
# Returns a full URL to use as the asset root URL. Defaults to
|
49
|
-
#
|
49
|
+
# Returns a full URL to use as the asset root URL. Defaults to the root
|
50
|
+
# URL for assets provided by an ASSET_HOST_URL environment variable,
|
51
|
+
# otherwise the root URL for emoji assets at assets-cdn.github.com.
|
50
52
|
def emoji_src(config = {})
|
51
53
|
if config.key?("emoji") && config["emoji"].key?("src")
|
52
54
|
config["emoji"]["src"]
|
53
55
|
else
|
54
|
-
|
56
|
+
default_asset_root
|
55
57
|
end
|
56
58
|
end
|
57
59
|
|
@@ -64,6 +66,18 @@ module Jekyll
|
|
64
66
|
(doc.is_a?(Jekyll::Page) || doc.write?) &&
|
65
67
|
doc.output_ext == ".html" || (doc.permalink && doc.permalink.end_with?("/"))
|
66
68
|
end
|
69
|
+
|
70
|
+
private
|
71
|
+
|
72
|
+
def default_asset_root
|
73
|
+
if !ENV["ASSET_HOST_URL"].to_s.empty?
|
74
|
+
# Ensure that any trailing "/" is trimmed
|
75
|
+
asset_host_url = ENV["ASSET_HOST_URL"].chomp("/")
|
76
|
+
"#{asset_host_url}#{ASSET_PATH}"
|
77
|
+
else
|
78
|
+
"#{GITHUB_DOT_COM_ASSET_HOST_URL}#{ASSET_PATH}"
|
79
|
+
end
|
80
|
+
end
|
67
81
|
end
|
68
82
|
end
|
69
83
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jemoji
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GitHub, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '2.2'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: activesupport
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '4.0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '4.0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: gemoji
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|