hamlit-block 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/hamlit/block.rb +1 -0
- data/lib/hamlit/block/template.rb +30 -0
- data/lib/hamlit/block/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9ef99e0052a2b7b0552ae36396d0a8d7067cfc2
|
4
|
+
data.tar.gz: 17b0eea2f4914d8db52bf142dfb8326588f22b4e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5edbe534a008bab31c1270fedb77d94991322f0c6068a923a3e5b5f9b4e957f3a1d507c2bca411edf69fe6ad8a98ed79c4ca250f21a0a1a7ad670c268940163
|
7
|
+
data.tar.gz: ec0341af6ef5ea8e0170b9b87c42483f6bc5bc94c5fe0bb7f497464ae69efe0988afdd1c2d3c54bee9b4c970e114c9682f9861fa6ab922cf9852ae4a35e39376
|
data/README.md
CHANGED
@@ -16,7 +16,7 @@ And then execute:
|
|
16
16
|
|
17
17
|
## Usage
|
18
18
|
|
19
|
-
|
19
|
+
Use `Hamlit::Block::Engine` instead of `Hamlit::Engine`. Contents inside script block is not rendered but available via `yield`.
|
20
20
|
|
21
21
|
See [spec](spec/hamlit/block_spec.rb) for detail.
|
22
22
|
|
data/lib/hamlit/block.rb
CHANGED
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'temple'
|
2
|
+
|
3
|
+
# Load tilt/haml first to override if available
|
4
|
+
begin
|
5
|
+
require 'haml'
|
6
|
+
rescue LoadError
|
7
|
+
else
|
8
|
+
require 'tilt/haml'
|
9
|
+
end
|
10
|
+
|
11
|
+
# Load hamlit first to override if available
|
12
|
+
require 'hamlit'
|
13
|
+
|
14
|
+
module Hamlit
|
15
|
+
module Block
|
16
|
+
Template = Temple::Templates::Tilt.create(
|
17
|
+
Hamlit::Block::Engine,
|
18
|
+
register_as: :haml,
|
19
|
+
)
|
20
|
+
|
21
|
+
module TemplateExtension
|
22
|
+
# Activate Hamlit::Helpers for tilt templates.
|
23
|
+
# https://github.com/judofyr/temple/blob/v0.7.6/lib/temple/mixins/template.rb#L7-L11
|
24
|
+
def compile(*)
|
25
|
+
"extend Hamlit::Helpers; #{super}"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
Template.send(:extend, TemplateExtension)
|
29
|
+
end
|
30
|
+
end
|
data/lib/hamlit/block/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hamlit-block
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takashi Kokubun
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hamlit
|
@@ -116,6 +116,7 @@ files:
|
|
116
116
|
- lib/hamlit/block/engine.rb
|
117
117
|
- lib/hamlit/block/script_compiler.rb
|
118
118
|
- lib/hamlit/block/silent_script_compiler.rb
|
119
|
+
- lib/hamlit/block/template.rb
|
119
120
|
- lib/hamlit/block/version.rb
|
120
121
|
homepage: https://github.com/hamlit/hamlit-block
|
121
122
|
licenses:
|
@@ -137,9 +138,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
137
138
|
version: '0'
|
138
139
|
requirements: []
|
139
140
|
rubyforge_project:
|
140
|
-
rubygems_version: 2.
|
141
|
+
rubygems_version: 2.5.2
|
141
142
|
signing_key:
|
142
143
|
specification_version: 4
|
143
144
|
summary: Hamlit extension to support capturing via yield
|
144
145
|
test_files: []
|
145
|
-
has_rdoc:
|