jekyll-assets 0.9.1 → 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/HISTORY.md +4 -0
- data/lib/jekyll/assets_plugin/renderer.rb +1 -0
- data/lib/jekyll/assets_plugin/version.rb +1 -1
- data/spec/lib/jekyll/assets_plugin/tag_spec.rb +24 -7
- 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: be09a65858868010feaa42928c212ab8c02469fc
|
4
|
+
data.tar.gz: 2e86bb155a6c8f49775600a0230a4b795f2bd5cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 588585739f1351fd9e22ce57ab6eefefffa2b5d35f16bd40614733fb25d0098fa15adc0e4913a33526c00b45d6c799113ea9b9a857fcbb0854a66d146ebc4212
|
7
|
+
data.tar.gz: 2f98a13683f3d5c6dcc3efdb9329f405d8ef44afbd404990183479a440ae05c441bf2e6b69b10c143a18f2d99136071200cca0705ab5a2210b79fcb2f7988e04
|
data/HISTORY.md
CHANGED
@@ -12,14 +12,16 @@ RSpec.describe Jekyll::AssetsPlugin::Tag do
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def render_tag(template, path, attrs = "")
|
15
|
-
template
|
15
|
+
template = Jekyll::AssetsPlugin::Renderer.const_get template
|
16
|
+
attrs = " #{attrs}" unless attrs.empty?
|
17
|
+
|
16
18
|
format template, :path => path, :attrs => attrs
|
17
19
|
end
|
18
20
|
|
19
21
|
context "{% image <file> %}" do
|
20
|
-
def tag_re(name)
|
22
|
+
def tag_re(name, attrs = "")
|
21
23
|
file = "/assets/#{name}-[a-f0-9]{32}\.png"
|
22
|
-
Regexp.new "^#{render_tag :IMAGE, file}$"
|
24
|
+
Regexp.new "^#{render_tag :IMAGE, file, attrs}$"
|
23
25
|
end
|
24
26
|
|
25
27
|
context "when <file> exists" do
|
@@ -27,6 +29,11 @@ RSpec.describe Jekyll::AssetsPlugin::Tag do
|
|
27
29
|
it { is_expected.to match tag_re("noise") }
|
28
30
|
end
|
29
31
|
|
32
|
+
context "when <file> has an attribute" do
|
33
|
+
subject { render("{% image noise.png alt=\"Foobar\" %}") }
|
34
|
+
it { is_expected.to match tag_re("noise", "alt=\"Foobar\"") }
|
35
|
+
end
|
36
|
+
|
30
37
|
context "when <file> does not exists" do
|
31
38
|
subject { render("{% image not-found.png %}") }
|
32
39
|
it { is_expected.to match not_found_error "not-found.png" }
|
@@ -34,9 +41,9 @@ RSpec.describe Jekyll::AssetsPlugin::Tag do
|
|
34
41
|
end
|
35
42
|
|
36
43
|
context "{% stylesheet <file> %}" do
|
37
|
-
def tag_re(name)
|
44
|
+
def tag_re(name, attrs = "")
|
38
45
|
file = "/assets/#{name}-[a-f0-9]{32}\.css"
|
39
|
-
Regexp.new "^#{render_tag :STYLESHEET, file}$"
|
46
|
+
Regexp.new "^#{render_tag :STYLESHEET, file, attrs}$"
|
40
47
|
end
|
41
48
|
|
42
49
|
context "when <file> exists" do
|
@@ -44,6 +51,11 @@ RSpec.describe Jekyll::AssetsPlugin::Tag do
|
|
44
51
|
it { is_expected.to match tag_re("app") }
|
45
52
|
end
|
46
53
|
|
54
|
+
context "when <file> has an attribute" do
|
55
|
+
subject { render("{% stylesheet app.css type=\"text/css\" %}") }
|
56
|
+
it { is_expected.to match tag_re("app", "type=\"text/css\"") }
|
57
|
+
end
|
58
|
+
|
47
59
|
context "when <file> name has multiple dots" do
|
48
60
|
subject { render("{% stylesheet app.min %}") }
|
49
61
|
it { is_expected.to match tag_re("app.min") }
|
@@ -61,9 +73,9 @@ RSpec.describe Jekyll::AssetsPlugin::Tag do
|
|
61
73
|
end
|
62
74
|
|
63
75
|
context "{% javascript <file> %}" do
|
64
|
-
def tag_re(name)
|
76
|
+
def tag_re(name, attrs = "")
|
65
77
|
file = "/assets/#{name}-[a-f0-9]{32}\.js"
|
66
|
-
Regexp.new "^#{render_tag :JAVASCRIPT, file}$"
|
78
|
+
Regexp.new "^#{render_tag :JAVASCRIPT, file, attrs}$"
|
67
79
|
end
|
68
80
|
|
69
81
|
context "when <file> exists" do
|
@@ -71,6 +83,11 @@ RSpec.describe Jekyll::AssetsPlugin::Tag do
|
|
71
83
|
it { is_expected.to match tag_re("app") }
|
72
84
|
end
|
73
85
|
|
86
|
+
context "when <file> has an attribute" do
|
87
|
+
subject { render("{% javascript app.js type=\"text/javascript\" %}") }
|
88
|
+
it { is_expected.to match tag_re("app", "type=\"text/javascript\"") }
|
89
|
+
end
|
90
|
+
|
74
91
|
context "when <file> name has multiple dots" do
|
75
92
|
subject { render("{% javascript app.min %}") }
|
76
93
|
it { is_expected.to match tag_re("app.min") }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-assets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aleksey V Zapparov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-08-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -205,7 +205,7 @@ rubyforge_project:
|
|
205
205
|
rubygems_version: 2.2.2
|
206
206
|
signing_key:
|
207
207
|
specification_version: 4
|
208
|
-
summary: jekyll-assets-0.9.
|
208
|
+
summary: jekyll-assets-0.9.2
|
209
209
|
test_files:
|
210
210
|
- spec/fixtures/.gitignore
|
211
211
|
- spec/fixtures/_assets/alert.js
|