jekyll-minibundle 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- YmU4ZTUwM2ZlNTlhNGI1OGFjMTg4OGRhNDEyNWYwOWUyYjI1OWUwMQ==
5
- data.tar.gz: !binary |-
6
- ZDdiN2RjN2JiMDY3Yjc4ODA4MTI2YTA5YWVlY2RkMzM3NGFhOTMzYg==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- MGFiYmJhNGY1MTRhOTRiYWYxM2FkOWQxYmE5YzU0ZGM5NjMwMTkxNDRlY2Q0
10
- MWQxZmIwZTY5NWY5YTg5ZGIzYjkyMjlkNzk4Yjg1NTNlN2QzMzA5ZjU3NDZl
11
- OTcwODM2ZjU3YjQ1NGFjNmRlYzcyNDU0NDg5Y2I4YTQ2YWZiYmE=
12
- data.tar.gz: !binary |-
13
- ZWZjNmNlZmMxZTQ3MmFkNGY0YzExYmY1NGFjM2VmZjVkMzFiZjQxMTY1ODNi
14
- OWVhODdjNTIzM2E5NjRkMDNjMDA4Njc1NjI4MmVjOTZjMjlkNjVlZWJhZWIx
15
- MWE3YzVmZThlMmQ0YzIxODgxZmFiZmQ2ODg4NzQ2M2Q0YmE4M2E=
2
+ SHA1:
3
+ metadata.gz: 356988a5df27a7a0f043977db61538733db30af1
4
+ data.tar.gz: 910c98db3db8895ec27d4ffecf6aceb0ebae79d3
5
+ SHA512:
6
+ metadata.gz: bc17940f1f3c8b1c52bd65d5fe6718bf11e7147b0442b2d6212248b8daa34fd220dbf16c7f753668a904f1937cb3358cadc8158b5702a845873445a024b9033c
7
+ data.tar.gz: 4229020fbfb1ad6c35db2d35d813d82ce3648597c9c015505c02ee9070b853232c3b11ac3685550075e7e6777376790ba2132282c010dbd05d4dbb3effc36920
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ # 1.2.0 / 2013-09-29
2
+
3
+ * If Jekyll's logger is available, use it for nice output when bundling
4
+ * Upgrade development dependencies
5
+ * Simplify `BundleFile` class implementation
6
+
1
7
  # 1.1.0 / 2013-02-27
2
8
 
3
9
  * `ministamp` tag omits fingerprint in development mode
data/README.md CHANGED
@@ -1,14 +1,13 @@
1
1
  # Jekyll Minibundle plugin
2
2
 
3
- A minimalistic plugin for bundling assets to
4
- [Jekyll](https://github.com/mojombo/jekyll)'s site generation
5
- directory.
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).
6
9
 
7
- In addition to the plugin itself, you need a minification tool
8
- supporting standard unix input and output. There are no gem
9
- dependencies at runtime.
10
-
11
- Tested with Ruby MRI 1.9.3. Ruby 1.8 is *not* supported.
10
+ Tested with Ruby MRI 1.9.3 and 2.0.0. Ruby 1.8 is *not* supported.
12
11
 
