Module: Tapioca::Helpers::Test::DslCompiler

Extended by:
T::Helpers, T::Sig
Includes:
Content, Isolation, Template
Defined in:
lib/tapioca/helpers/test/dsl_compiler.rb

Defined Under Namespace

Classes: CompilerContext

Constant Summary

Constants included from Template

Template::ERB_SUPPORTS_KVARGS

Constants included from Isolation::Subprocess

Isolation::Subprocess::ORIG_ARGV

Instance Method Summary collapse

Methods included from Template

#indented, #ruby_version, #template

Methods included from Content

#add_content_file, #add_ruby_file, #remove_tmp_path, #teardown, #tmp_path

Methods included from Isolation

forking_env?, #run

Methods included from Isolation::Subprocess

#run_in_isolation

Methods included from Isolation::Forking

#run_in_isolation

Instance Method Details

#activate_other_dsl_compilers(*compiler_classes) ⇒ Object



27
28
29
# File 'lib/tapioca/helpers/test/dsl_compiler.rb', line 27

def activate_other_dsl_compilers(*compiler_classes)
  context.activate_other_dsl_compilers(compiler_classes)
end

#contextObject



47
48
49
50
51
# File 'lib/tapioca/helpers/test/dsl_compiler.rb', line 47

def context
  raise "Please call `use_dsl_compiler` before" unless @context

  @context
end

#gathered_constantsObject



37
38
39
# File 'lib/tapioca/helpers/test/dsl_compiler.rb', line 37

def gathered_constants
  context.gathered_constants
end

#generated_errorsObject



42
43
44
# File 'lib/tapioca/helpers/test/dsl_compiler.rb', line 42

def generated_errors
  context.errors
end

#rbi_for(constant_name) ⇒ Object



32
33
34
# File 'lib/tapioca/helpers/test/dsl_compiler.rb', line 32

def rbi_for(constant_name)
  context.rbi_for(constant_name)
end

#use_dsl_compiler(compiler_class) ⇒ Object



22
23
24
# File 'lib/tapioca/helpers/test/dsl_compiler.rb', line 22

def use_dsl_compiler(compiler_class)
  @context = T.let(CompilerContext.new(compiler_class), T.nilable(CompilerContext))
end