hamlit-block 0.4.0 → 0.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1b62b48437a95c5a66b0a728ddc1bcd37aeaec64
4
- data.tar.gz: 46b1e5a1cf26f7730bc9343e3f601e17ab029b5e
3
+ metadata.gz: d9ef99e0052a2b7b0552ae36396d0a8d7067cfc2
4
+ data.tar.gz: 17b0eea2f4914d8db52bf142dfb8326588f22b4e
5
5
  SHA512:
6
- metadata.gz: fe5f0360b02aa69724a86bcc178dfca4d4eaab15bcc67803401e18f017a12cb55dd1af8d0f716ebb4a8d48f813fa19a10145007c6d02a2a9d3a97fb9a1c97a46
7
- data.tar.gz: 28a7067b9bad5707fee6b06c8cf6cf19176857c354bb3bca05525fc37e280154553e75d1bcad8237ebf2e7f8c4928aaa4d5786ec8311064d4ee012f8170dfa1c
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
- Basically the same as Hamlit. `require 'hamlit/block'` may be necessary. Contents inside script block is not rendered but available via `yield`.
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
 
@@ -1,3 +1,4 @@
1
1
  require "hamlit"
2
2
  require "hamlit/block/engine"
3
3
  require "hamlit/block/version"
4
+ require "hamlit/block/template"
@@ -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
@@ -1,6 +1,6 @@
1
1
  module Hamlit
2
2
  module Block
3
- VERSION = "0.4.0"
3
+ VERSION = "0.5.0"
4
4
 
5
5
  begin
6
6
  require 'cell/hamlit/version'
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.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-02 00:00:00.000000000 Z
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.6.8
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: