jekyll-assets 2.1.3 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +6 -2
  3. data/LICENSE +2 -2
  4. data/README.md +38 -31
  5. data/Rakefile +1 -40
  6. data/lib/jekyll-assets.rb +3 -1
  7. data/lib/jekyll/assets.rb +18 -16
  8. data/lib/jekyll/assets/addons.rb +3 -9
  9. data/lib/jekyll/assets/addons/autoprefixer.rb +6 -2
  10. data/lib/jekyll/assets/addons/bootstrap.rb +3 -1
  11. data/lib/jekyll/assets/addons/fontawesome.rb +7 -0
  12. data/lib/jekyll/assets/addons/{js_es6.rb → javascript.rb} +3 -1
  13. data/lib/jekyll/assets/addons/less.rb +9 -0
  14. data/lib/jekyll/assets/cached.rb +13 -2
  15. data/lib/jekyll/assets/config.rb +24 -14
  16. data/lib/jekyll/assets/env.rb +92 -40
  17. data/lib/jekyll/assets/hook.rb +14 -4
  18. data/lib/jekyll/assets/hooks.rb +5 -5
  19. data/lib/jekyll/assets/hooks/cache.rb +11 -3
  20. data/lib/jekyll/assets/hooks/compression.rb +12 -2
  21. data/lib/jekyll/assets/hooks/{configuration.rb → config.rb} +3 -1
  22. data/lib/jekyll/assets/hooks/erb.rb +15 -0
  23. data/lib/jekyll/assets/hooks/helpers.rb +4 -3
  24. data/lib/jekyll/assets/hooks/jekyll/drops.rb +3 -1
  25. data/lib/jekyll/assets/hooks/jekyll/setup.rb +6 -8
  26. data/lib/jekyll/assets/hooks/jekyll/write.rb +6 -2
  27. data/lib/jekyll/assets/hooks/logger.rb +6 -2
  28. data/lib/jekyll/assets/hooks/sources.rb +4 -1
  29. data/lib/jekyll/assets/hooks/sprockets.rb +3 -1
  30. data/lib/jekyll/assets/hooks/version.rb +6 -2
  31. data/lib/jekyll/assets/liquid.rb +3 -1
  32. data/lib/jekyll/assets/liquid/drop.rb +20 -2
  33. data/lib/jekyll/assets/liquid/filters.rb +13 -14
  34. data/lib/jekyll/assets/liquid/tag.rb +101 -39
  35. data/lib/jekyll/assets/liquid/tag/defaults.rb +2 -0
  36. data/lib/jekyll/assets/liquid/tag/defaults/image.rb +25 -5
  37. data/lib/jekyll/assets/liquid/tag/parser.rb +27 -19
  38. data/lib/jekyll/assets/liquid/tag/proxied_asset.rb +33 -20
  39. data/lib/jekyll/assets/liquid/tag/proxies.rb +21 -16
  40. data/lib/jekyll/assets/logger.rb +29 -15
  41. data/lib/jekyll/assets/manifest.rb +98 -0
  42. data/lib/jekyll/assets/patches.rb +4 -2
  43. data/lib/jekyll/assets/patches/jekyll/site.rb +0 -4
  44. data/lib/jekyll/assets/patches/kernel.rb +4 -14
  45. data/lib/jekyll/assets/patches/sprockets/asset.rb +10 -4
  46. data/lib/jekyll/assets/patches/sprockets/helpers.rb +31 -0
  47. data/lib/jekyll/assets/processors.rb +1 -0
  48. data/lib/jekyll/assets/processors/less.rb +68 -0
  49. data/lib/jekyll/assets/processors/liquid.rb +46 -0
  50. data/lib/jekyll/assets/proxies.rb +1 -0
  51. data/lib/jekyll/assets/proxies/magick.rb +167 -0
  52. data/lib/jekyll/assets/version.rb +4 -2
  53. metadata +52 -23
  54. data/lib/jekyll/assets/addons/compass.rb +0 -11
  55. data/lib/jekyll/assets/addons/font_awesome.rb +0 -5
  56. data/lib/jekyll/assets/addons/processors/liquid.rb +0 -31
  57. data/lib/jekyll/assets/addons/proxies/magick.rb +0 -126
  58. data/lib/jekyll/assets/hooks/context_patches.rb +0 -17
  59. data/lib/jekyll/assets/hooks/disable_erb.rb +0 -10
  60. data/lib/jekyll/assets/patches/jekyll/cleaner.rb +0 -15
