jekyll-assets 3.0.6 → 3.0.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d245aff52390866323d9c7bf20d14fe63c28a0a95ae7fe535f3c6df506e7f7a5
4
- data.tar.gz: 85d98b9f5543ea588fd5acf51d801ad98be4fa8e5b2998b6b5a279f3fdcddd46
3
+ metadata.gz: b782c8280d7d3a50234be8ed6923a652fd4fc64a9d48a73c0a6149ba488233ad
4
+ data.tar.gz: c3ee8170a33b679ff744325d5a2edde5fb28185cb54ebf8b804e24990a1dd4a1
5
5
  SHA512:
6
- metadata.gz: 92544fcdb40ca56d6b76a77e11faa199e7f2da477d597658673e504136a30ac54198dcddda36682803c6dc95ea1ded0193fbb82105210a297523e8b230ddcc00
7
- data.tar.gz: 074e304b51a467c634c80acb05c600b698ba426e27a75f5794fb71af8968bda65979619ef1e8286c8fd543c8e4180d5ca04a4d8f434e5905451abfdfb44b0661
6
+ metadata.gz: 988839d356b82ff5487241eda8889fbb7cdcfc510f58369b41af37af503500099e1bd359a3f4909e13388804140294474c026080e2340bd3352c825ffb238276
7
+ data.tar.gz: e4e3b85799a51f19575f1532c93f4871f47eea6121ae05b20dab5f2d3c0b79a3f04ca5b76b17d29d7959fc1fb24ce8a21d9eb2ba0b7c3bc9f60ccb8d30c71f28
data/README.md CHANGED
@@ -5,6 +5,8 @@
5
5
  ![Gem Version](https://img.shields.io/gem/v/jekyll-assets.svg?style=for-the-badge)
6
6
  ![Gem DL](https://img.shields.io/gem/dt/jekyll-assets.svg?style=for-the-badge)
7
7
 
8
+ ***Looking for information on what's changed? See https://envygeeks.io/2017/11/21/jekyll-assets-3-released***
9
+
8
10
  # Jekyll Assets
9
11
 
10
12
  Jekyll Assets is a drop in [asset pipeline](http://guides.rubyonrails.org/asset_pipeline.html) that uses [Sprockets](https://github.com/rails/sprockets) to build specifically for Jekyll. It utilizes [Sprockets](https://github.com/rails/sprockets), and [Jekyll](https://jekyllrb.com) to try and achieve a clean, and extensible assets platform that supports plugins, caching, converting your assets. It even supports proxying of said assets in a way that does not interfere with either [Sprockets](https://github.com/rails/sprockets), or [Jekyll](https://jekyllrb.com), or your own source. By default you can add Jekyll Assets to your Gemfile, as a plugin, and have it act as a drop-in replacement for Jekyll's basic SASS processors, with you only having to add it to your Gemfile, and updating your `<img>`, and `<link>`.
@@ -17,6 +17,7 @@ def require_all(*globs)
17
17
  end }
18
18
  end
19
19
 
20
+ # --
20
21
  require_relative "assets/env"
21
22
  Jekyll::Hooks.register :site, :post_read, priority: 99 do |o|
22
23
  unless o.sprockets
@@ -30,6 +31,6 @@ end
30
31
  # stuff block and be done just incase something else relies
31
32
  # on our stuff to do their stuff. Such as reloaders.
32
33
  # --
33
- Jekyll::Hooks.register :site, :post_render, priority: 99 do |o|
34
+ Jekyll::Hooks.register :site, :post_write, priority: 99 do |o|
34
35
  o&.sprockets&.write_all
35
36
  end
@@ -24,6 +24,7 @@ module Jekyll
24
24
  })
25
25
  end
26
26
 
27
+ rtn = rtn.sort_by(&:internal?)
27
28
  ida = HashWithIndifferentAccess.new
28
29
  rtn.each_with_object(ida) do |v, h|
29
30
  h.deep_merge!(v.static)
@@ -11,7 +11,7 @@ module Jekyll
11
11
  class Drop < Liquid::Drop
12
12
  extend Forwardable::Extended
13
13
  def initialize(path, jekyll:)
14
- @path = path
14
+ @path = path.to_s
15
15
  @sprockets = jekyll.sprockets
16
16
  @jekyll = jekyll
17
17
  @asset = nil
@@ -41,6 +41,20 @@ module Jekyll
41
41
  }
42
42
  end
43
43
 
44
+ # --
45
+ def self.internal!
46
+ if name.start_with?("Jekyll::Assets")
47
+ requirements[:internal] = true
48
+ end
49
+ end
50
+
51
+ # --
52
+ def self.internal?
53
+ requirements[
54
+ :internal
55
+ ]
56
+ end
57
+
44
58
  # --
45
59
  # @note a type is a "content type"
46
60
  # Allows you to use types to determine if this class fits.
@@ -73,7 +87,8 @@ module Jekyll
73
87
  # can limit your surface for an extensible plugin. For
74
88
  # example if you only work for
75
89
  # --
76
- [%i(arg_keys args), %i(content_types types)].each do |(k, v)|
90
+ m = [%i(content_types types), %i(arg_keys args)]
91
+ m.each do |(k, v)|
77
92
  instance_eval <<-RUBY
78
93
  def self.#{k}(*a)
