jekyll-gist 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +8 -0
- data/History.markdown +9 -1
- data/lib/jekyll-gist/gist_tag.rb +6 -0
- data/lib/jekyll-gist/version.rb +1 -1
- data/script/bootstrap +3 -0
- data/script/cibuild +3 -0
- data/spec/gist_tag_spec.rb +29 -0
- data/spec/spec_helper.rb +0 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed09a3cafb596362202df4f48741906cbddec749
|
4
|
+
data.tar.gz: 0a90da5fabf39ea40b4b17e24a6e8bc93d519d0e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 095086033d1f0df077e8ce8b8b0bdc88bcaa3752a24319015fb1103f48836b5835b7370c2cd341647091d050afaec9fc80686bc92e97ba5b1c423ea4e9a29090
|
7
|
+
data.tar.gz: 7cb7bc609c2c35d52b1060b7a0ace74889fad705916000719fbc076befdbdb0608bac15b295faedfb6b9cf9020b4bf8c35a67ffa338e1c1fe9c130815fb0c1af
|
data/.travis.yml
ADDED
data/History.markdown
CHANGED
data/lib/jekyll-gist/gist_tag.rb
CHANGED
@@ -5,6 +5,12 @@ module Jekyll
|
|
5
5
|
def render(context)
|
6
6
|
if tag_contents = determine_arguments(@markup.strip)
|
7
7
|
gist_id, filename = tag_contents[0], tag_contents[1]
|
8
|
+
if context[gist_id]
|
9
|
+
gist_id = context[gist_id]
|
10
|
+
end
|
11
|
+
if context[filename]
|
12
|
+
filename = context[filename]
|
13
|
+
end
|
8
14
|
gist_script_tag(gist_id, filename)
|
9
15
|
else
|
10
16
|
raise ArgumentError.new <<-eos
|
data/lib/jekyll-gist/version.rb
CHANGED
data/script/bootstrap
ADDED
data/script/cibuild
ADDED
data/spec/gist_tag_spec.rb
CHANGED
@@ -43,6 +43,35 @@ describe(Jekyll::Gist::GistTag) do
|
|
43
43
|
expect(output).to match(/<script src="https:\/\/gist.github.com\/#{gist}.js\?file=#{filename}">\s<\/script>/)
|
44
44
|
end
|
45
45
|
end
|
46
|
+
|
47
|
+
context "with variable gist id" do
|
48
|
+
let(:gist) { "page.gist_id" }
|
49
|
+
let(:output) do
|
50
|
+
doc.data['gist_id'] = "1342013"
|
51
|
+
doc.content = content
|
52
|
+
doc.output = Jekyll::Renderer.new(doc.site, doc).run
|
53
|
+
end
|
54
|
+
|
55
|
+
it "produces the correct script tag" do
|
56
|
+
expect(output).to match(/<script src="https:\/\/gist.github.com\/#{doc.data['gist_id']}.js">\s<\/script>/)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
context "with variable gist id and filename" do
|
61
|
+
let(:gist) { "page.gist_id" }
|
62
|
+
let(:filename) { "page.gist_filename" }
|
63
|
+
let(:content) { "{% gist #{gist} #{filename} %}" }
|
64
|
+
let(:output) do
|
65
|
+
doc.data['gist_id'] = "1342013"
|
66
|
+
doc.data['gist_filename'] = "atom.xml"
|
67
|
+
doc.content = content
|
68
|
+
doc.output = Jekyll::Renderer.new(doc.site, doc).run
|
69
|
+
end
|
70
|
+
|
71
|
+
it "produces the correct script tag" do
|
72
|
+
expect(output).to match(/<script src="https:\/\/gist.github.com\/#{doc.data['gist_id']}.js\?file=#{doc.data['gist_filename']}">\s<\/script>/)
|
73
|
+
end
|
74
|
+
end
|
46
75
|
end
|
47
76
|
|
48
77
|
|
data/spec/spec_helper.rb
CHANGED
@@ -8,7 +8,6 @@ Jekyll.logger.log_level = :error
|
|
8
8
|
STDERR.reopen(test(?e, '/dev/null') ? '/dev/null' : 'NUL:')
|
9
9
|
|
10
10
|
RSpec.configure do |config|
|
11
|
-
config.treat_symbols_as_metadata_keys_with_true_values = true
|
12
11
|
config.run_all_when_everything_filtered = true
|
13
12
|
config.filter_run :focus
|
14
13
|
config.order = 'random'
|
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
|
+
version: 1.2.0
|
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: 2015-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -75,6 +75,7 @@ extra_rdoc_files: []
|
|
75
75
|
files:
|
76
76
|
- ".gitignore"
|
77
77
|
- ".rspec"
|
78
|
+
- ".travis.yml"
|
78
79
|
- Gemfile
|
79
80
|
- History.markdown
|
80
81
|
- LICENSE.txt
|
@@ -84,6 +85,8 @@ files:
|
|
84
85
|
- lib/jekyll-gist.rb
|
85
86
|
- lib/jekyll-gist/gist_tag.rb
|
86
87
|
- lib/jekyll-gist/version.rb
|
88
|
+
- script/bootstrap
|
89
|
+
- script/cibuild
|
87
90
|
- spec/gist_tag_spec.rb
|
88
91
|
- spec/spec_helper.rb
|
89
92
|
homepage: https://github.com/jekyll/jekyll-gist
|