@@ -1,9 +1,11 @@
1
+ # ----------------------------------------------------------------------------
1
2
  # Frozen-string-literal: true
2
- # Copyright: 2012-2015 - MIT License
3
+ # Copyright: 2012 - 2016 - MIT License
3
4
  # Encoding: utf-8
5
+ # ----------------------------------------------------------------------------
4
6
 
5
7
  module Jekyll
6
8
  module Assets
7
- VERSION="2.1.3"
9
+ VERSION="2.2.0"
8
10
  end
9
11
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-assets
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.3
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jordon Bedwell
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-04-15 00:00:00.000000000 Z
13
+ date: 2016-04-29 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: sprockets
@@ -44,44 +44,70 @@ dependencies:
44
44
  name: fastimage
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - "~>"
47
+ - - ">="
48
48
  - !ruby/object:Gem::Version
49
49
  version: '1.8'
50
+ - - "~>"
51
+ - !ruby/object:Gem::Version
52
+ version: '2.0'
50
53
  type: :runtime
51
54
  prerelease: false
52
55
  version_requirements: !ruby/object:Gem::Requirement
53
56
  requirements:
54
- - - "~>"
57
+ - - ">="
55
58
  - !ruby/object:Gem::Version
56
59
  version: '1.8'
60
+ - - "~>"
61
+ - !ruby/object:Gem::Version
62
+ version: '2.0'
57
63
  - !ruby/object:Gem::Dependency
58
64
  name: jekyll
59
65
  requirement: !ruby/object:Gem::Requirement
60
66
  requirements:
61
- - - "~>"
67
+ - - ">="
62
68
  - !ruby/object:Gem::Version
63
69
  version: '3.0'
70
+ - - "~>"
71
+ - !ruby/object:Gem::Version
72
+ version: '3.1'
64
73
  type: :runtime
65
74
  prerelease: false
66
75
  version_requirements: !ruby/object:Gem::Requirement
67
76
  requirements:
68
- - - "~>"
77
+ - - ">="
69
78
  - !ruby/object:Gem::Version
70
79
  version: '3.0'
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '3.1'
71
83
  - !ruby/object:Gem::Dependency
72
- name: tilt
84
+ name: pathutil
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0.8'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0.8'
97
+ - !ruby/object:Gem::Dependency
98
+ name: extras
73
99
  requirement: !ruby/object:Gem::Requirement
74
100
  requirements:
75
101
  - - "~>"
76
102
  - !ruby/object:Gem::Version
77
- version: '2.0'
103
+ version: '0.1'
78
104
  type: :runtime
79
105
  prerelease: false
80
106
  version_requirements: !ruby/object:Gem::Requirement
81
107
  requirements:
82
108
  - - "~>"
83
109
  - !ruby/object:Gem::Version
84
- version: '2.0'
110
+ version: '0.1'
85
111
  - !ruby/object:Gem::Dependency
86
112
  name: nokogiri
87
113
  requirement: !ruby/object:Gem::Requirement
@@ -102,28 +128,28 @@ dependencies:
102
128
  requirements:
103
129
  - - "~>"
104
130
  - !ruby/object:Gem::Version
105
- version: '3.3'
131
+ version: '3.5'
106
132
  type: :development
107
133
  prerelease: false
108
134
  version_requirements: !ruby/object:Gem::Requirement
109
135
  requirements:
110
136
  - - "~>"
