Class: Jade::Compiler
- Inherits:
-
Object
- Object
- Jade::Compiler
- Defined in:
- lib/jade/compiler.rb
Defined Under Namespace
Classes: Config
Instance Method Summary collapse
-
#initialize {|config| ... } ⇒ Compiler
constructor
A new instance of Compiler.
- #require(path) ⇒ Object
Constructor Details
#initialize {|config| ... } ⇒ Compiler
Returns a new instance of Compiler.
5 6 7 |
# File 'lib/jade/compiler.rb', line 5 def initialize yield(config) if block_given? end |
Instance Method Details
#require(path) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/jade/compiler.rb', line 9 def require(path) target = File.("#{build_root}/#{path}.rb", config.project_root) if needs_rebuild?(target) ModuleLoader .load(config.source_root.first, path + '.jd', cache_dir: cache_root) .tap { render_diagnostics(it) } .then { ModuleLoader.emit(it, path: build_root) } end Kernel.require(File.realpath(target)) end |