hamlit 2.7.3 → 2.7.5
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 +13 -0
- data/lib/hamlit/rails_template.rb +30 -8
- data/lib/hamlit/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ab6a059796afc90a30c0e1ee9849266d7fdf1fb
|
4
|
+
data.tar.gz: 8c378702fb387e90139b7f06cf4a2f6ac79b27f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a3850facd865215052496f265f1ea037aeb81cacb0a51c9427f3f1865d422493670513665c0ce3cfe789fa82deec9e4750b665c18b0c21c051260d4461770bc
|
7
|
+
data.tar.gz: f491cdfedee20750ac82fc492295d4aaa51d79f798286b984e52387826b8ceb41f4a5ad72ae81ea1eb20bdb2dde77958d81b286bd12e3bd3db33ad0b8db264fa
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,19 @@ All notable changes to this project will be documented in this file. This
|
|
4
4
|
project adheres to [Semantic Versioning](http://semver.org/). This change log is based upon
|
5
5
|
[keep-a-changelog](https://github.com/olivierlacan/keep-a-changelog).
|
6
6
|
|
7
|
+
## [2.7.5](https://github.com/k0kubun/hamlit/compare/v2.7.4...v2.7.5) - 2016-10-15
|
8
|
+
|
9
|
+
### Fixed
|
10
|
+
|
11
|
+
- Resurrect `Hamlit::RailsTemplate.set_options` dropped in v2.7.4 unexpectedly.
|
12
|
+
|
13
|
+
## [2.7.4](https://github.com/k0kubun/hamlit/compare/v2.7.3...v2.7.4) - 2016-10-15 [YANKED]
|
14
|
+
|
15
|
+
### Fixed
|
16
|
+
|
17
|
+
- Compile template as xhtml when ActionView regards template as text/xml
|
18
|
+
[#92](https://github.com/k0kubun/hamlit/issues/92). *Thank to @shmargum*
|
19
|
+
|
7
20
|
## [2.7.3](https://github.com/k0kubun/hamlit/compare/v2.7.2...v2.7.3) - 2016-10-12
|
8
21
|
|
9
22
|
### Fixed
|
@@ -6,14 +6,36 @@ require 'hamlit/parser/haml_helpers'
|
|
6
6
|
require 'hamlit/parser/haml_util'
|
7
7
|
|
8
8
|
module Hamlit
|
9
|
-
RailsTemplate
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
9
|
+
class RailsTemplate
|
10
|
+
# Compatible with: https://github.com/judofyr/temple/blob/v0.7.7/lib/temple/mixins/options.rb#L15-L24
|
11
|
+
class << self
|
12
|
+
def options
|
13
|
+
@options ||= {
|
14
|
+
generator: Temple::Generators::RailsOutputBuffer,
|
15
|
+
use_html_safe: true,
|
16
|
+
streaming: true,
|
17
|
+
buffer_class: 'ActionView::OutputBuffer',
|
18
|
+
}
|
19
|
+
end
|
20
|
+
|
21
|
+
def set_options(opts)
|
22
|
+
options.update(opts)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def call(template)
|
27
|
+
options = RailsTemplate.options
|
28
|
+
|
29
|
+
# https://github.com/haml/haml/blob/4.0.7/lib/haml/template/plugin.rb#L19-L20
|
30
|
+
# https://github.com/haml/haml/blob/4.0.7/lib/haml/options.rb#L228
|
31
|
+
if template.respond_to?(:type) && template.type == 'text/xml'
|
32
|
+
options = options.merge(format: :xhtml)
|
33
|
+
end
|
34
|
+
|
35
|
+
Engine.new(options).call(template.source)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
ActionView::Template.register_template_handler(:haml, RailsTemplate.new)
|
17
39
|
|
18
40
|
# https://github.com/haml/haml/blob/4.0.7/lib/haml/template.rb
|
19
41
|
module HamlHelpers
|
data/lib/hamlit/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hamlit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.7.
|
4
|
+
version: 2.7.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takashi Kokubun
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: temple
|
@@ -369,7 +369,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
369
369
|
version: '0'
|
370
370
|
requirements: []
|
371
371
|
rubyforge_project:
|
372
|
-
rubygems_version: 2.5.1
|
372
|
+
rubygems_version: 2.4.5.1
|
373
373
|
signing_key:
|
374
374
|
specification_version: 4
|
375
375
|
summary: High Performance Haml Implementation
|