render_me_pretty 0.8.0 → 0.8.1
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/CHANGELOG.md +4 -0
- data/Gemfile.lock +2 -2
- data/README.md +6 -0
- data/lib/render_me_pretty/erb.rb +5 -3
- data/lib/render_me_pretty/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ae96e7920b059541c64822c1cf976b96882e6890839772f99fe5c1b09d5ae9e8
|
|
4
|
+
data.tar.gz: c26bcb2e78ac5d7e6b010b7a90ea977ec2dd3b4f37932402f2b817a8aa29951e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 82a211cd8552c651180096500f7c441a50c3a094c64c7c31afeee5bb781553c62b4e748e79a8a32804c3cbdb004edec7a73742fcce2dae8d53d571fcbedd57e6
|
|
7
|
+
data.tar.gz: a714f49d8b5221816cb75629a4dec47b3463a413a47ab1085514a16f94271544275efdfa946a2059a3799cfba6875b0eb499bd60857752f878650419f11b3670
|
data/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
This project *tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
|
|
5
5
|
|
|
6
|
+
## [0.8.1]
|
|
7
|
+
- tilt default_encoding utf-8
|
|
8
|
+
- update readme with layout support
|
|
9
|
+
|
|
6
10
|
## [0.8.0]
|
|
7
11
|
- pull request #1 from tongueroo/layout-support
|
|
8
12
|
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
render_me_pretty (0.
|
|
4
|
+
render_me_pretty (0.8.0)
|
|
5
5
|
activesupport
|
|
6
6
|
colorize
|
|
7
7
|
tilt
|
|
@@ -20,7 +20,7 @@ GEM
|
|
|
20
20
|
i18n (0.9.5)
|
|
21
21
|
concurrent-ruby (~> 1.0)
|
|
22
22
|
minitest (5.11.3)
|
|
23
|
-
rake (12.3.
|
|
23
|
+
rake (12.3.1)
|
|
24
24
|
rspec (3.7.0)
|
|
25
25
|
rspec-core (~> 3.7.0)
|
|
26
26
|
rspec-expectations (~> 3.7.0)
|
data/README.md
CHANGED
|
@@ -47,6 +47,12 @@ There's also a convenience class method:
|
|
|
47
47
|
RenderMePretty.result("/path/to/tempate.erb", a: 5)
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
+
### Layout Support
|
|
51
|
+
|
|
52
|
+
```ruby
|
|
53
|
+
RenderMePretty.result("/path/to/tempate.erb", layout: "/path/to/layout.erb")
|
|
54
|
+
```
|
|
55
|
+
|
|
50
56
|
### Custom Context
|
|
51
57
|
|
|
52
58
|
```ruby
|
data/lib/render_me_pretty/erb.rb
CHANGED
|
@@ -73,17 +73,19 @@ module RenderMePretty
|
|
|
73
73
|
context.instance_variable_set('@' + key.to_s, value)
|
|
74
74
|
end
|
|
75
75
|
|
|
76
|
+
# https://github.com/gotar/dry-view/commit/39e3f96625bf90da2e51fb1fd437f18cedb9ae8c
|
|
77
|
+
tilt_options = {trim: '-', default_encoding: "utf-8"}
|
|
76
78
|
if @layout_path
|
|
77
|
-
layout = Tilt::ERBTemplate.new(@layout_path,
|
|
79
|
+
layout = Tilt::ERBTemplate.new(@layout_path, tilt_options)
|
|
78
80
|
else
|
|
79
81
|
# trim mode: https://searchcode.com/codesearch/view/77362792/
|
|
80
|
-
template = Tilt::ERBTemplate.new(@path,
|
|
82
|
+
template = Tilt::ERBTemplate.new(@path, tilt_options)
|
|
81
83
|
end
|
|
82
84
|
|
|
83
85
|
begin
|
|
84
86
|
if @layout_path
|
|
85
87
|
layout.render(context) do
|
|
86
|
-
Tilt::ERBTemplate.new(@path,
|
|
88
|
+
Tilt::ERBTemplate.new(@path, tilt_options).render(context)
|
|
87
89
|
end
|
|
88
90
|
else
|
|
89
91
|
template.render(context)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: render_me_pretty
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.8.
|
|
4
|
+
version: 0.8.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tung Nguyen
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-
|
|
11
|
+
date: 2018-03-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|