hamloft 0.1.9 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/hamloft/helpers.rb +6 -2
- data/lib/hamloft/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59091127306c9531bd8bc2b81dd6f4ae161f3862
|
4
|
+
data.tar.gz: 20d93d794bc7052430254d0ecc70aa996ae67847
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b63f332542ad3d3109965946a7d208f8f883fa0c8b699eacf2bad58fddd835998bd223d24ea33e5544fb8ae15324dd1ef08a0ed8a4f28b0101c65cce2dfcb5db
|
7
|
+
data.tar.gz: c7e89acd0ec1e6584d7de3da5204f19185a666db5d9620609c2afccd4abeb2f793970d8bcf671138ea71a87f4e584f7f8e15d245edd7295110abe2e51d3e77db
|
data/Gemfile.lock
CHANGED
data/lib/hamloft/helpers.rb
CHANGED
@@ -5,15 +5,19 @@ module Hamloft
|
|
5
5
|
Hamloft::StyleBuilder.new(options, args).process(block)
|
6
6
|
end
|
7
7
|
|
8
|
-
def block(identifier)
|
8
|
+
def block(identifier, variables={})
|
9
9
|
haml_contents = File.read("src/themes/#{@_haml_locals[:theme]}/blocks/#{identifier}.haml")
|
10
|
-
Hamloft.render(haml_contents, theme: @_haml_locals[:theme], base_path: @_haml_locals[:base_path])
|
10
|
+
Hamloft.render(haml_contents, theme: @_haml_locals[:theme], base_path: @_haml_locals[:base_path], variables: variables)
|
11
11
|
end
|
12
12
|
|
13
13
|
# styles
|
14
14
|
def asset(url)
|
15
15
|
"#{Hamloft::Options.defaults[:asset_uri]}/themes/#{@_haml_locals[:theme]}/#{url}"
|
16
16
|
end
|
17
|
+
|
18
|
+
def var(key, default="")
|
19
|
+
variable(:variables)[key.to_sym] || default
|
20
|
+
end
|
17
21
|
|
18
22
|
def variable(key, default=false)
|
19
23
|
@_haml_locals[key.to_sym] || default
|
data/lib/hamloft/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hamloft
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tobias Strebitzer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: haml
|