13
12
  [![Build Status](https://secure.travis-ci.org/tkareine/jekyll-minibundle.png)](http://travis-ci.org/tkareine/jekyll-minibundle)
14
13
 
@@ -25,7 +24,7 @@ a good and fast minifier. The plugin connects to the minifier with
25
24
  standard unix pipe, feeding asset file contents to it in desired order
26
25
  via standard input, and reads the result from standard output.
27
26
 
28
- Why is this good? Well, a fingerprint in asset's path is the
27
+ Why is this good? A fingerprint in asset's path is the
29
28
  [recommended way](https://developers.google.com/speed/docs/best-practices/caching)
30
29
  to handle caching of static resources, because you can allow caching
31
30
  the asset forever. Calculating MD5 digest over the contents of the
@@ -138,7 +137,7 @@ And then specify the command for launching bundling in
138
137
  ## Development mode
139
138
 
140
139
  The plugin has one more trick in its sleeves. If you set environment
141
- variable `JEKYLL_MINIBUNDLE_MODE` to `development`, then the plugin
140
+ variable `$JEKYLL_MINIBUNDLE_MODE` to `development`, then the plugin
142
141
  will copy asset files as is to the destination directory (using
143
142
  `destination_path` as directory for `minibundle` block), and omit
144
143
  fingerprinting. This is useful in development workflow, where you need
data/Rakefile CHANGED
@@ -35,11 +35,13 @@ end
35
35
 
36
36
  desc 'Run tests'
37
37
  task :test do
38
- tests = Dir['test/**/*_test.rb'].
38
+ glob = ENV['tests'] || 'test/{unit,integration}/*_test.rb'
39
+ files = Dir[glob].
39
40
  map { |file| %r{^test/(.+)\.rb$}.match(file)[1] }.
40
41
  shelljoin
41
- test_cmd = %{ruby -e 'ARGV.each { |f| require f }' #{tests}}
42
- sh(get_minibundle_env('RUBYLIB' => 'lib:test'), test_cmd)
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)
43
45
  end
44
46
 
45
47
  desc 'Generate fixture site for debugging'
@@ -10,9 +10,11 @@ Gem::Specification.new do |s|
10
10
  s.licenses = %w{MIT}
11
11
 
12
12
  s.description = <<-END
13
- A minimalistic asset bundling plugin for Jekyll, requiring only your
14
- bundling tool of choice (no other dependencies, not even other gems).
15
- Provides asset bundling and filename stamping with MD5 digest.
13
+ A straightforward asset bundling plugin for Jekyll, utilizing external
14
+ minification tool of your choice. Provides asset concatenation for
15
+ bundling and asset fingerprinting with MD5 digest for cache busting. No
16
+ other runtime dependencies besides the minification tool (not even
17
+ other gems).
16
18
  END
17
19
 
18
20
  s.files = %w{
@@ -59,10 +61,10 @@ Provides asset bundling and filename stamping with MD5 digest.
59
61
  test/unit/stamp_file_test.rb
60
62
  }
61
63
 
62
- s.add_development_dependency 'jekyll', '~> 0.12.0'
63
- s.add_development_dependency 'minitest', '~> 4.6.0'
64
- s.add_development_dependency 'nokogiri', '~> 1.5.6'
65
- s.add_development_dependency 'rake', '~> 10.0.2'
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'
66
68
 
67
69
  s.required_ruby_version = '>= 1.9.3'
68
70
 
@@ -15,9 +15,10 @@ module Jekyll::Minibundle
15
15
 
16
16
  def make_bundle
17
17
  pipe_bundling_to_temp_file bundling_cmd do |wr|
18
- puts "Bundling #{@type} assets:"
18
+ $stdout.puts # place newline after "(Re)generating..." log messages
19
+ log "Bundling #{@type} assets:"
19
20
  @assets.each do |asset|
20
- puts " #{asset}"
21
+ log asset
21
22
  IO.foreach(asset) { |line| wr.write line }
22
23
  wr.puts ';' if @type == :js
23
24
  end
@@ -27,6 +28,16 @@ module Jekyll::Minibundle
27
28
 
28
29
  private
29
30
 
31
+ if defined? ::Jekyll.logger # introduced in Jekyll 1.0.0
32
+ def log(msg)
33
+ ::Jekyll.logger.info 'Minibundle', msg
34
+ end
35
+ else
36
+ def log(msg)
37
+ $stdout.puts msg
38
+ end
39
+ end
40
+
30
41
  def bundling_cmd
31
42
  Environment.command_for @type
32
43
  end
@@ -9,7 +9,7 @@ module Jekyll::Minibundle
9
9
 
10
10
  def self.clear_cache
11
11
  @@mtimes = {}
12
- @@writes_after_mtime_updates = Hash.new false
12
+ @@writes_after_rebundling = Hash.new false
13
13
  @@asset_bundles = {}
14
14
  end
15
15
 
@@ -51,16 +51,12 @@ module Jekyll::Minibundle
51
51
  @@mtimes[asset_destination_canonical_path] != mtime
52
52
  end
53
53
 
54
- def destination_written_after_mtime_update?
55
- @@writes_after_mtime_updates[asset_destination_canonical_path]
56
- end
57
-
58
54
  def write(site_destination_dir)
59
- if File.exists?(destination(site_destination_dir)) && destination_written_after_mtime_update?
55
+ if File.exists?(destination(site_destination_dir)) && destination_written_after_rebundling?
60
56
  false
61
57
  else
62
58
  write_destination site_destination_dir
63
- @@writes_after_mtime_updates[asset_destination_canonical_path] = true
59
+ @@writes_after_rebundling[asset_destination_canonical_path] = true
64
60
  true
65
61
  end
66
62
  end
@@ -80,15 +76,15 @@ module Jekyll::Minibundle
80
76
  end
81
77
 
82
78
  def rebundle_assets
79
+ p = asset_destination_canonical_path
80
+ @@writes_after_rebundling[p] = false
81
+ @@mtimes[p] = mtime
83
82
  @asset_stamp = nil
84
83
  asset_bundle.make_bundle
85
- update_mtime
86
84
  end
87
85
 
88
- def update_mtime
89
- p = asset_destination_canonical_path
90
- @@mtimes[p] = mtime
91
- @@writes_after_mtime_updates[p] = false
86
+ def destination_written_after_rebundling?
87
+ @@writes_after_rebundling[asset_destination_canonical_path]
92
88
  end
93
89
  end
94
90
  end
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module Minibundle
3
- VERSION = '1.1.0'
3
+ VERSION = '1.2.0'
4
4
  end
5
5
  end
@@ -6,7 +6,7 @@ require 'jekyll'
6
6
  require 'jekyll/minibundle'
7
7
 
8
8
  module Jekyll::Minibundle::Test
9
- class TestCase < ::MiniTest::Unit::TestCase
9
+ class TestCase < ::Minitest::Test
10
10
  include ::Jekyll::Minibundle
11
11
 
12
12
  FIXTURE_DIR = File.expand_path(File.join(File.dirname(__FILE__), '../fixture'))
@@ -7,6 +7,8 @@ module Jekyll::Minibundle::Test
7
7
  include FixtureConfig
8
8
 
9
9
  def test_consistent_fingerprint_in_file_and_markup
10
+ BundleFile.clear_cache
11
+
10
12
  with_site do
11
13
  with_env 'JEKYLL_MINIBUNDLE_CMD_JS' => cmd_to_remove_comments_and_count do
12
14
  bundle_file = BundleFile.new({
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.1.0
4
+ version: 1.2.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-02-27 00:00:00.000000000 Z
11
+ date: 2013-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -16,63 +16,62 @@ dependencies:
16
16
  requirements:
17
17
  - - ~>
18
18
  - !ruby/object:Gem::Version
19
- version: 0.12.0
19
+ version: 1.2.1
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: 0.12.0
26
+ version: 1.2.1
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: 4.6.0
33
+ version: 5.0.8
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: 4.6.0
40
+ version: 5.0.8
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.5.6
47
+ version: 1.6.0
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.5.6
54
+ version: 1.6.0
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.0.2
61
+ version: 10.1.0
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.0.2
69
- description: ! 'A minimalistic asset bundling plugin for Jekyll, requiring only your
70
-
71
- bundling tool of choice (no other dependencies, not even other gems).
72
-
73
- Provides asset bundling and filename stamping with MD5 digest.
74
-
75
- '
68
+ version: 10.1.0
69
+ description: |
70
+ A straightforward asset bundling plugin for Jekyll, utilizing external
71
+ minification tool of your choice. Provides asset concatenation for
72
+ bundling and asset fingerprinting with MD5 digest for cache busting. No
73
+ other runtime dependencies besides the minification tool (not even
74
+ other gems).
76
75
  email: tkareine@gmail.com
77
76
  executables: []
78
77
  extensions: []
@@ -131,17 +130,17 @@ require_paths:
131
130
  - lib
132
131
  required_ruby_version: !ruby/object:Gem::Requirement
133
132
  requirements:
134
- - - ! '>='
133
+ - - '>='
135
134
  - !ruby/object:Gem::Version
136
135
  version: 1.9.3
137
136
  required_rubygems_version: !ruby/object:Gem::Requirement
138
137
  requirements:
139
- - - ! '>='
138
+ - - '>='
140
139
  - !ruby/object:Gem::Version
141
140
  version: '0'
142
141
  requirements: []
143
142
  rubyforge_project:
144
- rubygems_version: 2.0.0
143
+ rubygems_version: 2.1.5
145
144
  signing_key:
146
145
  specification_version: 4
147
146
  summary: A minimalistic asset bundling plugin for Jekyll
@@ -164,4 +163,3 @@ test_files:
164
163
  - test/unit/asset_tag_markup_test.rb
165
164
  - test/unit/bundle_file_test.rb
166
165
  - test/unit/stamp_file_test.rb
167
- has_rdoc: