jekyll-gist 1.4.0 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -7
- data/History.markdown +7 -1
- data/Rakefile +0 -1
- data/lib/jekyll-gist/gist_tag.rb +14 -4
- data/lib/jekyll-gist/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 80753f3b576cd9ade3d547147b187ce45acbc447
|
4
|
+
data.tar.gz: 38fcbfd0e9f1d2bc7854a6ab5b7f0e66eeb516fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7b28c4b95e96a1eb47e4e02542bfd9c0da61865c80f53159b7fce4c3de184cc2446af79942621692b9ea40ca502d7860b71f7bac927dc48e15b32551df8db99
|
7
|
+
data.tar.gz: 266bfd8cb221b5b4a9d5f1607444c2a5496fbe77480e26cd77286dfa22d7889e91447b33b25d79bfbc08d086b75b5c504872b0d5fdd0f2a733272463a93659fb
|
data/.travis.yml
CHANGED
@@ -8,18 +8,15 @@ branches:
|
|
8
8
|
- master
|
9
9
|
|
10
10
|
rvm:
|
11
|
+
- 2.4
|
12
|
+
- 2.3
|
11
13
|
- 2.2
|
12
14
|
- 2.1
|
13
|
-
- 2.0
|
14
15
|
env:
|
15
16
|
- ""
|
16
|
-
- JEKYLL_VERSION=3.
|
17
|
-
- JEKYLL_VERSION=2.0
|
17
|
+
- JEKYLL_VERSION=3.4.4
|
18
18
|
matrix:
|
19
19
|
include:
|
20
20
|
- # GitHub Pages
|
21
|
-
rvm: 2.
|
21
|
+
rvm: 2.4.0
|
22
22
|
env: GH_PAGES=true
|
23
|
-
- # Ruby 1.9
|
24
|
-
rvm: 1.9
|
25
|
-
env: JEKYLL_VERSION=2.0
|
data/History.markdown
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
## 1.4.1 / 2017-06-21
|
2
|
+
|
3
|
+
* Don't ask .empty? until it's a String. (#38)
|
4
|
+
* rename Liquid 4 `has_key?` to `key?` to add compatibility for liquid 4 (#41)
|
5
|
+
* Test against Ruby 2.1 to 2.4 (#45)
|
6
|
+
|
1
7
|
## 1.4.0 / 2015-12-01
|
2
8
|
|
3
9
|
* Allow `noscript` fallback to be disabled (#29)
|
@@ -21,7 +27,7 @@
|
|
21
27
|
* Re-add support for Ruby 1.9.3. Fixes #11 for 1.9.3 (#14)
|
22
28
|
* Replaced `OpenURI` with `Net::HTTP` and introduced timeout of 3 seconds (#11)
|
23
29
|
|
24
|
-
## 1.3.1 / 2015-08-16
|
30
|
+
## 1.3.1 / 2015-08-16
|
25
31
|
|
26
32
|
* Replaced `OpenURI` with `Net::HTTP` and introduced timeout of 3 seconds (#11)
|
27
33
|
|
data/Rakefile
CHANGED
data/lib/jekyll-gist/gist_tag.rb
CHANGED
@@ -14,10 +14,10 @@ module Jekyll
|
|
14
14
|
@settings = context.registers[:site].config['gist']
|
15
15
|
if tag_contents = determine_arguments(@markup.strip)
|
16
16
|
gist_id, filename = tag_contents[0], tag_contents[1]
|
17
|
-
if
|
17
|
+
if context_contains_key?(context, gist_id)
|
18
18
|
gist_id = context[gist_id]
|
19
19
|
end
|
20
|
-
if
|
20
|
+
if context_contains_key?(context, filename)
|
21
21
|
filename = context[filename]
|
22
22
|
end
|
23
23
|
noscript_tag = gist_noscript_tag(gist_id, filename)
|
@@ -45,9 +45,19 @@ module Jekyll
|
|
45
45
|
[matched[1].strip, matched[2].strip] if matched && matched.length >= 3
|
46
46
|
end
|
47
47
|
|
48
|
+
private
|
49
|
+
|
50
|
+
def context_contains_key?(context, key)
|
51
|
+
if context.respond_to?(:has_key?)
|
52
|
+
context.has_key?(key)
|
53
|
+
else
|
54
|
+
context.key?(key)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
48
58
|
def gist_script_tag(gist_id, filename = nil)
|
49
59
|
url = "https://gist.github.com/#{gist_id}.js"
|
50
|
-
url = "#{url}?file=#{filename}" unless filename.empty?
|
60
|
+
url = "#{url}?file=#{filename}" unless filename.to_s.empty?
|
51
61
|
"<script src=\"#{url}\"> </script>"
|
52
62
|
end
|
53
63
|
|
@@ -74,7 +84,7 @@ module Jekyll
|
|
74
84
|
return code_from_api(gist_id, filename) if ENV["JEKYLL_GITHUB_TOKEN"]
|
75
85
|
|
76
86
|
url = "https://gist.githubusercontent.com/#{gist_id}/raw"
|
77
|
-
url = "#{url}/#{filename}" unless filename.empty?
|
87
|
+
url = "#{url}/#{filename}" unless filename.to_s.empty?
|
78
88
|
uri = URI(url)
|
79
89
|
Net::HTTP.start(uri.host, uri.port,
|
80
90
|
use_ssl: uri.scheme == 'https',
|
data/lib/jekyll-gist/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-gist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Parker Moore
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: octokit
|
@@ -139,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
139
139
|
version: '0'
|
140
140
|
requirements: []
|
141
141
|
rubyforge_project:
|
142
|
-
rubygems_version: 2.
|
142
|
+
rubygems_version: 2.6.11
|
143
143
|
signing_key:
|
144
144
|
specification_version: 4
|
145
145
|
summary: Liquid tag for displaying GitHub Gists in Jekyll sites.
|