jekyll-assets 0.9.1 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5fdc398b27cedf84be860226e11d4d2de56f19f5
4
- data.tar.gz: fe1671b80e6d5831844a48b2acd21c008fc49bf6
3
+ metadata.gz: be09a65858868010feaa42928c212ab8c02469fc
4
+ data.tar.gz: 2e86bb155a6c8f49775600a0230a4b795f2bd5cc
5
5
  SHA512:
6
- metadata.gz: e83bb90c308e9497a5694c006275c44afb12991db55c69ad7783101f95f37d17bb060fc71b85723fbad4f7631884e41a91da3a8f34ef514f554f268753569acf
7
- data.tar.gz: 67b4bc55cbb60365d02e4242daf6c0ea6008cf7c0998dc4201f8f9fd438802042e996786d59ceb76c279dc2bff970c1fa4de7e8f76cb585edcda2ad0d4e27146
6
+ metadata.gz: 588585739f1351fd9e22ce57ab6eefefffa2b5d35f16bd40614733fb25d0098fa15adc0e4913a33526c00b45d6c799113ea9b9a857fcbb0854a66d146ebc4212
7
+ data.tar.gz: 2f98a13683f3d5c6dcc3efdb9329f405d8ef44afbd404990183479a440ae05c441bf2e6b69b10c143a18f2d99136071200cca0705ab5a2210b79fcb2f7988e04
data/HISTORY.md CHANGED
@@ -1,6 +1,10 @@
1
1
  ### master (unreleased)
2
2
 
3
3
 
4
+ ### 0.9.2 (2014-08-05)
5
+
6
+ * Fix tags renderer with attributes. See #93. (Thanks @tomdiggle)
7
+
4
8
 
5
9
  ### 0.9.1 (2014-07-28)
6
10
 
@@ -12,6 +12,7 @@ module Jekyll
12
12
  @path = logical_path.strip
13
13
 
14
14
  @path, _, @attrs = @path.partition(" ") if @path[" "]
15
+ @attrs.prepend(" ") if @attrs
15
16
  end
16
17
 
17
18
  def render_asset
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module AssetsPlugin
3
- VERSION = "0.9.1"
3
+ VERSION = "0.9.2"
4
4
  end
5
5
  end
@@ -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 = Jekyll::AssetsPlugin::Renderer.const_get 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.1
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-07-28 00:00:00.000000000 Z
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.1
208
+ summary: jekyll-assets-0.9.2
209
209
  test_files:
210
210
  - spec/fixtures/.gitignore
211
211
  - spec/fixtures/_assets/alert.js