hamloft 0.1.9 → 0.2.0

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: 47cc3e9144c2b208e15e93916a53e6e8d2e395f9
4
- data.tar.gz: 47caf5c257e9638fb1eb51729282888ca7473216
3
+ metadata.gz: 59091127306c9531bd8bc2b81dd6f4ae161f3862
4
+ data.tar.gz: 20d93d794bc7052430254d0ecc70aa996ae67847
5
5
  SHA512:
6
- metadata.gz: e4371c3dff3a40b20d88e5882f9640d942da28e85d8c1539ef38232ebe5e4592c8c8914c8286dced78be95e767bed8f47f17cbc267160f9dabe0e0df5eb5236b
7
- data.tar.gz: 4f491d245c3113989aa81119249ff54447a31c907f2145ec241e7383f79528187db5c68fde637451944e510f55c0d7c4d06dc43dd7fb8633f41014ec5164f79a
6
+ metadata.gz: b63f332542ad3d3109965946a7d208f8f883fa0c8b699eacf2bad58fddd835998bd223d24ea33e5544fb8ae15324dd1ef08a0ed8a4f28b0101c65cce2dfcb5db
7
+ data.tar.gz: c7e89acd0ec1e6584d7de3da5204f19185a666db5d9620609c2afccd4abeb2f793970d8bcf671138ea71a87f4e584f7f8e15d245edd7295110abe2e51d3e77db
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hamloft (0.1.9)
4
+ hamloft (0.2.0)
5
5
  haml (~> 4.0)
6
6
  nokogiri (~> 1.6)
7
7
 
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Hamloft
2
- VERSION = "0.1.9"
2
+ VERSION = "0.2.0"
3
3
  end
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.1.9
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-22 00:00:00.000000000 Z
11
+ date: 2016-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: haml