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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c57552878f3ad0d964086ad33177b243dcf74586
4
- data.tar.gz: c784618a1d7e99af9e26a8f62b0ea507f013d6f3
3
+ metadata.gz: 3033c98c36f602ceef9d58172d191d2a11508f79
4
+ data.tar.gz: b8c1a7471f47be584ecf61964f078225ed9e7ae4
5
5
  SHA512:
6
- metadata.gz: bfa016f615363e82e82a300d5a1a441ceef2467f167fbeb284f1850b88497c3573ef4e11ef37a09a99e0d51a59e1b71780d2fb05928f495a25aaadd6a3d808c0
7
- data.tar.gz: 6d78b169081c7fa690d21efcda81dc5a7f3f60ae5aefa50d604d2623fc6d33959892c0a4770fc705516230c876bc17bbe4e0c57d5b0254959f0f74bc96082e46
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
- log("Bundling #{@type} assets:")
21
+ Compatibility.log_info("Bundling #{@type} assets:")
21
22
  @asset_paths.each do |asset|
22
- log(relative_path_from(asset, @site_dir))
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(SafeYAML.load(super), site)
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
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module Minibundle
3
- VERSION = '1.4.5'
3
+ VERSION = '1.4.6'
4
4
  end
5
5
  end
@@ -44,7 +44,7 @@ module Jekyll::Minibundle::Test
44
44
  end
45
45
 
46
46
  def site
47
- OpenStruct.new(:source => '.')
47
+ new_fake_site('.')
48
48
  end
49
49
  end
50
50
  end
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.5
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