tilt 2.4.0 → 2.9.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.
data/lib/tilt/erubis.rb DELETED
@@ -1,51 +0,0 @@
1
- # frozen_string_literal: true
2
- require_relative 'erb'
3
- require 'erubis'
4
-
5
- warn 'tilt/erubis is deprecated, as erubis requires modifying string literals', uplevel: 1
6
-
7
- module Tilt
8
- # Erubis template implementation. See:
9
- # http://www.kuwata-lab.com/erubis/
10
- #
11
- # ErubisTemplate supports the following additional options, which are not
12
- # passed down to the Erubis engine:
13
- #
14
- # :engine_class allows you to specify a custom engine class to use
15
- # instead of the default (which is ::Erubis::Eruby).
16
- #
17
- # :escape_html when true, ::Erubis::EscapedEruby will be used as
18
- # the engine class instead of the default. All content
19
- # within <%= %> blocks will be automatically html escaped.
20
- class ErubisTemplate < ERBTemplate
21
- def prepare
22
- @freeze_string_literals = !!@options.delete(:freeze)
23
- @outvar = @options.delete(:outvar) || '_erbout'
24
- @options[:preamble] = false
25
- @options[:postamble] = false
26
- @options[:bufvar] = @outvar
27
- engine_class = @options.delete(:engine_class)
28
- engine_class = ::Erubis::EscapedEruby if @options.delete(:escape_html)
29
- @engine = (engine_class || ::Erubis::Eruby).new(@data, @options)
30
- end
31
-
32
- def precompiled_preamble(locals)
33
- [super, "#{@outvar} = _buf = String.new"].join("\n")
34
- end
35
-
36
- def precompiled_postamble(locals)
37
- [@outvar, super].join("\n")
38
- end
39
-
40
- # Erubis doesn't have ERB's line-off-by-one under 1.9 problem.
41
- # Override and adjust back.
42
- def precompiled(locals)
43
- source, offset = super
44
- [source, offset - 1]
45
- end
46
-
47
- def freeze_string_literals?
48
- @freeze_string_literals
49
- end
50
- end
51
- end
data/lib/tilt/maruku.rb DELETED
@@ -1,10 +0,0 @@
1
- # frozen_string_literal: true
2
- require_relative 'template'
3
- require 'maruku'
4
-
5
- warn 'tilt/maruku is deprecated, as maruku requires modifying string literals', uplevel: 1
6
-
7
- # Maruku markdown implementation. See: https://github.com/bhollis/maruku
8
- Tilt::MarukuTemplate = Tilt::StaticTemplate.subclass do
9
- Maruku.new(@data, @options).to_html
10
- end
@@ -1,12 +0,0 @@
1
- # frozen_string_literal: true
2
- require_relative 'template'
3
- require 'wikicloth'
4
-
5
- warn 'tilt/wikicloth is deprecated, as wikicloth requires modifying string literals', uplevel: 1
6
-
7
- # WikiCloth implementation. See: https://github.com/nricciar/wikicloth
8
- Tilt::WikiClothTemplate = Tilt::StaticTemplate.subclass do
9
- parser = @options.delete(:parser) || WikiCloth::Parser
10
- @options[:data] = @data
11
- parser.new(@options).to_html
12
- end