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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d2c4f53ece3e84d4109c6ea4626a20b6cda6db07
4
- data.tar.gz: 261a4ac4b9d913805a68ec61d2871418869074c0
3
+ metadata.gz: 2ab6a059796afc90a30c0e1ee9849266d7fdf1fb
4
+ data.tar.gz: 8c378702fb387e90139b7f06cf4a2f6ac79b27f9
5
5
  SHA512:
6
- metadata.gz: c628cf49a624558f9e3d36b46d56c56d288c3634d4a7f87486ca440c3664e81176eabb686e17774a6a55af409fe714fdec9a1ab892b139bef3967861158ee396
7
- data.tar.gz: 202b92fb6241ff2156ec0e946372502d4fcd432fe69e9cd947a157a8c18801da1bcf4d38f13e7f9ee606008dc665b391c2275f0df3a87ae14c0d334110606789
6
+ metadata.gz: 0a3850facd865215052496f265f1ea037aeb81cacb0a51c9427f3f1865d422493670513665c0ce3cfe789fa82deec9e4750b665c18b0c21c051260d4461770bc
7
+ data.tar.gz: f491cdfedee20750ac82fc492295d4aaa51d79f798286b984e52387826b8ceb41f4a5ad72ae81ea1eb20bdb2dde77958d81b286bd12e3bd3db33ad0b8db264fa
@@ -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 = Temple::Templates::Rails.create(
10
- Hamlit::Engine,
11
- generator: Temple::Generators::RailsOutputBuffer,
12
- register_as: :haml,
13
- use_html_safe: true,
14
- streaming: true,
15
- buffer_class: 'ActionView::OutputBuffer',
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
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Hamlit
3
- VERSION = '2.7.3'
3
+ VERSION = '2.7.5'
4
4
  end
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.3
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-12 00:00:00.000000000 Z
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