jekyll-minibundle 1.4.2 → 1.4.3
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 +9 -0
- data/README.md +35 -25
- data/Rakefile +6 -6
- data/jekyll-minibundle.gemspec +11 -11
- data/lib/jekyll/minibundle/asset_bundle.rb +19 -16
- data/lib/jekyll/minibundle/asset_file_operations.rb +3 -3
- data/lib/jekyll/minibundle/asset_file_paths.rb +2 -6
- data/lib/jekyll/minibundle/asset_file_registry.rb +28 -30
- data/lib/jekyll/minibundle/asset_stamp.rb +1 -1
- data/lib/jekyll/minibundle/asset_tag_markup.rb +16 -14
- data/lib/jekyll/minibundle/bundle_file.rb +10 -9
- data/lib/jekyll/minibundle/development_file.rb +6 -6
- data/lib/jekyll/minibundle/development_file_collection.rb +6 -6
- data/lib/jekyll/minibundle/environment.rb +10 -8
- data/lib/jekyll/minibundle/mini_bundle_block.rb +4 -4
- data/lib/jekyll/minibundle/mini_stamp_tag.rb +2 -2
- data/lib/jekyll/minibundle/stamp_file.rb +8 -7
- data/lib/jekyll/minibundle/version.rb +1 -1
- data/test/fixture/site/_bin/with_count +1 -1
- data/test/integration/minibundle_development_mode_test.rb +62 -40
- data/test/integration/minibundle_production_mode_test.rb +78 -70
- data/test/integration/ministamp_test.rb +23 -23
- data/test/integration/static_files_as_asset_sources_test.rb +11 -11
- data/test/support/fixture_config.rb +4 -4
- data/test/support/test_case.rb +18 -14
- data/test/unit/asset_bundle_test.rb +4 -4
- data/test/unit/asset_file_registry_test.rb +7 -7
- data/test/unit/asset_tag_markup_test.rb +1 -1
- data/test/unit/bundle_file_test.rb +43 -33
- data/test/unit/development_file_collection_test.rb +44 -0
- data/test/unit/stamp_file_test.rb +30 -18
- metadata +26 -24
@@ -0,0 +1,44 @@
|
|
1
|
+
require 'support/test_case'
|
2
|
+
require 'support/fixture_config'
|
3
|
+
require 'jekyll/minibundle/development_file'
|
4
|
+
|
5
|
+
module Jekyll::Minibundle::Test
|
6
|
+
class DevelopmentFileCollectionTest < TestCase
|
7
|
+
include FixtureConfig
|
8
|
+
|
9
|
+
def test_calling_write_before_markup_writes_destination
|
10
|
+
with_site do
|
11
|
+
dev_files = DevelopmentFileCollection.new(bundle_config)
|
12
|
+
|
13
|
+
assert first_file_of(dev_files).write('_site')
|
14
|
+
|
15
|
+
destination_file = destination_path(JS_BUNDLE_DESTINATION_PATH, 'dependency.js')
|
16
|
+
|
17
|
+
assert File.exists?(destination_file)
|
18
|
+
|
19
|
+
org_mtime = mtime_of(destination_file)
|
20
|
+
dev_files.markup
|
21
|
+
|
22
|
+
refute first_file_of(dev_files).write('_site')
|
23
|
+
assert_equal org_mtime, mtime_of(destination_file)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
def bundle_config
|
30
|
+
{
|
31
|
+
'type' => :js,
|
32
|
+
'site_dir' => '.',
|
33
|
+
'source_dir' => JS_BUNDLE_SOURCE_DIR,
|
34
|
+
'assets' => %w{dependency app},
|
35
|
+
'destination_path' => JS_BUNDLE_DESTINATION_PATH,
|
36
|
+
'attributes' => {}
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
40
|
+
def first_file_of(dev_files)
|
41
|
+
dev_files.instance_variable_get(:@files).first
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -9,27 +9,27 @@ module Jekyll::Minibundle::Test
|
|
9
9
|
def test_calling_markup_determines_fingerprint_and_destination_write
|
10
10
|
with_site do
|
11
11
|
stamp_file = StampFile.new(STAMP_SOURCE_PATH, STAMP_DESTINATION_PATH, &stamp_basenamer)
|
12
|
-
|
13
|
-
|
14
|
-
old_destination = destination_path STAMP_DESTINATION_FINGERPRINT_PATH
|
15
|
-
|
12
|
+
source = source_path(STAMP_SOURCE_PATH)
|
13
|
+
old_destination = destination_path(STAMP_DESTINATION_FINGERPRINT_PATH)
|
16
14
|
org_markup = stamp_file.markup
|
17
|
-
stamp_file.write '_site'
|
18
|
-
org_mtime = mtime_of old_destination
|
19
15
|
|
16
|
+
assert stamp_file.write('_site')
|
17
|
+
|
18
|
+
org_mtime = mtime_of(old_destination)
|
20
19
|
last_markup = stamp_file.markup
|
21
|
-
ensure_file_mtime_changes { File.write
|
22
|
-
stamp_file.write '_site'
|
20
|
+
ensure_file_mtime_changes { File.write(source, 'h1 {}') }
|
23
21
|
|
24
22
|
# preserve fingerprint and content seen in last markup phase
|
23
|
+
refute stamp_file.write('_site')
|
25
24
|
assert_equal org_markup, last_markup
|
26
25
|
assert_equal org_mtime, mtime_of(old_destination)
|
27
26
|
assert_equal File.read(site_fixture_path(STAMP_SOURCE_PATH)), File.read(old_destination)
|
28
27
|
|
29
28
|
last_markup = stamp_file.markup
|
30
|
-
stamp_file.write '_site'
|
31
29
|
|
32
|
-
|
30
|
+
assert stamp_file.write('_site')
|
31
|
+
|
32
|
+
new_destination = destination_path('assets/screen-0f5dbd1e527a2bee267e85007b08d2a5.css')
|
33
33
|
|
34
34
|
# see updated fingerprint in the next round
|
35
35
|
refute_equal org_markup, last_markup
|
@@ -41,27 +41,39 @@ module Jekyll::Minibundle::Test
|
|
41
41
|
def test_many_consecutive_markup_calls_trigger_one_destination_write
|
42
42
|
with_site do
|
43
43
|
stamp_file = StampFile.new(STAMP_SOURCE_PATH, STAMP_DESTINATION_PATH, &stamp_basenamer)
|
44
|
-
|
45
|
-
|
46
|
-
destination = destination_path STAMP_DESTINATION_FINGERPRINT_PATH
|
47
|
-
|
44
|
+
source = source_path(STAMP_SOURCE_PATH)
|
45
|
+
destination = destination_path(STAMP_DESTINATION_FINGERPRINT_PATH)
|
48
46
|
org_markup = stamp_file.markup
|
49
47
|
stamp_file.markup
|
50
|
-
stamp_file.write '_site'
|
51
|
-
org_mtime = mtime_of destination
|
52
48
|
|
53
|
-
|
49
|
+
assert stamp_file.write('_site')
|
54
50
|
|
51
|
+
org_mtime = mtime_of(destination)
|
52
|
+
ensure_file_mtime_changes { FileUtils.touch(source) }
|
55
53
|
last_markup = stamp_file.markup
|
56
54
|
stamp_file.markup
|
57
|
-
stamp_file.write '_site'
|
58
55
|
|
56
|
+
assert stamp_file.write('_site')
|
59
57
|
assert_equal org_markup, last_markup
|
60
58
|
assert_operator mtime_of(destination), :>, org_mtime
|
61
59
|
assert_equal File.read(source), File.read(destination)
|
62
60
|
end
|
63
61
|
end
|
64
62
|
|
63
|
+
def test_calling_write_before_markup_has_no_effect
|
64
|
+
with_site do
|
65
|
+
stamp_file = StampFile.new(STAMP_SOURCE_PATH, STAMP_DESTINATION_PATH, &stamp_basenamer)
|
66
|
+
|
67
|
+
refute stamp_file.write('_site')
|
68
|
+
assert_empty Dir[destination_path('assets/*.css')]
|
69
|
+
|
70
|
+
stamp_file.markup
|
71
|
+
|
72
|
+
assert stamp_file.write('_site')
|
73
|
+
assert File.exists?(destination_path(STAMP_DESTINATION_FINGERPRINT_PATH))
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
65
77
|
private
|
66
78
|
|
67
79
|
def stamp_basenamer
|
metadata
CHANGED
@@ -1,71 +1,71 @@
|
|
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.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tuomas Kareinen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.4
|
19
|
+
version: '1.4'
|
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.4
|
26
|
+
version: '1.4'
|
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.2
|
33
|
+
version: '5.2'
|
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.2
|
40
|
+
version: '5.2'
|
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'
|
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'
|
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'
|
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'
|
69
69
|
description: |
|
70
70
|
A straightforward asset bundling plugin for Jekyll, utilizing external
|
71
71
|
minification tool of your choice. It provides asset concatenation for
|
@@ -120,6 +120,7 @@ files:
|
|
120
120
|
- test/unit/asset_file_registry_test.rb
|
121
121
|
- test/unit/asset_tag_markup_test.rb
|
122
122
|
- test/unit/bundle_file_test.rb
|
123
|
+
- test/unit/development_file_collection_test.rb
|
123
124
|
- test/unit/stamp_file_test.rb
|
124
125
|
homepage: https://github.com/tkareine/jekyll-minibundle
|
125
126
|
licenses:
|
@@ -127,26 +128,26 @@ licenses:
|
|
127
128
|
metadata: {}
|
128
129
|
post_install_message:
|
129
130
|
rdoc_options:
|
130
|
-
- --line-numbers
|
131
|
-
- --title
|
131
|
+
- "--line-numbers"
|
132
|
+
- "--title"
|
132
133
|
- jekyll-minibundle
|
133
|
-
- --exclude
|
134
|
+
- "--exclude"
|
134
135
|
- test
|
135
136
|
require_paths:
|
136
137
|
- lib
|
137
138
|
required_ruby_version: !ruby/object:Gem::Requirement
|
138
139
|
requirements:
|
139
|
-
- -
|
140
|
+
- - ">="
|
140
141
|
- !ruby/object:Gem::Version
|
141
142
|
version: 1.9.3
|
142
143
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
143
144
|
requirements:
|
144
|
-
- -
|
145
|
+
- - ">="
|
145
146
|
- !ruby/object:Gem::Version
|
146
147
|
version: '0'
|
147
148
|
requirements: []
|
148
149
|
rubyforge_project:
|
149
|
-
rubygems_version: 2.1
|
150
|
+
rubygems_version: 2.2.1
|
150
151
|
signing_key:
|
151
152
|
specification_version: 4
|
152
153
|
summary: A minimalistic asset bundling plugin for Jekyll
|
@@ -174,4 +175,5 @@ test_files:
|
|
174
175
|
- test/unit/asset_file_registry_test.rb
|
175
176
|
- test/unit/asset_tag_markup_test.rb
|
176
177
|
- test/unit/bundle_file_test.rb
|
178
|
+
- test/unit/development_file_collection_test.rb
|
177
179
|
- test/unit/stamp_file_test.rb
|