Module: Tapioca::Helpers::Test::DslCompiler
Overview
@requires_ancestor: Kernel
Defined Under Namespace
Classes: CompilerContext
Constant Summary
Constants included from Isolation::Subprocess
Isolation::Subprocess::ORIG_ARGV
Instance Method Summary collapse
-
#activate_other_dsl_compilers(*compiler_classes) ⇒ Object
: (*singleton(Tapioca::Dsl::Compiler) compiler_classes) -> void.
-
#context ⇒ Object
: -> CompilerContext.
-
#gathered_constants ⇒ Object
: -> Array.
-
#generated_errors ⇒ Object
: -> Array.
-
#rbi_for(constant_name, compiler_options: {}) ⇒ Object
: ((Symbol | String) constant_name, ?compiler_options: Hash[Symbol, untyped]) -> String.
-
#use_dsl_compiler(compiler_class) ⇒ Object
: (singleton(Tapioca::Dsl::Compiler) compiler_class) -> void.
Methods included from Template
#indented, #rails_version, #ruby_version, #template
Methods included from Content
#add_content_file, #add_ruby_file, #remove_tmp_path, #teardown, #tmp_path
Methods included from Isolation
Methods included from Isolation::Subprocess
Methods included from Isolation::Forking
Instance Method Details
#activate_other_dsl_compilers(*compiler_classes) ⇒ Object
: (*singleton(Tapioca::Dsl::Compiler) compiler_classes) -> void
25 26 27 |
# File 'lib/tapioca/helpers/test/dsl_compiler.rb', line 25 def activate_other_dsl_compilers(*compiler_classes) context.activate_other_dsl_compilers(compiler_classes) end |
#context ⇒ Object
: -> CompilerContext
45 46 47 48 49 |
# File 'lib/tapioca/helpers/test/dsl_compiler.rb', line 45 def context raise "Please call `use_dsl_compiler` before" unless @context @context end |
#gathered_constants ⇒ Object
: -> Array
35 36 37 |
# File 'lib/tapioca/helpers/test/dsl_compiler.rb', line 35 def gathered_constants context.gathered_constants end |
#generated_errors ⇒ Object
: -> Array
40 41 42 |
# File 'lib/tapioca/helpers/test/dsl_compiler.rb', line 40 def generated_errors context.errors end |
#rbi_for(constant_name, compiler_options: {}) ⇒ Object
: ((Symbol | String) constant_name, ?compiler_options: Hash[Symbol, untyped]) -> String
30 31 32 |
# File 'lib/tapioca/helpers/test/dsl_compiler.rb', line 30 def rbi_for(constant_name, compiler_options: {}) context.rbi_for(constant_name, compiler_options: ) end |
#use_dsl_compiler(compiler_class) ⇒ Object
: (singleton(Tapioca::Dsl::Compiler) compiler_class) -> void
20 21 22 |
# File 'lib/tapioca/helpers/test/dsl_compiler.rb', line 20 def use_dsl_compiler(compiler_class) @context = CompilerContext.new(compiler_class) #: CompilerContext? end |