111
137
  - !ruby/object:Gem::Version
112
- version: '3.3'
138
+ version: '3.5'
113
139
  - !ruby/object:Gem::Dependency
114
140
  name: rspec
115
141
  requirement: !ruby/object:Gem::Requirement
116
142
  requirements:
117
143
  - - "~>"
118
144
  - !ruby/object:Gem::Version
119
- version: '3.3'
145
+ version: '3.4'
120
146
  type: :development
121
147
  prerelease: false
122
148
  version_requirements: !ruby/object:Gem::Requirement
123
149
  requirements:
124
150
  - - "~>"
125
151
  - !ruby/object:Gem::Version
126
- version: '3.3'
152
+ version: '3.4'
127
153
  description: |2
128
154
  A Jekyll plugin, that allows you to write javascript/css assets in
129
155
  other languages such as CoffeeScript, Sass, Less and ERB, concatenate
@@ -145,11 +171,9 @@ files:
145
171
  - lib/jekyll/assets/addons.rb
146
172
  - lib/jekyll/assets/addons/autoprefixer.rb
147
173
  - lib/jekyll/assets/addons/bootstrap.rb
148
- - lib/jekyll/assets/addons/compass.rb
149
- - lib/jekyll/assets/addons/font_awesome.rb
150
- - lib/jekyll/assets/addons/js_es6.rb
151
- - lib/jekyll/assets/addons/processors/liquid.rb
152
- - lib/jekyll/assets/addons/proxies/magick.rb
174
+ - lib/jekyll/assets/addons/fontawesome.rb
175
+ - lib/jekyll/assets/addons/javascript.rb
176
+ - lib/jekyll/assets/addons/less.rb
153
177
  - lib/jekyll/assets/cached.rb
154
178
  - lib/jekyll/assets/config.rb
155
179
  - lib/jekyll/assets/env.rb
@@ -157,9 +181,8 @@ files:
157
181
  - lib/jekyll/assets/hooks.rb
158
182
  - lib/jekyll/assets/hooks/cache.rb
159
183
  - lib/jekyll/assets/hooks/compression.rb
160
- - lib/jekyll/assets/hooks/configuration.rb
161
- - lib/jekyll/assets/hooks/context_patches.rb
162
- - lib/jekyll/assets/hooks/disable_erb.rb
184
+ - lib/jekyll/assets/hooks/config.rb
185
+ - lib/jekyll/assets/hooks/erb.rb
163
186
  - lib/jekyll/assets/hooks/helpers.rb
164
187
  - lib/jekyll/assets/hooks/jekyll/drops.rb
165
188
  - lib/jekyll/assets/hooks/jekyll/setup.rb
@@ -178,11 +201,17 @@ files:
178
201
  - lib/jekyll/assets/liquid/tag/proxied_asset.rb
179
202
  - lib/jekyll/assets/liquid/tag/proxies.rb
180
203
  - lib/jekyll/assets/logger.rb
204
+ - lib/jekyll/assets/manifest.rb
181
205
  - lib/jekyll/assets/patches.rb
182
- - lib/jekyll/assets/patches/jekyll/cleaner.rb
183
206
  - lib/jekyll/assets/patches/jekyll/site.rb
184
207
  - lib/jekyll/assets/patches/kernel.rb
185
208
  - lib/jekyll/assets/patches/sprockets/asset.rb
209
+ - lib/jekyll/assets/patches/sprockets/helpers.rb
210
+ - lib/jekyll/assets/processors.rb
211
+ - lib/jekyll/assets/processors/less.rb
212
+ - lib/jekyll/assets/processors/liquid.rb
213
+ - lib/jekyll/assets/proxies.rb
214
+ - lib/jekyll/assets/proxies/magick.rb
186
215
  - lib/jekyll/assets/version.rb
187
216
  homepage: http://github.com/jekyll/jekyll-assets/
188
217
  licenses:
@@ -204,7 +233,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
204
233
  version: '0'
