Sha256: 0feb63d3d5a11d7d7e1d28c74b4a89344d8d7f0ee1869315b91a62a7087966e2

Contents?: true

Size: 1.08 KB

Versions: 20

Compression:

Stored size: 1.08 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(
      cache_dir: cache_dir + '/bootsnap-compile-cache',
      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

20 entries across 20 versions & 1 rubygems

Version Path
bootsnap-1.1.5-java lib/bootsnap.rb
bootsnap-1.1.5 lib/bootsnap.rb
bootsnap-1.1.4-java lib/bootsnap.rb
bootsnap-1.1.3-java lib/bootsnap.rb
bootsnap-1.1.3 lib/bootsnap.rb
bootsnap-1.1.2-java lib/bootsnap.rb
bootsnap-1.1.2 lib/bootsnap.rb
bootsnap-1.1.1-java lib/bootsnap.rb
bootsnap-1.1.1 lib/bootsnap.rb
bootsnap-1.1.0-java lib/bootsnap.rb
bootsnap-1.1.0 lib/bootsnap.rb
bootsnap-1.1.0.pre-java lib/bootsnap.rb
bootsnap-1.1.0.pre lib/bootsnap.rb
bootsnap-1.0.0 lib/bootsnap.rb
bootsnap-0.3.2 lib/bootsnap.rb
bootsnap-0.3.1 lib/bootsnap.rb
bootsnap-0.3.0 lib/bootsnap.rb
bootsnap-0.3.0.pre3 lib/bootsnap.rb
bootsnap-0.3.0.pre2 lib/bootsnap.rb
bootsnap-0.3.0.pre lib/bootsnap.rb