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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8c5f4662509ff4efce8bde738342f9f97fc5fd8083cb9639006c515e6eb47bdd
4
- data.tar.gz: 38b4fdad0e9b9b0c311c10f58e530bf5ef145582fa5982afc7e58f86ab196181
3
+ metadata.gz: ae96e7920b059541c64822c1cf976b96882e6890839772f99fe5c1b09d5ae9e8
4
+ data.tar.gz: c26bcb2e78ac5d7e6b010b7a90ea977ec2dd3b4f37932402f2b817a8aa29951e
5
5
  SHA512:
6
- metadata.gz: 0df66e4fd938fd5c8477bd24603f0566838897b798756eda7a4769388d0bc5104d6ed4347c2998b3d3b7918a8c3ef886d35d83e78e04bc78769a20afbd3bcee4
7
- data.tar.gz: cac5e1a0a9026838e8ae6d5123f19d7c2388794319d56ebd180d222fc5028c6409a602d8e84ecfb8b77f88b50d2bca27161215bc285b1a02c65a4fbb8e869af2
6
+ metadata.gz: 82a211cd8552c651180096500f7c441a50c3a094c64c7c31afeee5bb781553c62b4e748e79a8a32804c3cbdb004edec7a73742fcce2dae8d53d571fcbedd57e6
7
+ data.tar.gz: a714f49d8b5221816cb75629a4dec47b3463a413a47ab1085514a16f94271544275efdfa946a2059a3799cfba6875b0eb499bd60857752f878650419f11b3670
@@ -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
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- render_me_pretty (0.6.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.0)
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
@@ -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, trim: '-')
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, trim: '-')
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, trim: '-').render(context)
88
+ Tilt::ERBTemplate.new(@path, tilt_options).render(context)
87
89
  end
88
90
  else
89
91
  template.render(context)
@@ -1,3 +1,3 @@
1
1
  module RenderMePretty
2
- VERSION = "0.8.0"
2
+ VERSION = "0.8.1"
3
3
  end
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.0
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-02-27 00:00:00.000000000 Z
11
+ date: 2018-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport