jekyll-minibundle 1.2.0 → 1.3.0
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 +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +43 -11
- data/Rakefile +5 -3
- data/jekyll-minibundle.gemspec +4 -4
- data/lib/jekyll/minibundle/asset_file_operations.rb +7 -2
- data/lib/jekyll/minibundle/bundle_file.rb +5 -0
- data/lib/jekyll/minibundle/version.rb +1 -1
- metadata +11 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7676c0eba42d8141ef77c3fe778c401945f6bb74
|
4
|
+
data.tar.gz: a22db95aa1900aa83c1ef4f1b785bf10efde371a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 596712cfd61a61dd4f0524c809bfb3cf967fb5cbe451f59746f76e44efd3af907b8770db6928dda57c6c0c6e086f5ab2d1c20c4acd51ab3a392faa81b363b327
|
7
|
+
data.tar.gz: 5deded83c36f011098f81208fc548fbc3e8616581a208a0df4fe31695a5ca76eb0944efed20ed348ab57daccb29827f82a635c5e702684ef5ae19aa1e6977a90
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
# 1.3.0 / 2013-12-25
|
2
|
+
|
3
|
+
* Disallow handling asset source files that are already static files
|
4
|
+
in Jekyll (would potentially lead to inconsistencies in watch mode,
|
5
|
+
see "Jekyll static file restriction" in README.md)
|
6
|
+
* Upgrade development dependencies
|
7
|
+
|
1
8
|
# 1.2.0 / 2013-09-29
|
2
9
|
|
3
10
|
* If Jekyll's logger is available, use it for nice output when bundling
|
data/README.md
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
# Jekyll Minibundle plugin
|
2
2
|
|
3
3
|
A straightforward asset bundling plugin for
|
4
|
-
[Jekyll](
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
other gems).
|
4
|
+
[Jekyll](http://jekyllrb.com/), utilizing external minification tool
|
5
|
+
of your choice. Provides asset concatenation for bundling and asset
|
6
|
+
fingerprinting with MD5 digest for cache busting. No other runtime
|
7
|
+
dependencies besides the minification tool (not even other gems).
|
9
8
|
|
10
9
|
Tested with Ruby MRI 1.9.3 and 2.0.0. Ruby 1.8 is *not* supported.
|
11
10
|
|
11
|
+
The plugin works with Jekyll's watch (auto-regeneration) mode.
|
12
|
+
|
12
13
|
[](http://travis-ci.org/tkareine/jekyll-minibundle)
|
13
14
|
|
14
15
|
# Features
|
@@ -18,9 +19,9 @@ contents of the asset, and asset bundling combined with the first
|
|
18
19
|
feature.
|
19
20
|
|
20
21
|
Asset bundling consists of concatenation and minification. The plugin
|
21
|
-
implements concatenation and leaves
|
22
|
-
|
23
|
-
|
22
|
+
implements concatenation and leaves choosing the minification tool up
|
23
|
+
to you. [UglifyJS2](https://github.com/mishoo/UglifyJS2) is a good and
|
24
|
+
fast minifier, for example. The plugin connects to the minifier with
|
24
25
|
standard unix pipe, feeding asset file contents to it in desired order
|
25
26
|
via standard input, and reads the result from standard output.
|
26
27
|
|
@@ -55,8 +56,8 @@ require 'jekyll/minibundle'
|
|
55
56
|
## Asset fingerprinting
|
56
57
|
|
57
58
|
Asset fingerprinting is intended to be used together with
|
58
|
-
[Compass](http://compass-style.org/) and
|
59
|
-
|
59
|
+
[Compass](http://compass-style.org/) and similar asset generation
|
60
|
+
tools that have their own configuration for input sources.
|
60
61
|
|
61
62
|
Configure Compass to take inputs from `_assets/styles/*.scss` and to
|
62
63
|
put output to `_tmp/site.css`. Use `ministamp` tag to copy the
|
@@ -134,6 +135,37 @@ attributes:
|
|
134
135
|
And then specify the command for launching bundling in
|
135
136
|
`$JEKYLL_MINIBUNDLE_CMD_CSS` environment variable.
|
136
137
|
|
138
|
+
## Jekyll static file restriction
|
139
|
+
|
140
|
+
The plugin disallows using asset source files already known to Jekyll
|
141
|
+
as static files. This is because the plugin operates by adding asset
|
142
|
+
files as special static files to Jekyll, allowing the plugin work
|
143
|
+
nicely with Jekyll's watch (auto-regeneration) mode.
|
144
|
+
|
145
|
+
For example, the following snippet causes the plugin to throw an
|
146
|
+
exception if `assets/src.css` is not excluded from Jekyll:
|
147
|
+
|
148
|
+
``` html
|
149
|
+
<link href="{% ministamp assets/src.css assets/dest.css %}" rel="stylesheet" media="screen, projection">
|
150
|
+
```
|
151
|
+
|
152
|
+
If the restriction would not exist, there would be both `src.css` and
|
153
|
+
`dest-<md5-hash>.css` files in `_site/assets/` output directory, which
|
154
|
+
you probably wouldn't want to happen.
|
155
|
+
|
156
|
+
By default, Jekyll excludes directories beginning with underscore
|
157
|
+
character (`_`), so you might use the following directory layout for
|
158
|
+
assets:
|
159
|
+
|
160
|
+
* `_assets/` for JS and CSS assets handled by the plugin that are in
|
161
|
+
version control
|
162
|
+
* `_tmp/` for temporary JS and CSS assets handled by the plugin that
|
163
|
+
are not in version control (for example, Compass output files)
|
164
|
+
* `assets/` for images and other assets handled by Jekyll directly
|
165
|
+
|
166
|
+
See [Jekyll configuration](http://jekyllrb.com/docs/configuration/)
|
167
|
+
for more about excluding files and directories.
|
168
|
+
|
137
169
|
## Development mode
|
138
170
|
|
139
171
|
The plugin has one more trick in its sleeves. If you set environment
|
@@ -144,7 +176,7 @@ fingerprinting. This is useful in development workflow, where you need
|
|
144
176
|
the filenames and line numbers of the original asset sources.
|
145
177
|
|
146
178
|
``` bash
|
147
|
-
$ JEKYLL_MINIBUNDLE_MODE=development jekyll
|
179
|
+
$ JEKYLL_MINIBUNDLE_MODE=development jekyll serve --watch
|
148
180
|
```
|
149
181
|
|
150
182
|
# Example site
|
data/Rakefile
CHANGED
@@ -39,9 +39,11 @@ task :test do
|
|
39
39
|
files = Dir[glob].
|
40
40
|
map { |file| %r{^test/(.+)\.rb$}.match(file)[1] }.
|
41
41
|
shelljoin
|
42
|
-
opts = '-rpp -rpry'
|
43
|
-
|
44
|
-
|
42
|
+
opts = ENV['debug'] ? '-rpp -rpry' : ''
|
43
|
+
eval = %{-e 'ARGV.each { |f| require f }'}
|
44
|
+
cmd = "ruby #{opts} #{eval} #{files}"
|
45
|
+
env = get_minibundle_env 'RUBYLIB' => 'lib:test'
|
46
|
+
sh env, cmd
|
45
47
|
end
|
46
48
|
|
47
49
|
desc 'Generate fixture site for debugging'
|
data/jekyll-minibundle.gemspec
CHANGED
@@ -61,10 +61,10 @@ other gems).
|
|
61
61
|
test/unit/stamp_file_test.rb
|
62
62
|
}
|
63
63
|
|
64
|
-
s.add_development_dependency 'jekyll', '~> 1.2
|
65
|
-
s.add_development_dependency 'minitest', '~> 5.0
|
66
|
-
s.add_development_dependency 'nokogiri', '~> 1.6.
|
67
|
-
s.add_development_dependency 'rake', '~> 10.1.
|
64
|
+
s.add_development_dependency 'jekyll', '~> 1.4.2'
|
65
|
+
s.add_development_dependency 'minitest', '~> 5.2.0'
|
66
|
+
s.add_development_dependency 'nokogiri', '~> 1.6.1'
|
67
|
+
s.add_development_dependency 'rake', '~> 10.1.1'
|
68
68
|
|
69
69
|
s.required_ruby_version = '>= 1.9.3'
|
70
70
|
|
@@ -3,8 +3,13 @@ require 'fileutils'
|
|
3
3
|
module Jekyll::Minibundle
|
4
4
|
module AssetFileOperations
|
5
5
|
def static_file!(site)
|
6
|
-
|
7
|
-
site.static_files << self
|
6
|
+
check_no_existing_static_file site.static_files
|
7
|
+
site.static_files << self
|
8
|
+
end
|
9
|
+
|
10
|
+
def check_no_existing_static_file(static_files)
|
11
|
+
found = static_files.find { |f| f.path == path }
|
12
|
+
raise "Minibundle cannot handle static file already handled by Jekyll: #{path}" if found
|
8
13
|
end
|
9
14
|
|
10
15
|
def write_destination(site_destination_dir)
|
@@ -35,6 +35,11 @@ module Jekyll::Minibundle
|
|
35
35
|
asset_bundle.path
|
36
36
|
end
|
37
37
|
|
38
|
+
def check_no_existing_static_file(static_files)
|
39
|
+
existing = @assets & static_files.map(&:path)
|
40
|
+
raise "Minibundle cannot handle static file already handled by Jekyll: #{existing.first}" unless existing.empty?
|
41
|
+
end
|
42
|
+
|
38
43
|
def asset_destination_path
|
39
44
|
"#{@destination_path}-#{asset_stamp}.#{@type}"
|
40
45
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-minibundle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tuomas Kareinen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-12-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -16,56 +16,56 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.2
|
19
|
+
version: 1.4.2
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.2
|
26
|
+
version: 1.4.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: minitest
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 5.0
|
33
|
+
version: 5.2.0
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 5.0
|
40
|
+
version: 5.2.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: nokogiri
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.6.
|
47
|
+
version: 1.6.1
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.6.
|
54
|
+
version: 1.6.1
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 10.1.
|
61
|
+
version: 10.1.1
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - ~>
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 10.1.
|
68
|
+
version: 10.1.1
|
69
69
|
description: |
|
70
70
|
A straightforward asset bundling plugin for Jekyll, utilizing external
|
71
71
|
minification tool of your choice. Provides asset concatenation for
|
@@ -140,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
140
140
|
version: '0'
|
141
141
|
requirements: []
|
142
142
|
rubyforge_project:
|
143
|
-
rubygems_version: 2.1.
|
143
|
+
rubygems_version: 2.1.11
|
144
144
|
signing_key:
|
145
145
|
specification_version: 4
|
146
146
|
summary: A minimalistic asset bundling plugin for Jekyll
|