jekyll-minibundle 1.2.0 → 1.3.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: 356988a5df27a7a0f043977db61538733db30af1
4
- data.tar.gz: 910c98db3db8895ec27d4ffecf6aceb0ebae79d3
3
+ metadata.gz: 7676c0eba42d8141ef77c3fe778c401945f6bb74
4
+ data.tar.gz: a22db95aa1900aa83c1ef4f1b785bf10efde371a
5
5
  SHA512:
6
- metadata.gz: bc17940f1f3c8b1c52bd65d5fe6718bf11e7147b0442b2d6212248b8daa34fd220dbf16c7f753668a904f1937cb3358cadc8158b5702a845873445a024b9033c
7
- data.tar.gz: 4229020fbfb1ad6c35db2d35d813d82ce3648597c9c015505c02ee9070b853232c3b11ac3685550075e7e6777376790ba2132282c010dbd05d4dbb3effc36920
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](https://github.com/mojombo/jekyll), utilizing external
5
- minification tool of your choice. Provides asset concatenation for
6
- bundling and asset fingerprinting with MD5 digest for cache busting.
7
- No other runtime dependencies besides the minification tool (not even
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
  [![Build Status](https://secure.travis-ci.org/tkareine/jekyll-minibundle.png)](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 up to you to choose the
22
- minification tool. [UglifyJS2](https://github.com/mishoo/UglifyJS2) is
23
- a good and fast minifier. The plugin connects to the minifier with
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 other similar asset
59
- generation tools that have their own configuration for input sources.
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 --auto --server
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' if ENV['debug']
43
- cmd = %{ruby #{opts} -e 'ARGV.each { |f| require f }' #{files}}
44
- sh(get_minibundle_env('RUBYLIB' => 'lib:test'), cmd)
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'
@@ -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.1'
65
- s.add_development_dependency 'minitest', '~> 5.0.8'
66
- s.add_development_dependency 'nokogiri', '~> 1.6.0'
67
- s.add_development_dependency 'rake', '~> 10.1.0'
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
- static_file_exists = site.static_files.find { |f| f.path == path }
7
- site.static_files << self unless static_file_exists
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
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module Minibundle
3
- VERSION = '1.2.0'
3
+ VERSION = '1.3.0'
4
4
  end
5
5
  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.2.0
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-09-29 00:00:00.000000000 Z
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.1
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.1
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.8
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.8
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.0
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.0
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.0
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.0
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.5
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