Class: Haml::Filters::TiltBase
- Inherits:
-
Base
- Object
- Base
- Haml::Filters::TiltBase
show all
- Defined in:
- lib/haml/filters/tilt_base.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Class Method Details
.render(name, source, indent_width: 0)
7
8
9
10
11
12
13
14
15
|
# File 'lib/haml/filters/tilt_base.rb', line 7
def self.render(name, source, indent_width: 0)
text = ::Tilt["t.#{name}"].new { source }.render
return text if indent_width == 0
if text.frozen?
text.gsub(/^/, ' ' * indent_width)
else
text.gsub!(/^/, ' ' * indent_width)
end
end
|
Instance Method Details
#explicit_require?(needed_registration) ⇒ Boolean
17
18
19
20
|
# File 'lib/haml/filters/tilt_base.rb', line 17
def explicit_require?(needed_registration)
Gem::Version.new(Tilt::VERSION) >= Gem::Version.new('2.0.0') &&
!Tilt.registered?(needed_registration)
end
|