jekyll-assets 3.0.10 → 3.0.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8802519985258b4eb676f27beef2393b75b3628067c317c8861966cbbab9b86a
4
- data.tar.gz: f522012aa1e7711daa7e0b42306a1bfb5c927116e36964aac2413d94e420a76c
3
+ metadata.gz: 319eeab72a3d9cb99b7bf888861dcd5e8685c5245b9fa179e587d853bd6b3cad
4
+ data.tar.gz: 2b53de4cacd344d2bc84aaa3d33df4d6382d77c42baae6bac881aa66bd304656
5
5
  SHA512:
6
- metadata.gz: 37fd7315a6cd37c70fe25412686f97d767d264a8c25915d2ca629d9e5a011de6ab6e7c9758b82b94288e13b6cef9c665cd9c631ed462a551f5ab56b10401fb20
7
- data.tar.gz: 93a4a75a7658df533ffeb64e95f87c532531b0fd0f056c396ff6cdaede8135e0c8bdf868520756a0cbd54a8d942b4cefa290f25b0f10d210cd21341de00e0c33
6
+ metadata.gz: 8d796a76d2b54a4364426c9bf364dd2252ba65006270bf6cfe2cbb3ee96fcd1cc26aaec958a88d0971a5d3f9c1a89d3c26dc15e8c91dedaed835a431419a397a
7
+ data.tar.gz: c1a4c4a479b28558976ee59c5c6d32c1f293b9b957bb4b946ee26040930466d3216e42c2dd0dc9b2659fb5dba290c1a592b38f5258b472505556bbf4811ba358
@@ -107,7 +107,9 @@ module Jekyll
107
107
  out = Sprockets::Cache::MemoryStore.new if enbl && type == "memory"
108
108
  out = Sprockets::Cache::FileStore.new(path) if enbl && type == "file"
109
109
  out = Sprockets::Cache::NullStore.new unless enbl
110
- Sprockets::Cache.new(out, Logger)
110
+ out = Sprockets::Cache.new(out, Logger)
111
+ clear_cache(out)
112
+ out
111
113
  end
112
114
  end
113
115
 
@@ -151,6 +153,16 @@ module Jekyll
151
153
  end
152
154
  end
153
155
 
156
+ # --
157
+ private
158
+ def clear_cache(cache)
159
+ if @manifest.new_manifest? && cache && cache.respond_to?(:clear)
160
+ cache.clear
161
+ end
162
+ rescue Errno::ENOENT
163
+ nil
164
+ end
165
+
154
166
  # --
155
167
  private
156
168
  def ignore_caches!
@@ -9,6 +9,26 @@ module Jekyll
9
9
  class Manifest < Sprockets::Manifest
10
10
  attr_reader :data
11
11
 
12
+ # --
13
+ # Determines if we've a new manifest file.
14
+ # @note it helps us keep the cache directory clean.
15
+ # rubocop:disable Style/RedundantReturn
16
+ # @return [true, false]
17
+ # --
18
+ def new_manifest?
19
+ return @new_manifest
20
+ end
21
+
22
+ # --
23
+ # Set @new_manifest to false by default.
24
+ # @override Sprockets::Manifest#initialize
25
+ # @return See upstream.
26
+ # --
27
+ def initialize(*args)
28
+ @new_manifest = false
29
+ super
30
+ end
31
+
12
32
  # --
13
33
  # Works around some weird behavior in Sprockets 3.x that seemd to make
14
34
  # it so that when you use an absolute path, it was automatically a filter
@@ -29,6 +49,18 @@ module Jekyll
29
49
  assets
30
50
  )
31
51
  end
52
+
53
+ # --
54
+ # rubocop:disable Metrics/LineLength
55
+ # Allows us to discover the manifest path, but know
56
+ # if it's new.
57
+ # --
58
+ def find_directory_manifest(dirname)
59
+ entries = File.directory?(dirname) ? Dir.entries(dirname) : []
60
+ entry = (f = entries.find { |e| e =~ MANIFEST_RE }) || generate_manifest_path
61
+ f || @new_manifest = true
62
+ File.join(dirname, entry)
63
+ end
32
64
  end
33
65
  end
34
66
  end
@@ -4,6 +4,6 @@
4
4
 
5
5
  module Jekyll
6
6
  module Assets
7
- VERSION = "3.0.10"
7
+ VERSION = "3.0.11"
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.10
4
+ version: 3.0.11
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-04-14 00:00:00.000000000 Z
13
+ date: 2018-04-15 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: execjs