205
234
  requirements: []
206
235
  rubyforge_project:
207
- rubygems_version: 2.6.3
236
+ rubygems_version: 2.6.4
208
237
  signing_key:
209
238
  specification_version: 4
210
239
  summary: Assets for Jekyll
@@ -1,11 +0,0 @@
1
- # Frozen-string-literal: true
2
- # Copyright: 2012-2015 - MIT License
3
- # Encoding: utf-8
4
-
5
- try_require "compass/core" do
6
- Jekyll::Assets::Hook.register :env, :init do
7
- Compass::Frameworks::ALL.each do |framework|
8
- append_path framework.stylesheets_directory
9
- end
10
- end
11
- end
@@ -1,5 +0,0 @@
1
- # Frozen-string-literal: true
2
- # Copyright: 2012-2015 - MIT License
3
- # Encoding: utf-8
4
-
5
- try_require "font-awesome-sass"
@@ -1,31 +0,0 @@
1
- module Jekyll
2
- module Assets
3
- module Addons
4
- module Processors
5
- class Liquid < Tilt::Template
6
- PROCESSING_FOR = %W(text/css text/sass text/less application/javascript
7
- text/scss text/coffeescript text/javascript).freeze
8
- def prepare
9
- #
10
- end
11
-
12
- # Render the file with the sites current context, anything you
13
- # can do in a normal liquid file with Jekyll, you can do here inc,
14
- # accessing the entirety of your posts and pages, though I don't
15
- # know why you would want to, and I ain't judging you.
16
-
17
- def evaluate(scope, _, jekyll = scope.environment.jekyll, &_block)
18
- jekyll.liquid_renderer.file(@file).parse(data).render!(jekyll.site_payload, :registers => {
19
- :site => jekyll
20
- })
21
- end
22
- end
23
- end
24
- end
25
- end
26
- end
27
-
28
- # There might be a few missing, if there is please do let me know.
29
- Jekyll::Assets::Addons::Processors::Liquid::PROCESSING_FOR.each do |val|
30
- Sprockets.register_preprocessor val, Jekyll::Assets::Addons::Processors::Liquid
31
- end
@@ -1,126 +0,0 @@
1
- # Frozen-string-literal: true
2
- # Copyright: 2012-2015 - MIT License
3
- # Encoding: utf-8
4
-
5
- try_require "mini_magick" do
6
- args = %W(resize quality rotate crop flip)
7
- presets = %W(@2x @4x @1/2 @1/3 @2/3 @1/4 @2/4 @3/4
8
- @double @quadruple @half @one-third @two-thirds @one-fourth
9
- @two-fourths @three-fourths)
10
-
11
- Jekyll::Assets::Env.liquid_proxies.add :magick, :img, *(args + presets) do
12
- PRESETS = presets
13
- ARGS = args
14
-
15
- class DoubleResizeError < RuntimeError
16
- def initialize
17
- "Both resize and @*x provided, this is not supported."
18
- end
19
- end
20
-
21
- # @see https://github.com/minimagick/minimagick#usage -- All but
22
- # the boolean @ options are provided by Minimagick.
23
-
24
- def initialize(asset, opts, args)
25
- @path = asset.filename
26
- @opts = opts
27
- @asset = asset
28
- @args = args
29
- end
30
-
31
- #
32
-
33
- def process
34
- img = MiniMagick::Image.open(@path)
35
- private_methods(true).select { |v| v =~ /\Amagick_/ }.each do |method|
36
- send(method, img)
37
- end
38
-
39
- img.write(
40
- @path
41
- )
42
- ensure
43
- img.destroy!
44
- end
45
-
46
- #
47
-
48
- private
49
- def any_preset?(*keys)
50
- @opts.keys.any? do |key|
51
- keys.include?(key)
52
- end
53
- end
54
-
55
- #
56
-
57
- private
58
- def preset?
59
- (@opts.keys - ARGS.map(&:to_sym)).any?
60
- end
61
-
62
- #
63
-
64
- private
65
- def magick_quality(img)
66
- if @opts.key?(:quality)
67
- then img.quality @opts[:quality]
68
- end
69
- end
70
-
71
- #
72
-
73
- private
74
- def magick_resize(img)
75
- raise DoubleResizeError if @opts.key?(:resize) && preset?
76
- if @opts.key?(:resize)
77
- then img.resize @opts[:resize]
78
- end
79
- end
80
-
81
- #
82
-
83
- private
84
- def magick_rotate(img)
85
- if @opts.key?(:rotate)
86
- then img.rotate @opts[:rotate]
87
- end
88
- end
89
-
90
- #
91
-
92
- private
93
- def magick_flip(img)
94
- if @opts.key?(:flip)
95
- then img.flip @opts[:flip]
96
- end
97
- end
98
-
99
- #
100
-
101
- private
102
- def magick_crop(img)
103
- if @opts.key?(:crop)
104
- then img.crop @opts[:crop]
105
- end
106
- end
107
-
108
- # I just want you to know, we don't even care if you do multiple
109
- # resizes or try to, we don't attempt to even attempt to attempt to care
110
- # we expect you to be logical and if you aren't we will comply.
111
-
112
- private
113
- def magick_preset_resize(img)
114
- return unless preset?
115
- width, height = img.width * 4, img.height * 4 if any_preset?(:"4x", :quadruple)
116
- width, height = img.width * 2, img.height * 2 if any_preset?(:"2x", :double)
117
- width, height = img.width / 2, img.height / 2 if any_preset?(:"1/2", :half)
118
- width, height = img.width / 3, img.height / 3 if any_preset?(:"1/3", :"one-third")
119
- width, height = img.width / 4, img.height / 4 if any_preset?(:"1/4", :"one-fourth")
120
- width, height = img.width / 3 * 2, img.height / 3 * 2 if any_preset?(:"2/3", :"two-thirds")
121
- width, height = img.width / 4 * 2, img.height / 4 * 2 if any_preset?(:"2/4", :"two-fourths")
122
- width, height = img.width / 4 * 3, img.height / 4 * 3 if any_preset?(:"3/4", :"three-fourths")
123
- img.resize "#{width}x#{height}"
124
- end
125
- end
126
- end
@@ -1,17 +0,0 @@
1
- # Frozen-string-literal: true
2
- # Copyright: 2012-2015 - MIT License
3
- # Encoding: utf-8
4
-
5
- Jekyll::Assets::Hook.register :env, :init do
6
- context_class.class_eval do
7
- alias_method :_old_asset_path, :asset_path
8
- def asset_path(asset, _ = {})
9
- out = _old_asset_path asset
10
-
11
- return unless out
12
- path = environment.find_asset(resolve(asset))
13
- environment.parent.used.add(path)
14
- out
15
- end
16
- end
17
- end
@@ -1,10 +0,0 @@
1
- # Frozen-string-literal: true
2
- # Copyright: 2012-2015 - MIT License
3
- # Encoding: utf-8
4
-
5
- Jekyll::Assets::Hook.register :env, :init, :early do
6
- self.config = hash_reassoc(config, :engines) do |hash|
7
- hash.delete(".erb")
8
- hash
9
- end
10
- end
@@ -1,15 +0,0 @@
1
- # Frozen-string-literal: true
2
- # Copyright: 2012-2015 - MIT License
3
- # Encoding: utf-8
4
-
5
- module Jekyll
6
- class Cleaner
7
- # TODO: jekyll/jekyll@upstream: This method should really have a hook ya.
8
- alias_method :_old_obsolete_files, :obsolete_files
9
- def obsolete_files
10
- _old_obsolete_files.delete_if do |path|
11
- path =~ %r!\A#{Regexp.escape(site.in_dest_dir("assets"))}(\/.*)?\Z!
12
- end
13
- end
14
- end
15
- end