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, #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

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



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

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

#contextObject



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

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

  @context
end

#gathered_constantsObject



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

def gathered_constants
  context.gathered_constants
end

#generated_errorsObject



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

def generated_errors
  context.errors
end

#rbi_for(constant_name) ⇒ Object



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

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

#use_dsl_compiler(compiler_class) ⇒ Object



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

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