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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 05277be46cbe2e2d7d1cce109ca15d5e7ce156cf
4
- data.tar.gz: 376327fb4e7fe7c2d6edeff878d530330d54d290
3
+ metadata.gz: 70f04b8e8c2997831e781dffd05a95e80cadcbed
4
+ data.tar.gz: 2fa71d8788f5174057b5fc2a402711d7e13c184f
5
5
  SHA512:
6
- metadata.gz: 390677abed5cd524a34c634b8210a551ddfb0168a8ce8030d14cf315615e9db6d32d5acd8b211b01d7c788ad2185473cef2c45d95252d3ee78eb773cf94cd2f5
7
- data.tar.gz: 52236d4d965716c356fd7246c8c64eee782a2758ff4336d5df6f9c1ab563ea97ffa214f4554d22c5aac7ea302b2596cfbb51ace171635d12c45716e2385186ec
6
+ metadata.gz: 35e41cccb938e6450ec78c107f7dbb0e63eef33f713cbb2790840890566df5329d63d38cb33be1ac5ba8b57d103708b4e2e5a976edee3f05a2b875bb19455710
7
+ data.tar.gz: d370954a6795c57e15b0a40f5c8ae3c5318177658ecac41e0a5f02eb2c97869c4f70b0277043f16ea3a285e4a3dcc2e2ccf13552b478160505fe8e7fefad0d13
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- liquid_assets (0.3.2)
4
+ liquid_assets (0.3.3)
5
5
  actionpack (>= 3.2)
6
6
  execjs
7
7
  liquid
@@ -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 = Liquid::LocalFileSystem.new( Config.template_root_path )
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
- if index.path.rindex('/') # had: gsub(/\/([^\/]+)$/,'/_\1')
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
@@ -1,3 +1,3 @@
1
1
  module LiquidAssets
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
data/lib/liquid_assets.rb CHANGED
@@ -2,7 +2,7 @@ require 'liquid_assets/version'
2
2
  require 'liquid_assets/eval'
3
3
  require 'liquid_assets/config'
4
4
  require 'liquid_assets/template_handler'
5
-
5
+ require 'liquid_assets/liquid_file_system'
6
6
  require 'liquid_assets/resolver'
7
7
 
8
8
  module LiquidAssets
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.2
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-09 00:00:00.000000000 Z
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