liquid_loader 0.0.5 → 0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +6 -0
- data/lib/liquid_loader/context.rb +11 -3
- data/lib/liquid_loader/liquid_model.rb +1 -1
- data/lib/liquid_loader/version.rb +1 -1
- data/liquid_loader.gemspec +1 -1
- metadata +25 -9
data/README.md
CHANGED
@@ -1 +1,7 @@
|
|
1
|
+
LiquidLoader
|
2
|
+
========
|
3
|
+
|
1
4
|
This is LiquidLoader - a simple way to expose your models to liquid by automatically loading instances into drops.
|
5
|
+
|
6
|
+
## Update - 02 July 2012
|
7
|
+
It hasn't really been under active development since I made it as a hack for a project, but I've needed some more functionality from it, so expect to see more soon.
|
@@ -3,14 +3,14 @@ require 'liquid'
|
|
3
3
|
module LiquidLoader
|
4
4
|
module Context
|
5
5
|
|
6
|
-
def
|
6
|
+
def render_layout(template, context = nil)
|
7
7
|
ctx = (context ? context : liq)
|
8
8
|
template.render(ctx)
|
9
9
|
end
|
10
10
|
|
11
|
-
def
|
11
|
+
def render_template(template, destination, context = nil)
|
12
12
|
ctx = (context ? context : liq)
|
13
|
-
add_context(destination =>
|
13
|
+
add_context(destination => render_layout(template, ctx))
|
14
14
|
end
|
15
15
|
|
16
16
|
def add_context(opts = nil)
|
@@ -20,6 +20,14 @@ module LiquidLoader
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
end
|
23
|
+
|
24
|
+
def add_register(opts = nil)
|
25
|
+
if opts.is_a? Hash
|
26
|
+
opts.each do |k, v|
|
27
|
+
liq.registers[k.to_sym] = v
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
23
31
|
|
24
32
|
private
|
25
33
|
def liq
|
data/liquid_loader.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: liquid_loader
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: '0.1'
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2012-07-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: liquid
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,18 +21,28 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
25
30
|
- !ruby/object:Gem::Dependency
|
26
31
|
name: rails
|
27
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
28
33
|
none: false
|
29
34
|
requirements:
|
30
|
-
- -
|
35
|
+
- - ! '>='
|
31
36
|
- !ruby/object:Gem::Version
|
32
|
-
version:
|
37
|
+
version: '0'
|
33
38
|
type: :runtime
|
34
39
|
prerelease: false
|
35
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
36
46
|
description: See Summary
|
37
47
|
email:
|
38
48
|
- JGW Maxwell
|
@@ -64,15 +74,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
64
74
|
- - ! '>='
|
65
75
|
- !ruby/object:Gem::Version
|
66
76
|
version: '0'
|
77
|
+
segments:
|
78
|
+
- 0
|
79
|
+
hash: -1883388936165170843
|
67
80
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
68
81
|
none: false
|
69
82
|
requirements:
|
70
83
|
- - ! '>='
|
71
84
|
- !ruby/object:Gem::Version
|
72
85
|
version: '0'
|
86
|
+
segments:
|
87
|
+
- 0
|
88
|
+
hash: -1883388936165170843
|
73
89
|
requirements: []
|
74
90
|
rubyforge_project: liquid_loader
|
75
|
-
rubygems_version: 1.8.
|
91
|
+
rubygems_version: 1.8.24
|
76
92
|
signing_key:
|
77
93
|
specification_version: 3
|
78
94
|
summary: This gem provides a simple include method to auto-generate liquid drops from
|