jekyll-minibundle 3.0.0 → 4.0.0

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.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +78 -66
  3. data/README.md +117 -101
  4. data/Rakefile +8 -26
  5. data/jekyll-minibundle.gemspec +5 -11
  6. data/lib/jekyll/minibundle/asset_bundle.rb +1 -1
  7. data/lib/jekyll/minibundle/asset_file_drop.rb +1 -3
  8. data/lib/jekyll/minibundle/asset_file_registry.rb +2 -2
  9. data/lib/jekyll/minibundle/asset_tag_markup.rb +1 -1
  10. data/lib/jekyll/minibundle/bundle_file.rb +3 -0
  11. data/lib/jekyll/minibundle/development_file.rb +2 -0
  12. data/lib/jekyll/minibundle/hashes.rb +1 -3
  13. data/lib/jekyll/minibundle/stamp_file.rb +3 -0
  14. data/lib/jekyll/minibundle/variable_template.rb +3 -1
  15. data/lib/jekyll/minibundle/variable_template_registry.rb +2 -2
  16. data/lib/jekyll/minibundle/version.rb +1 -1
  17. metadata +8 -184
  18. data/test/fixture/site/_assets/scripts/app.js +0 -5
  19. data/test/fixture/site/_assets/scripts/dependency.js +0 -4
  20. data/test/fixture/site/_assets/styles/common.css +0 -2
  21. data/test/fixture/site/_assets/styles/reset.css +0 -2
  22. data/test/fixture/site/_bin/remove_comments +0 -4
  23. data/test/fixture/site/_bin/with_count +0 -15
  24. data/test/fixture/site/_config.yml +0 -3
  25. data/test/fixture/site/_layouts/default.html +0 -29
  26. data/test/fixture/site/_tmp/site.css +0 -3
  27. data/test/fixture/site/about.html +0 -4
  28. data/test/fixture/site/assets/site.css +0 -2
  29. data/test/fixture/site/index.html +0 -4
  30. data/test/integration/minibundle_development_mode_test.rb +0 -554
  31. data/test/integration/minibundle_production_mode_test.rb +0 -900
  32. data/test/integration/ministamp_development_mode_test.rb +0 -235
  33. data/test/integration/ministamp_production_mode_test.rb +0 -342
  34. data/test/integration/static_files_as_asset_sources_test.rb +0 -75
  35. data/test/support/assertions.rb +0 -26
  36. data/test/support/fixture_config.rb +0 -20
  37. data/test/support/static_file_config.rb +0 -23
  38. data/test/support/test_case.rb +0 -175
  39. data/test/unit/asset_bundle_test.rb +0 -57
  40. data/test/unit/asset_file_drop_test.rb +0 -66
  41. data/test/unit/asset_file_registry_test.rb +0 -237
  42. data/test/unit/asset_tag_markup_test.rb +0 -46
  43. data/test/unit/bundle_file_properties_test.rb +0 -108
  44. data/test/unit/bundle_file_writing_test.rb +0 -155
  45. data/test/unit/development_file_properties_test.rb +0 -97
  46. data/test/unit/development_file_writing_test.rb +0 -50
  47. data/test/unit/environment_test.rb +0 -29
  48. data/test/unit/files_test.rb +0 -61
  49. data/test/unit/hashes_test.rb +0 -43
  50. data/test/unit/jekyll_static_file_api_test.rb +0 -172
  51. data/test/unit/mini_bundle_block_test.rb +0 -125
  52. data/test/unit/mini_stamp_tag_test.rb +0 -64
  53. data/test/unit/stamp_file_properties_test.rb +0 -98
  54. data/test/unit/stamp_file_writing_test.rb +0 -130
  55. data/test/unit/variable_template_test.rb +0 -121
@@ -82,6 +82,8 @@ module Jekyll::Minibundle
82
82
 
83
83
  # allows writing destination only after
84
84
  # `destination_path_for_markup` has been called
85
+ #
86
+ # rubocop:disable Naming/PredicateMethod
85
87
  def write(site_destination_dir)
86
88
  if modified?
