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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 51416e403d33d8cd13aec298cba2647f63ce68b6
4
- data.tar.gz: 10ae86f8b7a948be0862aa2c3a6b3547d30b0f9e
3
+ metadata.gz: 80753f3b576cd9ade3d547147b187ce45acbc447
4
+ data.tar.gz: 38fcbfd0e9f1d2bc7854a6ab5b7f0e66eeb516fa
5
5
  SHA512:
6
- metadata.gz: 7c26bc80c20feaa1066b2366be6add5430fcc7a7c6f0efb48e4d257745a59c67e4d636d6e6b49fbb0ef94a0c9b1c34f99e5832e7f7626ac58b4685eed1138963
7
- data.tar.gz: b0b37b9fa634058b2af275c683379b97d87ac6fbcda8a3e6ac5273fcb7c6274f0275cf61d93bdf13eaf2fbd8161a61720620fe3902a66a52957c400edcf3db15
6
+ metadata.gz: d7b28c4b95e96a1eb47e4e02542bfd9c0da61865c80f53159b7fce4c3de184cc2446af79942621692b9ea40ca502d7860b71f7bac927dc48e15b32551df8db99
7
+ data.tar.gz: 266bfd8cb221b5b4a9d5f1607444c2a5496fbe77480e26cd77286dfa22d7889e91447b33b25d79bfbc08d086b75b5c504872b0d5fdd0f2a733272463a93659fb
@@ -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.0.0.beta8
17
- - JEKYLL_VERSION=2.0
17
+ - JEKYLL_VERSION=3.4.4
18
18
  matrix:
19
19
  include:
20
20
  - # GitHub Pages
21
- rvm: 2.1.1
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
@@ -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 (yanked)
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
@@ -1,2 +1 @@
1
1
  require "bundler/gem_tasks"
2
-
@@ -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 context.has_key?(gist_id)
17
+ if context_contains_key?(context, gist_id)
18
18
  gist_id = context[gist_id]
19
19
  end
20
- if context.has_key?(filename)
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',
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module Gist
3
- VERSION = "1.4.0"
3
+ VERSION = "1.4.1"
4
4
  end
5
5
  end
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.0
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: 2015-12-01 00:00:00.000000000 Z
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.2.5
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.