jekyll-gist 1.0.0 → 1.1.0

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: ae9a1f020a20730b4d05b3264615d466c95eaa38
4
- data.tar.gz: 68298be1c9f87daf66fb9a45179e500056e849fa
3
+ metadata.gz: 956dde53efdc7ba004b745ad63965672a082de7b
4
+ data.tar.gz: 1bb48861f6d8676f0450b3508390f28da05b0040
5
5
  SHA512:
6
- metadata.gz: b7d2155feaf88a4a587379de08206e83708a8df4784cc8020a385b2c5f1c8514054c0d5811ffa8c0313d9d7ecfd91c8d7f83dcbd311221951c2586327de59d25
7
- data.tar.gz: 44461408e409690988f71fa94485cb5d8751edcf5dc68e3949c3816ee7d2148bc9f90a7fcc0941fd5b3351fc16950958637775a00e3cebeaa4235658d642f24c
6
+ metadata.gz: 579e357cb1bc2996bb2d4c2a6fb4daf5f1c9a33e794ab7eef245a7c20197cd88cac90dc81cfae6fdc33b1d15de1101801e6341ceb3c97e4f0d9a2105f27d3c6a
7
+ data.tar.gz: 3e286821b3a9820c1049908d1cae54e9b7df2d6892499f8fadc475a36b401f7acc7269e3510b22f5dad4c77ac2544f901bf48d6b46951395c4660b4960cc2a6d
data/History.markdown ADDED
@@ -0,0 +1,11 @@
1
+ ## HEAD
2
+
3
+ ## 1.1.0 / 2014-06-18
4
+
5
+ ### Minor Enhancements
6
+
7
+ * Update regex to allow for new sha-ish ids in Gist. (#1)
8
+
9
+ ## 1.0.0 / 2014-06-01
10
+
11
+ * Birthday!
data/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  Liquid tag for displaying GitHub Gists in Jekyll sites: `{% gist %}`.
4
4
 
5
+ [![Build Status](https://travis-ci.org/jekyll/jekyll-gist.svg?branch=master)](https://travis-ci.org/jekyll/jekyll-gist)
6
+
5
7
  ## Installation
6
8
 
7
9
  Add this line to your application's Gemfile:
@@ -13,7 +13,10 @@ module Jekyll
13
13
  #{@markup}
14
14
 
15
15
  Valid syntax:
16
- for all gists: {% gist user/1234567 %}
16
+ {% gist user/1234567 %}
17
+ {% gist user/1234567 foo.js %}
18
+ {% gist 28949e1d5ee2273f9fd3 %}
19
+ {% gist 28949e1d5ee2273f9fd3 best.md %}
17
20
  eos
18
21
  end
19
22
  end
@@ -21,11 +24,7 @@ module Jekyll
21
24
  private
22
25
 
23
26
  def determine_arguments(input)
24
- matched = if input.include?("/")
25
- input.match(/\A([a-zA-Z0-9\/\-_]+) ?(\S*)\Z/)
26
- else
27
- input.match(/\A(\d+) ?(\S*)\Z/)
28
- end
27
+ matched = input.match(/\A([\S]+|.*(?=\/).+)\s?(\S*)\Z/)
29
28
  [matched[1].strip, matched[2].strip] if matched && matched.length >= 3
30
29
  end
31
30
 
@@ -41,4 +40,4 @@ module Jekyll
41
40
  end
42
41
  end
43
42
 
44
- Liquid::Template.register_tag('gist', Jekyll::Gist::GistTag)
43
+ Liquid::Template.register_tag('gist', Jekyll::Gist::GistTag)
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module Gist
3
- VERSION = "1.0.0"
3
+ VERSION = "1.1.0"
4
4
  end
5
5
  end
@@ -8,18 +8,26 @@ describe(Jekyll::Gist::GistTag) do
8
8
  doc.output = Jekyll::Renderer.new(doc.site, doc).run
9
9
  end
10
10
 
11
- context "simple gist" do
12
- let(:gist) { 358471 }
13
11
 
14
- it "produces the correct script tag" do
15
- expect(output).to match(/<script src="https:\/\/gist.github.com\/#{gist}.js">\s<\/script>/)
12
+ context "valid gist" do
13
+ context "with user prefix" do
14
+ let(:gist) { "mattr-/24081a1d93d2898ecf0f" }
15
+
16
+ it "produces the correct script tag" do
17
+ expect(output).to match(/<script src="https:\/\/gist.github.com\/#{gist}.js">\s<\/script>/)
18
+ end
16
19
  end
17
- end
18
20
 
19
- context "private gist" do
21
+ context "without user prefix" do
22
+ let(:gist) { "28949e1d5ee2273f9fd3" }
20
23
 
21
- context "when valid" do
22
- let(:gist) { "mattr-/24081a1d93d2898ecf0f" }
24
+ it "produces the correct script tag" do
25
+ expect(output).to match(/<script src="https:\/\/gist.github.com\/#{gist}.js">\s<\/script>/)
26
+ end
27
+ end
28
+
29
+ context "classic Gist id style" do
30
+ let(:gist) { "1234321" }
23
31
 
24
32
  it "produces the correct script tag" do
25
33
  expect(output).to match(/<script src="https:\/\/gist.github.com\/#{gist}.js">\s<\/script>/)
@@ -35,9 +43,13 @@ describe(Jekyll::Gist::GistTag) do
35
43
  expect(output).to match(/<script src="https:\/\/gist.github.com\/#{gist}.js\?file=#{filename}">\s<\/script>/)
36
44
  end
37
45
  end
46
+ end
47
+
48
+
49
+ context "invalid gist" do
38
50
 
39
- context "when invalid" do
40
- let(:gist) { "mattr-24081a1d93d2898ecf0f" }
51
+ context "no gist id present" do
52
+ let(:gist) { "" }
41
53
 
42
54
  it "raises an error" do
43
55
  expect(->{ output }).to raise_error
@@ -46,12 +58,4 @@ describe(Jekyll::Gist::GistTag) do
46
58
 
47
59
  end
48
60
 
49
- context "no gist id present" do
50
- let(:gist) { "" }
51
-
52
- it "raises an error" do
53
- expect(->{ output }).to raise_error
54
- end
55
- end
56
-
57
61
  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.0.0
4
+ version: 1.1.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: 2014-06-01 00:00:00.000000000 Z
11
+ date: 2014-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -76,6 +76,7 @@ files:
76
76
  - ".gitignore"
77
77
  - ".rspec"
78
78
  - Gemfile
79
+ - History.markdown
79
80
  - LICENSE.txt
80
81
  - README.md
81
82
  - Rakefile