quintype-liquid 0.1.6 → 0.1.7

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
  SHA1:
3
- metadata.gz: 39204e989d46058679f2caf14485eaf16c6ec767
4
- data.tar.gz: ade6aaef543eb77b58380e3580ef99fb180b10c1
3
+ metadata.gz: 153ba235684b4ae61b81125892e4d2a8d98c60d4
4
+ data.tar.gz: 25fceb99590fb035b236f8052b3fff8e0743e799
5
5
  SHA512:
6
- metadata.gz: d0e164a7de419bb48809198e2e2389d45fbd3407461451be34147844ff35ffe1d3b4dde65a8c1869518c9677eb5d289825731b2097d4e1daa5acc1d7dc14fa63
7
- data.tar.gz: 17cfc5f16b18f1020ca790e25a591e681cc99f6aaa55fe7b4511f1c3ce2345a8b5b24aecaf4aee6278d02485045a1bfa696f3d770d3f8d2a1c32e17ff8fe8a69
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
- def read_file_with_caching(path)
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]
@@ -1,5 +1,5 @@
1
1
  module Quintype
2
2
  module Liquid
3
- VERSION = "0.1.6"
3
+ VERSION = "0.1.7"
4
4
  end
5
5
  end
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.6
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-29 00:00:00.000000000 Z
11
+ date: 2016-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: liquid-rails