jekyll-assets 0.7.7 → 0.7.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,49 +3,46 @@ require "ostruct"
3
3
 
4
4
  require "spec_helper"
5
5
 
6
- module Jekyll::AssetsPlugin
7
- describe Renderer do
8
-
9
- let(:site) do
10
- Jekyll::Site.new Jekyll.configuration({
11
- "source" => fixtures_path.to_s,
12
- "destination" => @dest.to_s,
13
- "assets" => assets_config
14
- })
15
- end
16
-
17
- let(:renderer) do
18
- context = OpenStruct.new(:registers => { :site => site })
19
- Renderer.new context, "app"
20
- end
6
+ describe Jekyll::AssetsPlugin::Renderer do
7
+ let(:site) do
8
+ Jekyll::Site.new Jekyll.configuration({
9
+ "source" => fixtures_path.to_s,
10
+ "destination" => @dest.to_s,
11
+ "assets" => assets_config
12
+ })
13
+ end
21
14
 
22
- describe "#render_javascript" do
23
- subject { renderer.render_javascript }
15
+ let(:renderer) do
16
+ context = OpenStruct.new(:registers => { :site => site })
17
+ described_class.new context, "app"
18
+ end
24
19
 
25
- context "when debug mode enabled" do
26
- let(:assets_config) { Hash[:debug, true] }
27
- it { should match(/^(\s*<script src="[^"]+"><\/script>\s*){3}$/) }
28
- end
20
+ describe "#render_javascript" do
21
+ subject { renderer.render_javascript }
29
22
 
30
- context "when debug mode disabled" do
31
- let(:assets_config) { Hash[:debug, false] }
32
- it { should match(/^(\s*<script src="[^"]+"><\/script>\s*){1}$/) }
33
- end
23
+ context "when debug mode enabled" do
24
+ let(:assets_config) { Hash[:debug, true] }
25
+ it { should match(/^(\s*<script src="[^"]+"><\/script>\s*){3}$/) }
34
26
  end
35
27
 
36
- describe "#render_stylesheet" do
37
- subject { renderer.render_stylesheet }
28
+ context "when debug mode disabled" do
29
+ let(:assets_config) { Hash[:debug, false] }
30
+ it { should match(/^(\s*<script src="[^"]+"><\/script>\s*){1}$/) }
31
+ end
32
+ end
38
33
 
39
- context "when debug mode enabled" do
40
- let(:assets_config) { Hash[:debug, true] }
41
- it { should match(/^(\s*<link rel="stylesheet" [^>]+>\s*){3}$/) }
42
- end
34
+ describe "#render_stylesheet" do
35
+ subject { renderer.render_stylesheet }
43
36
 
44
- context "when debug mode disabled" do
45
- let(:assets_config) { Hash[:debug, false] }
46
- it { should match(/^(\s*<link rel="stylesheet" [^>]+>\s*){1}$/) }
47
- end
37
+ context "when debug mode enabled" do
38
+ let(:assets_config) { Hash[:debug, true] }
39
+ it { should match(/^(\s*<link rel="stylesheet" [^>]+>\s*){3}$/) }
48
40
  end
49
41
 
42
+ context "when debug mode disabled" do
43
+ let(:assets_config) { Hash[:debug, false] }
44
+ it { should match(/^(\s*<link rel="stylesheet" [^>]+>\s*){1}$/) }
45
+ end
50
46
  end
47
+
51
48
  end
@@ -1,105 +1,103 @@
1
1
  require "spec_helper"
2
2
 
3
- module Jekyll::AssetsPlugin
4
- describe Tag do
5
- let(:context) { { :registers => { :site => @site } } }
3
+ describe Jekyll::AssetsPlugin::Tag do
4
+ let(:context) { { :registers => { :site => @site } } }
6
5
 
7
- def render(content)
8
- Liquid::Template.parse(content).render({}, context)
6
+ def render(content)
7
+ ::Liquid::Template.parse(content).render({}, context)
8
+ end
9
+
10
+ context "{% image <file> %}" do
11
+ def tag_re(name)
12
+ file = "/assets/#{name}-[a-f0-9]{32}\.png"
13
+ Regexp.new "^#{Jekyll::AssetsPlugin::Renderer::IMAGE % file}$"
9
14
  end
10
15
 
11
- context "{% image <file> %}" do
12
- def tag_re(name)
13
- file = "/assets/#{name}-[a-f0-9]{32}\.png"
14
- Regexp.new "^#{Renderer::IMAGE % file}$"
15
- end
16
+ context "when <file> exists" do
17
+ subject { render("{% image noise.png %}") }
18
+ it { should match tag_re("noise") }
19
+ end
16
20
 
17
- context "when <file> exists" do
18
- subject { render("{% image noise.png %}") }
19
- it { should match tag_re("noise") }
20
- end
21
+ context "when <file> does not exists" do
22
+ subject { render("{% image not-found.png %}") }
23
+ it { should match "Liquid error: Couldn't find file 'not-found.png'" }
24
+ end
25
+ end
21
26
 
22
- context "when <file> does not exists" do
23
- subject { render("{% image not-found.png %}") }
24
- it { should match "Liquid error: Couldn't find file 'not-found.png'" }
25
- end
27
+ context "{% stylesheet <file> %}" do
28
+ def tag_re(name)
29
+ file = "/assets/#{name}-[a-f0-9]{32}\.css"
30
+ Regexp.new "^#{Jekyll::AssetsPlugin::Renderer::STYLESHEET % file}$"
26
31
  end
27
32
 
28
- context "{% stylesheet <file> %}" do
29
- def tag_re(name)
30
- file = "/assets/#{name}-[a-f0-9]{32}\.css"
31
- Regexp.new "^#{Renderer::STYLESHEET % file}$"
32
- end
33
+ context "when <file> exists" do
34
+ subject { render("{% stylesheet app.css %}") }
35
+ it { should match tag_re("app") }
36
+ end
33
37
 
34
- context "when <file> exists" do
35
- subject { render("{% stylesheet app.css %}") }
36
- it { should match tag_re("app") }
37
- end
38
+ context "when <file> extension is omited" do
39
+ subject { render("{% stylesheet app %}") }
40
+ it { should match tag_re("app") }
41
+ end
38
42
 
39
- context "when <file> extension is omited" do
40
- subject { render("{% stylesheet app %}") }
41
- it { should match tag_re("app") }
42
- end
43
+ context "when <file> does not exists" do
44
+ subject { render("{% stylesheet not-found.css %}") }
45
+ it { should match "Liquid error: Couldn't find file 'not-found.css'" }
46
+ end
47
+ end
43
48
 
44
- context "when <file> does not exists" do
45
- subject { render("{% stylesheet not-found.css %}") }
46
- it { should match "Liquid error: Couldn't find file 'not-found.css'" }
47
- end
49
+ context "{% javascript <file> %}" do
50
+ def tag_re(name)
51
+ file = "/assets/#{name}-[a-f0-9]{32}\.js"
52
+ Regexp.new "^#{Jekyll::AssetsPlugin::Renderer::JAVASCRIPT % file}$"
48
53
  end
49
54
 
50
- context "{% javascript <file> %}" do
51
- def tag_re(name)
52
- file = "/assets/#{name}-[a-f0-9]{32}\.js"
53
- Regexp.new "^#{Renderer::JAVASCRIPT % file}$"
54
- end
55
+ context "when <file> exists" do
56
+ subject { render("{% javascript app.js %}") }
57
+ it { should match tag_re("app") }
58
+ end
55
59
 
56
- context "when <file> exists" do
57
- subject { render("{% javascript app.js %}") }
58
- it { should match tag_re("app") }
59
- end
60
+ context "when <file> extension omited" do
61
+ subject { render("{% javascript app %}") }
62
+ it { should match tag_re("app") }
63
+ end
60
64
 
61
- context "when <file> extension omited" do
62
- subject { render("{% javascript app %}") }
63
- it { should match tag_re("app") }
64
- end
65
+ context "when <file> does not exists" do
66
+ subject { render("{% javascript not-found.js %}") }
67
+ it { should match "Liquid error: Couldn't find file 'not-found.js'" }
68
+ end
69
+ end
65
70
 
66
- context "when <file> does not exists" do
67
- subject { render("{% javascript not-found.js %}") }
68
- it { should match "Liquid error: Couldn't find file 'not-found.js'" }
69
- end
71
+ context "{% asset_path <file.ext> %}" do
72
+ context "when <file> exists" do
73
+ subject { render("{% asset_path app.css %}") }
74
+ it { should match(%r{^/assets/app-[a-f0-9]{32}\.css$}) }
70
75
  end
71
76
 
72
- context "{% asset_path <file.ext> %}" do
73
- context "when <file> exists" do
74
- subject { render("{% asset_path app.css %}") }
75
- it { should match(%r{^/assets/app-[a-f0-9]{32}\.css$}) }
76
- end
77
+ context "when <file> does not exists" do
78
+ subject { render("{% asset_path not-found.js %}") }
79
+ it { should match "Liquid error: Couldn't find file 'not-found.js'" }
80
+ end
77
81
 
78
- context "when <file> does not exists" do
79
- subject { render("{% asset_path not-found.js %}") }
80
- it { should match "Liquid error: Couldn't find file 'not-found.js'" }
82
+ context "with baseurl given as /foobar/" do
83
+ before do
84
+ context[:registers][:site].assets_config.baseurl = "/foobar/"
81
85
  end
82
86
 
83
- context "with baseurl given as /foobar/" do
84
- before do
85
- context[:registers][:site].assets_config.baseurl = "/foobar/"
86
- end
87
-
88
- subject { render("{% asset_path app.css %}") }
89
- it { should match(%r{^/foobar/app-[a-f0-9]{32}\.css$}) }
90
- end
87
+ subject { render("{% asset_path app.css %}") }
88
+ it { should match(%r{^/foobar/app-[a-f0-9]{32}\.css$}) }
91
89
  end
90
+ end
92
91
 
93
- context "{% asset <file.ext> %}" do
94
- context "when <file> exists" do
95
- subject { render("{% asset app.css %}") }
96
- it { should match(/body \{ background-image: url\(.+?\) \}/) }
97
- end
92
+ context "{% asset <file.ext> %}" do
93
+ context "when <file> exists" do
94
+ subject { render("{% asset app.css %}") }
95
+ it { should match(/body \{ background-image: url\(.+?\) \}/) }
96
+ end
98
97
 
99
- context "when <file> does not exists" do
100
- subject { render("{% asset_path not-found.js %}") }
101
- it { should match "Liquid error: Couldn't find file 'not-found.js'" }
102
- end
98
+ context "when <file> does not exists" do
99
+ subject { render("{% asset_path not-found.js %}") }
100
+ it { should match "Liquid error: Couldn't find file 'not-found.js'" }
103
101
  end
104
102
  end
105
103
  end
@@ -4,9 +4,9 @@ require "simplecov"
4
4
  require "coveralls"
5
5
 
6
6
  SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
7
- SimpleCov::Formatter::HTMLFormatter,
8
- Coveralls::SimpleCov::Formatter
7
+ SimpleCov::Formatter::HTMLFormatter, Coveralls::SimpleCov::Formatter
9
8
  ]
9
+
10
10
  SimpleCov.start
11
11
 
12
12
  require "jekyll"
@@ -19,10 +19,15 @@ Dir[File.expand_path("../support", __FILE__) + "/**/*.rb"]
19
19
  .each { |f| require f }
20
20
 
21
21
  RSpec.configure do |config|
22
- config.include Jekyll::AssetsPlugin::RSpecHelpers
22
+ config.include FixturesHelpers
23
+ config.extend FixturesHelpers
23
24
 
24
25
  config.before(:all) do
25
- Jekyll.logger.log_level = Jekyll::Stevenson::WARN
26
+ if Gem::Version.new("2") <= Gem::Version.new(Jekyll::VERSION)
27
+ Jekyll.logger.log_level = :warn
28
+ else
29
+ Jekyll.logger.log_level = Jekyll::Stevenson::WARN
30
+ end
26
31
 
27
32
  @dest = fixtures_path.join("_site")
28
33
  @site = Jekyll::Site.new(Jekyll.configuration({
@@ -0,0 +1,7 @@
1
+ require "pathname"
2
+
3
+ module FixturesHelpers
4
+ def fixtures_path
5
+ @fixtures_path ||= Pathname.new(__FILE__).parent.parent.join("fixtures")
6
+ end
7
+ end
metadata CHANGED
@@ -1,32 +1,42 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-assets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.7
4
+ version: 0.7.8
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Aleksey V Zapparov
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2014-03-12 00:00:00.000000000 Z
12
+ date: 2014-05-08 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: jekyll
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
- - - ~>
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: 1.0.0
22
+ - - <
18
23
  - !ruby/object:Gem::Version
19
- version: '1.0'
24
+ version: 3.0.0
20
25
  type: :runtime
21
26
  prerelease: false
22
27
  version_requirements: !ruby/object:Gem::Requirement
28
+ none: false
23
29
  requirements:
24
- - - ~>
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: 1.0.0
33
+ - - <
25
34
  - !ruby/object:Gem::Version
26
- version: '1.0'
35
+ version: 3.0.0
27
36
  - !ruby/object:Gem::Dependency
28
37
  name: sprockets
29
38
  requirement: !ruby/object:Gem::Requirement
39
+ none: false
30
40
  requirements:
31
41
  - - ~>
32
42
  - !ruby/object:Gem::Version
@@ -34,13 +44,31 @@ dependencies:
34
44
  type: :runtime
35
45
  prerelease: false
36
46
  version_requirements: !ruby/object:Gem::Requirement
47
+ none: false
37
48
  requirements:
38
49
  - - ~>
39
50
  - !ruby/object:Gem::Version
40
51
  version: '2.10'
52
+ - !ruby/object:Gem::Dependency
53
+ name: sass
54
+ requirement: !ruby/object:Gem::Requirement
55
+ none: false
56
+ requirements:
57
+ - - ! '>='
58
+ - !ruby/object:Gem::Version
59
+ version: '0'
60
+ type: :runtime
61
+ prerelease: false
62
+ version_requirements: !ruby/object:Gem::Requirement
63
+ none: false
64
+ requirements:
65
+ - - ! '>='
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
41
68
  - !ruby/object:Gem::Dependency
42
69
  name: bundler
43
70
  requirement: !ruby/object:Gem::Requirement
71
+ none: false
44
72
  requirements:
45
73
  - - ~>
46
74
  - !ruby/object:Gem::Version
@@ -48,6 +76,7 @@ dependencies:
48
76
  type: :development
49
77
  prerelease: false
50
78
  version_requirements: !ruby/object:Gem::Requirement
79
+ none: false
51
80
  requirements:
52
81
  - - ~>
53
82
  - !ruby/object:Gem::Version
@@ -55,105 +84,118 @@ dependencies:
55
84
  - !ruby/object:Gem::Dependency
56
85
  name: rake
57
86
  requirement: !ruby/object:Gem::Requirement
87
+ none: false
58
88
  requirements:
59
- - - '>='
89
+ - - ! '>='
60
90
  - !ruby/object:Gem::Version
61
91
  version: '0'
62
92
  type: :development
63
93
  prerelease: false
64
94
  version_requirements: !ruby/object:Gem::Requirement
95
+ none: false
65
96
  requirements:
66
- - - '>='
97
+ - - ! '>='
67
98
  - !ruby/object:Gem::Version
68
99
  version: '0'
69
100
  - !ruby/object:Gem::Dependency
70
101
  name: rspec
71
102
  requirement: !ruby/object:Gem::Requirement
103
+ none: false
72
104
  requirements:
73
- - - '>='
105
+ - - ! '>='
74
106
  - !ruby/object:Gem::Version
75
107
  version: '0'
76
108
  type: :development
77
109
  prerelease: false
78
110
  version_requirements: !ruby/object:Gem::Requirement
111
+ none: false
79
112
  requirements:
80
- - - '>='
113
+ - - ! '>='
81
114
  - !ruby/object:Gem::Version
82
115
  version: '0'
83
116
  - !ruby/object:Gem::Dependency
84
- name: guard-rspec
117
+ name: compass
85
118
  requirement: !ruby/object:Gem::Requirement
119
+ none: false
86
120
  requirements:
87
- - - '>='
121
+ - - ! '>='
88
122
  - !ruby/object:Gem::Version
89
123
  version: '0'
90
124
  type: :development
91
125
  prerelease: false
92
126
  version_requirements: !ruby/object:Gem::Requirement
127
+ none: false
93
128
  requirements:
94
- - - '>='
129
+ - - ! '>='
95
130
  - !ruby/object:Gem::Version
96
131
  version: '0'
97
132
  - !ruby/object:Gem::Dependency
98
- name: compass
133
+ name: bourbon
99
134
  requirement: !ruby/object:Gem::Requirement
135
+ none: false
100
136
  requirements:
101
- - - '>='
137
+ - - ! '>='
102
138
  - !ruby/object:Gem::Version
103
139
  version: '0'
104
140
  type: :development
105
141
  prerelease: false
106
142
  version_requirements: !ruby/object:Gem::Requirement
143
+ none: false
107
144
  requirements:
108
- - - '>='
145
+ - - ! '>='
109
146
  - !ruby/object:Gem::Version
110
147
  version: '0'
111
148
  - !ruby/object:Gem::Dependency
112
- name: bourbon
149
+ name: neat
113
150
  requirement: !ruby/object:Gem::Requirement
151
+ none: false
114
152
  requirements:
115
- - - '>='
153
+ - - ! '>='
116
154
  - !ruby/object:Gem::Version
117
155
  version: '0'
118
156
  type: :development
119
157
  prerelease: false
120
158
  version_requirements: !ruby/object:Gem::Requirement
159
+ none: false
121
160
  requirements:
122
- - - '>='
161
+ - - ! '>='
123
162
  - !ruby/object:Gem::Version
124
163
  version: '0'
125
164
  - !ruby/object:Gem::Dependency
126
- name: neat
165
+ name: bootstrap-sass
127
166
  requirement: !ruby/object:Gem::Requirement
167
+ none: false
128
168
  requirements:
129
- - - '>='
169
+ - - ! '>='
130
170
  - !ruby/object:Gem::Version
131
171
  version: '0'
132
172
  type: :development
133
173
  prerelease: false
134
174
  version_requirements: !ruby/object:Gem::Requirement
175
+ none: false
135
176
  requirements:
136
- - - '>='
177
+ - - ! '>='
137
178
  - !ruby/object:Gem::Version
138
179
  version: '0'
139
180
  - !ruby/object:Gem::Dependency
140
- name: bootstrap-sass
181
+ name: sass
141
182
  requirement: !ruby/object:Gem::Requirement
183
+ none: false
142
184
  requirements:
143
- - - '>='
185
+ - - ~>
144
186
  - !ruby/object:Gem::Version
145
- version: '0'
187
+ version: 3.2.13
146
188
  type: :development
147
189
  prerelease: false
148
190
  version_requirements: !ruby/object:Gem::Requirement
191
+ none: false
149
192
  requirements:
150
- - - '>='
193
+ - - ~>
151
194
  - !ruby/object:Gem::Version
152
- version: '0'
153
- description: |2
154
- Jekyll plugin, that allows you to write javascript/css assets in
155
- other languages such as CoffeeScript, Sass, Less and ERB, concatenate
156
- them, respecting dependencies, minify and many more.
195
+ version: 3.2.13
196
+ description: ! " Jekyll plugin, that allows you to write javascript/css assets in\n
197
+ \ other languages such as CoffeeScript, Sass, Less and ERB, concatenate\n them,
198
+ respecting dependencies, minify and many more.\n"
157
199
  email:
158
200
  - ixti@member.fsf.org
159
201
  executables: []
@@ -166,6 +208,7 @@ files:
166
208
  - .travis.yml
167
209
  - .yardopts
168
210
  - Gemfile
211
+ - Gemfile.jekyll-1.0
169
212
  - Guardfile
170
213
  - HISTORY.md
171
214
  - LICENSE
@@ -225,31 +268,38 @@ files:
225
268
  - spec/lib/jekyll/assets_plugin/renderer_spec.rb
226
269
  - spec/lib/jekyll/assets_plugin/tag_spec.rb
227
270
  - spec/spec_helper.rb
228
- - spec/support/fixtures_path.rb
271
+ - spec/support/fixtures_helpers.rb
229
272
  homepage: http://ixti.github.com/jekyll-assets
230
273
  licenses:
231
274
  - MIT
232
- metadata: {}
233
275
  post_install_message:
234
276
  rdoc_options: []
235
277
  require_paths:
236
278
  - lib
237
279
  required_ruby_version: !ruby/object:Gem::Requirement
280
+ none: false
238
281
  requirements:
239
- - - '>='
282
+ - - ! '>='
240
283
  - !ruby/object:Gem::Version
241
284
  version: '0'
285
+ segments:
286
+ - 0
287
+ hash: 644789647502337206
242
288
  required_rubygems_version: !ruby/object:Gem::Requirement
289
+ none: false
243
290
  requirements:
244
- - - '>='
291
+ - - ! '>='
245
292
  - !ruby/object:Gem::Version
246
293
  version: '0'
294
+ segments:
295
+ - 0
296
+ hash: 644789647502337206
247
297
  requirements: []
248
298
  rubyforge_project:
249
- rubygems_version: 2.0.3
299
+ rubygems_version: 1.8.23.2
250
300
  signing_key:
251
- specification_version: 4
252
- summary: jekyll-assets-0.7.7
301
+ specification_version: 3
302
+ summary: jekyll-assets-0.7.8
253
303
  test_files:
254
304
  - spec/fixtures/.gitignore
255
305
  - spec/fixtures/_assets/app.css.erb
@@ -284,4 +334,4 @@ test_files:
284
334
  - spec/lib/jekyll/assets_plugin/renderer_spec.rb
285
335
  - spec/lib/jekyll/assets_plugin/tag_spec.rb
286
336
  - spec/spec_helper.rb
287
- - spec/support/fixtures_path.rb
337
+ - spec/support/fixtures_helpers.rb