87
89
  dst_path = destination(site_destination_dir)
@@ -96,6 +98,7 @@ module Jekyll::Minibundle
96
98
  false
97
99
  end
98
100
  end
101
+ # rubocop:enable Naming/PredicateMethod
99
102
 
100
103
  private
101
104
 
@@ -37,6 +37,7 @@ module Jekyll::Minibundle
37
37
  stamped_at != mtime
38
38
  end
39
39
 
40
+ # rubocop:disable Naming/PredicateMethod
40
41
  def write(site_destination_dir)
41
42
  if modified?
42
43
  @stamped_at = mtime
@@ -46,5 +47,6 @@ module Jekyll::Minibundle
46
47
  false
47
48
  end
48
49
  end
50
+ # rubocop:enable Naming/PredicateMethod
49
51
  end
50
52
  end
@@ -13,9 +13,7 @@ module Jekyll::Minibundle
13
13
  end
14
14
 
15
15
  def self.pick(hash, *keys)
16
- keys.each_with_object({}) do |key, acc|
17
- acc[key] = hash.fetch(key)
18
- end
16
+ keys.to_h { |key| [key, hash.fetch(key)] }
19
17
  end
20
18
  end
21
19
  end
@@ -59,6 +59,8 @@ module Jekyll::Minibundle
59
59
 
60
60
  # allows writing destination only after
61
61
  # `destination_path_for_markup` has been called
62
+ #
63
+ # rubocop:disable Naming/PredicateMethod
62
64
  def write(site_destination_dir)
63
65
  if modified?
64
66
  Files.copy_p(path, destination(site_destination_dir))
@@ -68,6 +70,7 @@ module Jekyll::Minibundle
68
70
  false
69
71
  end
70
72
  end
73
+ # rubocop:enable Naming/PredicateMethod
71
74
 
72
75
  private
73
76
 
@@ -9,7 +9,9 @@ module Jekyll::Minibundle
9
9
  ESCAPE_CHAR = '\\'
10
10
 
11
11
  def initialize(interpolation)
12
+ # rubocop:disable Style/DocumentDynamicEvalDefinition
12
13
  instance_eval("def render(variables) #{interpolation} end", __FILE__, __LINE__)
14
+ # rubocop:enable Style/DocumentDynamicEvalDefinition
13
15
  end
14
16
 
15
17
  def self.compile(template)
@@ -28,7 +30,7 @@ module Jekyll::Minibundle
28
30
 
29
31
  def to_s
30
32
  template_before_pos = @template[0, @position]
31
- template_after_pos = @template[@position..-1]
33
+ template_after_pos = @template[@position..]
32
34
 
33
35
  <<~MESSAGE
34
36
  #{@message} at position #{@position} in template (position highlighted with "#{CURSOR}"):
@@ -16,6 +16,6 @@ module Jekyll::Minibundle
16
16
  end
17
17
  end
18
18
 
19
- ::Jekyll::Hooks.register(:site, :post_write) do
20
- ::Jekyll::Minibundle::VariableTemplateRegistry.clear
19
+ Jekyll::Hooks.register(:site, :post_write) do
20
+ Jekyll::Minibundle::VariableTemplateRegistry.clear
21
21
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  module Minibundle
5
- VERSION = '3.0.0'
5
+ VERSION = '4.0.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,113 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-minibundle
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tuomas Kareinen
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2020-09-06 00:00:00.000000000 Z
12
- dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: benchmark-ips
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '2.7'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '2.7'
27
- - !ruby/object:Gem::Dependency
28
- name: jekyll
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '3.0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '3.0'
41
- - !ruby/object:Gem::Dependency
42
- name: minitest
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '5.8'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '5.8'
55
- - !ruby/object:Gem::Dependency
56
- name: nokogiri
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '1.6'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: '1.6'
69
- - !ruby/object:Gem::Dependency
70
- name: pry
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: '0.10'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: '0.10'
83
- - !ruby/object:Gem::Dependency
84
- name: rake
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: '13.0'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - "~>"
95
- - !ruby/object:Gem::Version
96
- version: '13.0'
97
- - !ruby/object:Gem::Dependency
98
- name: rubocop
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - "~>"
102
- - !ruby/object:Gem::Version
103
- version: 0.90.0
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - "~>"
109
- - !ruby/object:Gem::Version
110
- version: 0.90.0
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies: []
111
12
  description: |