79
94
  requirements[:#{v}].concat(a)
@@ -9,6 +9,7 @@ module Jekyll
9
9
  class Default
10
10
  class Audio < Default
11
11
  content_types %r!^audio/[a-zA-Z0-9\-_]+$!
12
+ internal!
12
13
 
13
14
  # --
14
15
  def set_src
@@ -9,6 +9,7 @@ module Jekyll
9
9
  class Default
10
10
  class Component < Default
11
11
  content_types "text/html"
12
+ internal!
12
13
 
13
14
  # --
14
15
  def set_href
@@ -8,8 +8,9 @@ module Jekyll
8
8
  module Assets
9
9
  class Default
10
10
  class CSS < Default
11
- static rel: "stylesheet", type: "text/css"
12
11
  content_types "text/css"
12
+ static rel: "stylesheet", type: "text/css"
13
+ internal!
13
14
 
14
15
  # --
15
16
  def set_href
@@ -9,6 +9,7 @@ module Jekyll
9
9
  class Default
10
10
  class Favicon < Default
11
11
  content_types "image/x-icon"
12
+ internal!
12
13
 
13
14
  # --
14
15
  def set_rel
@@ -8,7 +8,8 @@ module Jekyll
8
8
  module Assets
9
9
  class Default
10
10
  class Img < Default
11
- content_types %r!^image/(?\!x-icon$)[a-zA-Z0-9\-_+]+$!
11
+ content_types %r!^image/(?\!x-icon$)[a-zA-Z0-9\-_\+]+$!
12
+ internal!
12
13
 
13
14
  # --
14
15
  def set_src
@@ -8,8 +8,9 @@ module Jekyll
8
8
  module Assets
9
9
  class Default
10
10
  class JS < Default
11
- content_types "application/javascript"
12
11
  static type: "text/javascript"
12
+ content_types "application/javascript"
13
+ internal!
13
14
 
14
15
  # --
15
16
  def set_src
@@ -9,6 +9,7 @@ module Jekyll
9
9
  class Default
10
10
  class Video < Default
11
11
  content_types %r!^video/.*$!
12
+ internal!
12
13
 
13
14
  # --
14
15
  def set_src
@@ -9,7 +9,7 @@ module Jekyll
9
9
  module Assets
10
10
  class HTML
11
11
  class IMG < HTML
12
- content_types %r!^image/(?\!x-icon$)[a-zA-Z0-9\-_+]+$!
12
+ content_types %r!^image/(?\!x-icon$)[a-zA-Z0-9\-_\+]+$!
13
13
 
14
14
  # --
15
15
  def run
@@ -82,8 +82,7 @@ module Jekyll
82
82
  end
83
83
 
84
84
  def self.digest(args)
85
- Digest::SHA256.hexdigest(args.instance_variable_get(
86
- :@raw))[0, 6]
85
+ Digest::SHA256.hexdigest(args.to_h.inspect)[0, 6]
87
86
  end
88
87
 
89
88
  # --
@@ -80,7 +80,6 @@ module Jekyll
80
80
  # --
81
81
  rescue Sprockets::FileNotFound => e
82
82
  e_not_found(e, {
83
- args: args,
84
83
  ctx: ctx,
85
84
  })
86
85
  # --
@@ -4,6 +4,6 @@
4
4
 
5
5
  module Jekyll
6
6
  module Assets
7
- VERSION = "3.0.6"
7
+ VERSION = "3.0.7"
8
8
  end
9
9
  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: 3.0.6
4
+ version: 3.0.7
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: 2018-01-12 00:00:00.000000000 Z
13
+ date: 2018-01-29 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: execjs
@@ -225,7 +225,6 @@ files:
225
225
  - lib/jekyll/assets/patches/site.rb
226
226
  - lib/jekyll/assets/plugins.rb
227
227
  - lib/jekyll/assets/plugins/bootstrap.rb
228
- - lib/jekyll/assets/plugins/closure_comments.rb
229
228
  - lib/jekyll/assets/plugins/font-awesome.rb
230
229
  - lib/jekyll/assets/plugins/frontmatter.rb
231
230
  - lib/jekyll/assets/plugins/html/audio.rb
@@ -1,32 +0,0 @@
1
- # Frozen-string-literal: true
2
- # Copyright: 2012 - 2018 - MIT License
3
- # Encoding: utf-8
4
-
5
- module Jekyll
6
- module Assets
7
- module Plugins
8
- module ClosureComments
9
- def self.call(input)
10
- theregex = %r!/\*(\W+@alternat(e|ive)\W+)\*/!
11
- input[:data].gsub!(theregex, "/*!\\1*/")
12
- end
13
- end
14
-
15
- # --
16
- %w(text/css text/scss text/sass).each do |v|
17
- Sprockets.register_preprocessor v, ClosureComments
18
- end
19
- end
20
- end
21
- end
22
-
23
- # --
24
- Jekyll::Assets::Hook.register :asset, :before_write do |v|
25
- theregex = %r!/\*\!(\W+@alternat(e|ive)\W+)\*/;?!
26
-
27
- if v.content_type == "text/css"
28
- src = v.to_s.gsub(theregex, "/*\\1*/")
29
- v.metadata[:digest] = Sprockets::DigestUtils.digest(src)
30
- v.instance_variable_set(:@source, src)
31
- end
32
- end