jekyll-minibundle 1.4.5 → 1.4.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -3
- data/lib/jekyll/minibundle/asset_bundle.rb +3 -12
- data/lib/jekyll/minibundle/compatibility.rb +27 -0
- data/lib/jekyll/minibundle/mini_bundle_block.rb +2 -2
- data/lib/jekyll/minibundle/version.rb +1 -1
- data/test/unit/asset_file_registry_test.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3033c98c36f602ceef9d58172d191d2a11508f79
|
4
|
+
data.tar.gz: b8c1a7471f47be584ecf61964f078225ed9e7ae4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65cacc8d91187ec779f4fd94a2bd11fe2c708d7526a353d2e12ad519307a9e041d6c6bb9670414cbf57a3ba451081e991b541e2457d9026a871ae70a7dad7784
|
7
|
+
data.tar.gz: 94e875d5205d0ba70ed44bb88dc93592766bb792361d8073d9604750b14fc6d00faf8fc78a1b80df823a63baeeb32c898c1fd49c41c01fd070f9e8e7b3466af8
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
# 1.4.6 / 2014-05-10
|
2
|
+
|
3
|
+
* Handle compatibility issues with safe_yaml and logger flexibly. This
|
4
|
+
should allow using the plugin with Jekyll 1.0 and 2.0.
|
5
|
+
|
1
6
|
# 1.4.5 / 2014-05-10
|
2
7
|
|
3
8
|
* Use SafeYAML to load user input from `minibundle` block for
|
@@ -45,14 +50,14 @@
|
|
45
50
|
* Fix bug causing exception to be thrown when `ministamp` or
|
46
51
|
`minibundle` is called twice with same asset source argument. Allow
|
47
52
|
handling asset source files that are already static files in Jekyll
|
48
|
-
(remove the restriction introduced in 1.3.0). (@agrigg)
|
53
|
+
(remove the restriction introduced in 1.3.0). (#2, @agrigg)
|
49
54
|
|
50
55
|
# 1.3.0 / 2013-12-25
|
51
56
|
|
52
57
|
* Disallow handling asset source files that are already static files
|
53
58
|
in Jekyll. Otherwise, we would potentially get to inconsistencies in
|
54
59
|
Jekyll's watch mode. See "Jekyll static file restriction" in
|
55
|
-
README.md. (@agrigg)
|
60
|
+
README.md. (#2, @agrigg)
|
56
61
|
* Upgrade development dependencies
|
57
62
|
|
58
63
|
# 1.2.0 / 2013-09-29
|
@@ -65,7 +70,7 @@
|
|
65
70
|
|
66
71
|
* `ministamp` tag omits fingerprint in development mode
|
67
72
|
* Clarify documentation
|
68
|
-
* Comply with (Gemnasium) conventions for changelogs (@tmatilai)
|
73
|
+
* Comply with (Gemnasium) conventions for changelogs (#1, @tmatilai)
|
69
74
|
* Bug fix: do not bundle assets when nonrelated files change
|
70
75
|
* Bug fix: do not bundle assets twice upon startup
|
71
76
|
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'tempfile'
|
2
2
|
require 'jekyll/minibundle/environment'
|
3
|
+
require 'jekyll/minibundle/compatibility'
|
3
4
|
|
4
5
|
module Jekyll::Minibundle
|
5
6
|
class AssetBundle
|
@@ -17,9 +18,9 @@ module Jekyll::Minibundle
|
|
17
18
|
cmd = get_minifier_cmd
|
18
19
|
exit_status = spawn_minifier(cmd) do |input|
|
19
20
|
$stdout.puts # place newline after "(Re)generating..." log messages
|
20
|
-
|
21
|
+
Compatibility.log_info("Bundling #{@type} assets:")
|
21
22
|
@asset_paths.each do |asset|
|
22
|
-
|
23
|
+
Compatibility.log_info(relative_path_from(asset, @site_dir))
|
23
24
|
IO.foreach(asset) { |line| input.write(line) }
|
24
25
|
input.puts(';') if @type == :js
|
25
26
|
end
|
@@ -30,16 +31,6 @@ module Jekyll::Minibundle
|
|
30
31
|
|
31
32
|
private
|
32
33
|
|
33
|
-
if defined? ::Jekyll.logger # introduced in Jekyll 1.0.0
|
34
|
-
def log(msg)
|
35
|
-
::Jekyll.logger.info('Minibundle:', msg)
|
36
|
-
end
|
37
|
-
else
|
38
|
-
def log(msg)
|
39
|
-
$stdout.puts(msg)
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
34
|
def relative_path_from(path, base)
|
44
35
|
path.sub(/\A#{base}\//, '')
|
45
36
|
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module Jekyll::Minibundle
|
2
|
+
module Compatibility
|
3
|
+
class << self
|
4
|
+
# SafeYAML.load is introduced in Jekyll 2.0.0
|
5
|
+
if defined?(::SafeYAML) && ::SafeYAML.respond_to?(:load)
|
6
|
+
def load_yaml(*args)
|
7
|
+
::SafeYAML.load(*args)
|
8
|
+
end
|
9
|
+
else
|
10
|
+
def load_yaml(*args)
|
11
|
+
::YAML.load(*args)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
# Jekyll.logger is introduced in Jekyll 1.0.3
|
16
|
+
if ::Jekyll.respond_to?(:logger)
|
17
|
+
def log_info(msg)
|
18
|
+
::Jekyll.logger.info('Minibundle:', msg)
|
19
|
+
end
|
20
|
+
else
|
21
|
+
def log_info(msg)
|
22
|
+
$stdout.puts(msg)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -1,5 +1,5 @@
|
|
1
|
-
require 'safe_yaml/load'
|
2
1
|
require 'jekyll/minibundle/asset_file_registry'
|
2
|
+
require 'jekyll/minibundle/compatibility'
|
3
3
|
|
4
4
|
module Jekyll::Minibundle
|
5
5
|
class MiniBundleBlock < Liquid::Block
|
@@ -10,7 +10,7 @@ module Jekyll::Minibundle
|
|
10
10
|
|
11
11
|
def render(context)
|
12
12
|
site = context.registers.fetch(:site)
|
13
|
-
config = get_current_config(
|
13
|
+
config = get_current_config(Compatibility.load_yaml(super), site)
|
14
14
|
file = AssetFileRegistry.bundle_file(site, config)
|
15
15
|
file.add_as_static_file_to(site)
|
16
16
|
file.destination_path_for_markup
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-minibundle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tuomas Kareinen
|
@@ -90,6 +90,7 @@ files:
|
|
90
90
|
- lib/jekyll/minibundle/asset_stamp.rb
|
91
91
|
- lib/jekyll/minibundle/asset_tag_markup.rb
|
92
92
|
- lib/jekyll/minibundle/bundle_file.rb
|
93
|
+
- lib/jekyll/minibundle/compatibility.rb
|
93
94
|
- lib/jekyll/minibundle/development_file.rb
|
94
95
|
- lib/jekyll/minibundle/development_file_collection.rb
|
95
96
|
- lib/jekyll/minibundle/environment.rb
|