Class: PureScript::Template
- Inherits:
-
Tilt::Template
- Object
- Tilt::Template
- PureScript::Template
- Defined in:
- lib/purescript/template.rb
Overview
PureScript template implementation. See: purescript.org/
PureScript templates do not support object scopes, locals, or yield.
Constant Summary collapse
- @@default_bare =
false
Class Method Summary collapse
- .default_bare ⇒ Object
- .default_bare=(value) ⇒ Object
-
.default_no_wrap ⇒ Object
DEPRECATED.
-
.default_no_wrap=(value) ⇒ Object
DEPRECATED.
- .engine_initialized? ⇒ Boolean
Instance Method Summary collapse
- #allows_script? ⇒ Boolean
- #evaluate(scope, locals, &block) ⇒ Object
- #initialize_engine ⇒ Object
- #prepare ⇒ Object
Class Method Details
.default_bare ⇒ Object
13 14 15 |
# File 'lib/purescript/template.rb', line 13 def self. @@default_bare end |
.default_bare=(value) ⇒ Object
17 18 19 |
# File 'lib/purescript/template.rb', line 17 def self.(value) @@default_bare = value end |
.default_no_wrap ⇒ Object
DEPRECATED
22 23 24 |
# File 'lib/purescript/template.rb', line 22 def self.default_no_wrap @@default_bare end |
.default_no_wrap=(value) ⇒ Object
DEPRECATED
27 28 29 |
# File 'lib/purescript/template.rb', line 27 def self.default_no_wrap=(value) @@default_bare = value end |
.engine_initialized? ⇒ Boolean
31 32 33 |
# File 'lib/purescript/template.rb', line 31 def self.engine_initialized? defined? ::PureScript end |
Instance Method Details
#allows_script? ⇒ Boolean
50 51 52 |
# File 'lib/purescript/template.rb', line 50 def allows_script? false end |
#evaluate(scope, locals, &block) ⇒ Object
46 47 48 |
# File 'lib/purescript/template.rb', line 46 def evaluate(scope, locals, &block) @output ||= `psc #{file} --main` end |
#initialize_engine ⇒ Object
35 36 37 |
# File 'lib/purescript/template.rb', line 35 def initialize_engine require_template_library 'purescript' end |
#prepare ⇒ Object
39 40 41 42 43 44 |
# File 'lib/purescript/template.rb', line 39 def prepare puts "prepare" if !.key?(:bare) and !.key?(:no_wrap) [:bare] = self.class. end end |