maglove-engine 2.0.6 → 2.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/maglove/engine/configuration.rb +7 -0
- data/lib/maglove/engine/scope.rb +3 -7
- data/lib/maglove/engine/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2e5ec24d541ec97e5cd06f7528d96200ba25f26
|
4
|
+
data.tar.gz: 941908173805b33a3eec4d2c3bd991789472552b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85fb6a73cab59398572064539919d3a49b5753650fd5669062200c488964cb27f899c3b486ab2724747f0c6de721874ae82b31753700d1e884fee99b9834fa4f
|
7
|
+
data.tar.gz: 07d7f44b8b701e46ecca22f2a9a8c343680ef41f5b3fbd394e21ed74286d63d605c6c0422e6ca964d6497ede867a454b84d7bc66ec119f6c5f7e2ffb634787d7
|
@@ -4,6 +4,13 @@ module Maglove
|
|
4
4
|
include Singleton
|
5
5
|
attr_accessor :asset_uri
|
6
6
|
attr_accessor :block_path
|
7
|
+
attr_accessor :block_resolver
|
8
|
+
|
9
|
+
def initialize
|
10
|
+
@block_resolver = lambda do |identifier, variables|
|
11
|
+
File.read(File.join(Maglove::Engine.config.block_path, "#{identifier}.haml"))
|
12
|
+
end
|
13
|
+
end
|
7
14
|
end
|
8
15
|
end
|
9
16
|
end
|
data/lib/maglove/engine/scope.rb
CHANGED
@@ -14,10 +14,6 @@ module Maglove
|
|
14
14
|
var(:asset_uri, Maglove::Engine.config.asset_uri)
|
15
15
|
end
|
16
16
|
|
17
|
-
def block_path
|
18
|
-
var(:block_path, Maglove::Engine.config.block_path)
|
19
|
-
end
|
20
|
-
|
21
17
|
def asset(url)
|
22
18
|
"#{asset_uri}/themes/#{theme}/#{url}"
|
23
19
|
end
|
@@ -35,9 +31,9 @@ module Maglove
|
|
35
31
|
end
|
36
32
|
|
37
33
|
def block(identifier, variables = {})
|
38
|
-
|
39
|
-
haml =
|
40
|
-
Maglove::Engine.render(haml,
|
34
|
+
variables = @variables.merge(variables)
|
35
|
+
haml = Maglove::Engine.config.block_resolver.call(identifier, variables)
|
36
|
+
Maglove::Engine.render(haml, variables)
|
41
37
|
end
|
42
38
|
|
43
39
|
def var(key, default = nil)
|