quintype-liquid 0.1.6 → 0.1.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 +4 -4
- data/lib/quintype/liquid/file_system.rb +10 -7
- data/lib/quintype/liquid/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 153ba235684b4ae61b81125892e4d2a8d98c60d4
|
4
|
+
data.tar.gz: 25fceb99590fb035b236f8052b3fff8e0743e799
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42be3785944ee99843868e9bf3f710c81811e93dc67b06d56894bd8392efff3907ebe84df303a9a59182e28dd26fd20d2ea81ea3c18c99e0b8334a1fe6d8f874
|
7
|
+
data.tar.gz: d13e0dd81b758a88f2bb8ea4609a6f1e458ad5e364fa35ec42672093ac66682730a524432f768f9d69302203c3cd41ac6fa1f83075e769717760ae29981e1509
|
@@ -1,17 +1,20 @@
|
|
1
1
|
module Quintype::Liquid
|
2
|
+
module FileSystemCacheReadFile
|
3
|
+
def read_file(path)
|
4
|
+
@cached_templates ||= Concurrent::Map.new do |m, path|
|
5
|
+
m[path] = super(path)
|
6
|
+
end
|
7
|
+
@cached_templates[path]
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
2
11
|
class FileSystem < ::Liquid::LocalFileSystem
|
3
12
|
def read_file(path)
|
4
13
|
full_path = full_path(path)
|
5
14
|
File.read(full_path) if File.exists?(full_path)
|
6
15
|
end
|
7
16
|
|
8
|
-
|
9
|
-
@cached_templates ||= Concurrent::Map.new do |m, path|
|
10
|
-
m[path] = read_file_without_caching(path)
|
11
|
-
end
|
12
|
-
@cached_templates[path]
|
13
|
-
end
|
14
|
-
alias_method_chain :read_file, :caching if defined?(Rails) && Rails.env.production?
|
17
|
+
prepend FileSystemCacheReadFile if defined?(Rails) && Rails.env.production?
|
15
18
|
|
16
19
|
def read_template_file(template_path, context)
|
17
20
|
controller = context.registers[:controller]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quintype-liquid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tejas Dinkar
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: liquid-rails
|