112
13
  A straightforward asset bundling plugin for Jekyll, utilizing external
113
14
  minification tool of your choice. It provides asset concatenation for
@@ -145,49 +46,11 @@ files:
145
46
  - lib/jekyll/minibundle/variable_template.rb
146
47
  - lib/jekyll/minibundle/variable_template_registry.rb
147
48
  - lib/jekyll/minibundle/version.rb
148
- - test/fixture/site/_assets/scripts/app.js
149
- - test/fixture/site/_assets/scripts/dependency.js
150
- - test/fixture/site/_assets/styles/common.css
151
- - test/fixture/site/_assets/styles/reset.css
152
- - test/fixture/site/_bin/remove_comments
153
- - test/fixture/site/_bin/with_count
154
- - test/fixture/site/_config.yml
155
- - test/fixture/site/_layouts/default.html
156
- - test/fixture/site/_tmp/site.css
157
- - test/fixture/site/about.html
158
- - test/fixture/site/assets/site.css
159
- - test/fixture/site/index.html
160
- - test/integration/minibundle_development_mode_test.rb
161
- - test/integration/minibundle_production_mode_test.rb
162
- - test/integration/ministamp_development_mode_test.rb
163
- - test/integration/ministamp_production_mode_test.rb
164
- - test/integration/static_files_as_asset_sources_test.rb
165
- - test/support/assertions.rb
166
- - test/support/fixture_config.rb
167
- - test/support/static_file_config.rb
168
- - test/support/test_case.rb
169
- - test/unit/asset_bundle_test.rb
170
- - test/unit/asset_file_drop_test.rb
171
- - test/unit/asset_file_registry_test.rb
172
- - test/unit/asset_tag_markup_test.rb
173
- - test/unit/bundle_file_properties_test.rb
174
- - test/unit/bundle_file_writing_test.rb
175
- - test/unit/development_file_properties_test.rb
176
- - test/unit/development_file_writing_test.rb
177
- - test/unit/environment_test.rb
178
- - test/unit/files_test.rb
179
- - test/unit/hashes_test.rb
180
- - test/unit/jekyll_static_file_api_test.rb
181
- - test/unit/mini_bundle_block_test.rb
182
- - test/unit/mini_stamp_tag_test.rb
183
- - test/unit/stamp_file_properties_test.rb
184
- - test/unit/stamp_file_writing_test.rb
185
- - test/unit/variable_template_test.rb
186
49
  homepage: https://github.com/tkareine/jekyll-minibundle
187
50
  licenses:
188
51
  - MIT
189
- metadata: {}
190
- post_install_message:
52
+ metadata:
53
+ rubygems_mfa_required: 'true'
191
54
  rdoc_options:
192
55
  - "--line-numbers"
193
56
  - "--title"
@@ -200,53 +63,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
200
63
  requirements:
201
64
  - - ">="
202
65
  - !ruby/object:Gem::Version
203
- version: 2.4.0
66
+ version: 2.7.0
204
67
  required_rubygems_version: !ruby/object:Gem::Requirement
205
68
  requirements:
206
69
  - - ">="
207
70
  - !ruby/object:Gem::Version
208
71
  version: '0'
209
72
  requirements: []
210
- rubygems_version: 3.1.4
211
- signing_key:
73
+ rubygems_version: 4.0.16
212
74
  specification_version: 4
213
75
  summary: A minimalistic asset bundling plugin for Jekyll
