Class: Funicular::Compiler
- Inherits:
-
Object
- Object
- Funicular::Compiler
- Defined in:
- lib/funicular/compiler.rb
Defined Under Namespace
Classes: NodeNotFoundError, PicorbcMissingError
Constant Summary collapse
- PICORBC_DIR =
picorbc.js + picorbc.wasm bundled into the gem at build time by ‘rake copy_wasm`.
File.("vendor/picorbc", __dir__)
- PICORBC_JS =
File.join(PICORBC_DIR, "picorbc.js")
Instance Attribute Summary collapse
-
#debug_mode ⇒ Object
readonly
Returns the value of attribute debug_mode.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#output_file ⇒ Object
readonly
Returns the value of attribute output_file.
-
#source_dir ⇒ Object
readonly
Returns the value of attribute source_dir.
Instance Method Summary collapse
- #compile ⇒ Object
-
#initialize(source_dir:, output_file:, debug_mode: false, logger: nil) ⇒ Compiler
constructor
A new instance of Compiler.
Constructor Details
#initialize(source_dir:, output_file:, debug_mode: false, logger: nil) ⇒ Compiler
Returns a new instance of Compiler.
16 17 18 19 20 21 |
# File 'lib/funicular/compiler.rb', line 16 def initialize(source_dir:, output_file:, debug_mode: false, logger: nil) @source_dir = source_dir @output_file = output_file @debug_mode = debug_mode @logger = logger end |
Instance Attribute Details
#debug_mode ⇒ Object (readonly)
Returns the value of attribute debug_mode.
14 15 16 |
# File 'lib/funicular/compiler.rb', line 14 def debug_mode @debug_mode end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
14 15 16 |
# File 'lib/funicular/compiler.rb', line 14 def logger @logger end |
#output_file ⇒ Object (readonly)
Returns the value of attribute output_file.
14 15 16 |
# File 'lib/funicular/compiler.rb', line 14 def output_file @output_file end |
#source_dir ⇒ Object (readonly)
Returns the value of attribute source_dir.
14 15 16 |
# File 'lib/funicular/compiler.rb', line 14 def source_dir @source_dir end |
Instance Method Details
#compile ⇒ Object
23 24 25 26 27 |
# File 'lib/funicular/compiler.rb', line 23 def compile check_picorbc_availability! gather_source_files compile_to_mrb end |