liquid_assets 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/liquid_assets/engine.rb +1 -1
- data/lib/liquid_assets/liquid_file_system.rb +21 -0
- data/lib/liquid_assets/resolver.rb +5 -1
- data/lib/liquid_assets/version.rb +1 -1
- data/lib/liquid_assets.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70f04b8e8c2997831e781dffd05a95e80cadcbed
|
4
|
+
data.tar.gz: 2fa71d8788f5174057b5fc2a402711d7e13c184f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35e41cccb938e6450ec78c107f7dbb0e63eef33f713cbb2790840890566df5329d63d38cb33be1ac5ba8b57d103708b4e2e5a976edee3f05a2b875bb19455710
|
7
|
+
data.tar.gz: d370954a6795c57e15b0a40f5c8ae3c5318177658ecac41e0a5f02eb2c97869c4f70b0277043f16ea3a285e4a3dcc2e2ccf13552b478160505fe8e7fefad0d13
|
data/Gemfile.lock
CHANGED
data/lib/liquid_assets/engine.rb
CHANGED
@@ -14,7 +14,7 @@ module LiquidAssets
|
|
14
14
|
app.assets.register_engine(".liquid", ::LiquidAssets::PipelineTemplateEngine )
|
15
15
|
|
16
16
|
app.config.to_prepare do
|
17
|
-
Liquid::Template.file_system =
|
17
|
+
Liquid::Template.file_system = LiquidFileSystem.new
|
18
18
|
ApplicationController.send( :append_view_path, LiquidAssets::Config.path_prefix )
|
19
19
|
ApplicationController.send( :prepend_view_path, LiquidAssets::Resolver.instance )
|
20
20
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module LiquidAssets
|
2
|
+
|
3
|
+
class LiquidFileSystem < Liquid::LocalFileSystem
|
4
|
+
|
5
|
+
def initialize
|
6
|
+
super( Config.template_root_path )
|
7
|
+
end
|
8
|
+
|
9
|
+
|
10
|
+
def read_template_file( template_path, context )
|
11
|
+
source = Config.content_provider.call( Resolver.convert_path_to_partial( template_path.dup ) )
|
12
|
+
if false == source
|
13
|
+
return super
|
14
|
+
else
|
15
|
+
return source
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
@@ -58,7 +58,11 @@ module LiquidAssets
|
|
58
58
|
|
59
59
|
def partial_path( path, partial )
|
60
60
|
return path if ! partial
|
61
|
-
|
61
|
+
Resolver.convert_path_to_partial( path )
|
62
|
+
end
|
63
|
+
|
64
|
+
def Resolver.convert_path_to_partial( path )
|
65
|
+
if index = path.rindex('/') # had: gsub(/\/([^\/]+)$/,'/_\1')
|
62
66
|
path.insert(index+1,'_') # this is better
|
63
67
|
else
|
64
68
|
'_' + path
|
data/lib/liquid_assets.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: liquid_assets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Stitt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-04-
|
11
|
+
date: 2013-04-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: liquid
|
@@ -112,6 +112,7 @@ files:
|
|
112
112
|
- lib/liquid_assets/config.rb
|
113
113
|
- lib/liquid_assets/engine.rb
|
114
114
|
- lib/liquid_assets/eval.rb
|
115
|
+
- lib/liquid_assets/liquid_file_system.rb
|
115
116
|
- lib/liquid_assets/pipeline_template_engine.rb
|
116
117
|
- lib/liquid_assets/resolver.rb
|
117
118
|
- lib/liquid_assets/template_handler.rb
|