214
- test_files:
215
- - test/fixture/site/_assets/scripts/app.js
216
- - test/fixture/site/_assets/scripts/dependency.js
217
- - test/fixture/site/_assets/styles/common.css
218
- - test/fixture/site/_assets/styles/reset.css
219
- - test/fixture/site/_bin/remove_comments
220
- - test/fixture/site/_bin/with_count
221
- - test/fixture/site/_config.yml
222
- - test/fixture/site/_layouts/default.html
223
- - test/fixture/site/_tmp/site.css
224
- - test/fixture/site/about.html
225
- - test/fixture/site/assets/site.css
226
- - test/fixture/site/index.html
227
- - test/integration/minibundle_development_mode_test.rb
228
- - test/integration/minibundle_production_mode_test.rb
229
- - test/integration/ministamp_development_mode_test.rb
230
- - test/integration/ministamp_production_mode_test.rb
231
- - test/integration/static_files_as_asset_sources_test.rb
232
- - test/support/assertions.rb
233
- - test/support/fixture_config.rb
234
- - test/support/static_file_config.rb
235
- - test/support/test_case.rb
236
- - test/unit/asset_bundle_test.rb
237
- - test/unit/asset_file_drop_test.rb
238
- - test/unit/asset_file_registry_test.rb
239
- - test/unit/asset_tag_markup_test.rb
240
- - test/unit/bundle_file_properties_test.rb
241
- - test/unit/bundle_file_writing_test.rb
242
- - test/unit/development_file_properties_test.rb
243
- - test/unit/development_file_writing_test.rb
244
- - test/unit/environment_test.rb
245
- - test/unit/files_test.rb
246
- - test/unit/hashes_test.rb
247
- - test/unit/jekyll_static_file_api_test.rb
248
- - test/unit/mini_bundle_block_test.rb
249
- - test/unit/mini_stamp_tag_test.rb
250
- - test/unit/stamp_file_properties_test.rb
251
- - test/unit/stamp_file_writing_test.rb
252
- - test/unit/variable_template_test.rb
76
+ test_files: []
@@ -1,5 +0,0 @@
1
- /* asset file, handled by Minibundle */
2
- (function(root, dependency) {
3
- if (!dependency) throw new Error("missing dependency");
4
- root.app = {};
5
- })(window, window.dependency)
@@ -1,4 +0,0 @@
1
- /* asset file, handled by Minibundle */
2
- (function(root) {
3
- root.dependency = {};
4
- })(window)
@@ -1,2 +0,0 @@
1
- /* asset file, handled by Minibundle */
2
- p { margin: 0; }
@@ -1,2 +0,0 @@
1
- /* asset file, handled by Minibundle */
2
- html { margin: 0; }
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env sh
2
-
3
- grep -v '/\*'
4
- exit 0
@@ -1,15 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- filename = ARGV.first
5
-
6
- count =
7
- if File.file?(filename)
8
- File.read(filename).strip.to_i
9
- else
10
- 0
11
- end
12
-
13
- File.write(filename, "#{count + 1}\n")
14
-
15
- exec(*ARGV[1..-1])
@@ -1,3 +0,0 @@
1
- plugins:
2
- - jekyll/minibundle
3
- safe: false
@@ -1,29 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>{{ page.title }}</title>
5
- <link rel="stylesheet" href="{% ministamp _tmp/site.css assets/screen.css %}" media="screen">
6
- {% minibundle css %}
7
- source_dir: _assets/styles
8
- destination_path: assets/site
9
- assets:
10
- - reset
11
- - common
12
- attributes:
13
- id: my-styles
14
- media: projection
15
- {% endminibundle %}
16
- </head>
17
- <body>
18
- {% minibundle js %}
19
- source_dir: _assets/scripts
20
- destination_path: assets/site
21
- assets:
22
- - dependency
23
- - app
24
- attributes:
25
- id: my-scripts
26
- async:
27
- {% endminibundle %}
28
- </body>
29
- </html>
@@ -1,3 +0,0 @@
1
- /* asset file, handled by Minibundle */
2
- html { margin: 0; }
3
- p { margin: 2px; }
@@ -1,4 +0,0 @@
1
- ---
2
- layout: default
3
- title: About
4
- ---
@@ -1,2 +0,0 @@
1
- /* static file, handled by Jekyll */
2
- html { margin: 0; }
@@ -1,4 +0,0 @@
1
- ---
2
- layout: default
3
- title: Index
4
- ---