Sha256: 5dc9c1e0346c274cc1dc43de1666a5cbbf67d8edd2f7fb92782adbcf0188b9b4

Contents?: true

Size: 1.02 KB

Versions: 16

Compression:

Stored size: 1.02 KB

Contents

require_relative 'bootsnap/version'
require_relative 'bootsnap/load_path_cache'
require_relative 'bootsnap/compile_cache'

module Bootsnap
  InvalidConfiguration = Class.new(StandardError)

  def self.setup(
    cache_dir:,
    development_mode: true,
    load_path_cache: true,
    autoload_paths_cache: true,
    disable_trace: false,
    compile_cache_iseq: true,
    compile_cache_yaml: true
  )
    if autoload_paths_cache && !load_path_cache
      raise InvalidConfiguration, "feature 'autoload_paths_cache' depends on feature 'load_path_cache'"
    end

    setup_disable_trace if disable_trace

    Bootsnap::LoadPathCache.setup(
      cache_path:       cache_dir + '/bootsnap-load-path-cache',
      development_mode: development_mode,
      active_support:   autoload_paths_cache
    ) if load_path_cache

    Bootsnap::CompileCache.setup(
      iseq: compile_cache_iseq,
      yaml: compile_cache_yaml
    )
  end

  def self.setup_disable_trace
    RubyVM::InstructionSequence.compile_option = { trace_instruction: false }
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
bootsnap-0.2.15 lib/bootsnap.rb
bootsnap-0.2.14 lib/bootsnap.rb
bootsnap-0.2.13 lib/bootsnap.rb
bootsnap-0.2.12 lib/bootsnap.rb
bootsnap-0.2.11 lib/bootsnap.rb
bootsnap-0.2.10 lib/bootsnap.rb
bootsnap-0.2.9 lib/bootsnap.rb
bootsnap-0.2.8 lib/bootsnap.rb
bootsnap-0.2.7 lib/bootsnap.rb
bootsnap-0.2.6 lib/bootsnap.rb
bootsnap-0.2.5 lib/bootsnap.rb
bootsnap-0.2.4 lib/bootsnap.rb
bootsnap-0.2.3 lib/bootsnap.rb
bootsnap-0.2.2 lib/bootsnap.rb
bootsnap-0.2.1 lib/bootsnap.rb
bootsnap-0.2.0 lib/bootsnap.rb